使用 C 语言通过 FFmpeg 保存部分视频
我正在使用 Java、JNI、C 和 FFmpeg 创建一个简单的视频编辑应用程序。 UI 是用 Java 设计的,我正在使用 JNI 从 C 文件与 FFmpeg 进行通信。有人对我应该使用 FFmpeg 保存部分视频文件的最佳方式有任何建议吗?我允许用户选择要保存的视频部分,我现在的想法是基本上循环所有数据包并解码每个帧(如果需要编码为不同的格式),然后将帧保存到一个文件。始终根据用户开始和停止作物部分来寻找视频的不同部分。如果这没有意义,我很乐意澄清它。任何想法都非常感谢,因为我只是想创建最有效和最正确的方法来做到这一点。谢谢!
I am creating a simple video editing application using Java, JNI, C, and FFmpeg. The UI is being designed in Java and I am talking with FFmpeg from a C file using JNI. Does anyone have any suggestions as to the best way I should go about saving part of a video file using FFmpeg? I am allowing the users to choose parts of the video to save and what I am thinking as of right now is to basically loop through all of the packets and decode each frame (if need to encode to a different format) then save the frame to a file. All the while seeking to different parts of the video based on the users start and stop sections of their crops. If this doesn't make sense I would be glad to clear it up. Any ideas are much appreciated as I am just looking to create the most efficient and correct way to go about doing this. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用xuggler吗?它会为您完成所有工作,而无需您弄清楚 jni 绑定。
Use xuggler? It will do all for you without you having to figure out the jni bindings.