我有一个从ffmpeg工作的remuxing.c示例,但我需要更改分辨率以最小化文件大小,任何人都可以解释我该怎么做? 或者,如果有另一种方法来“压缩”没有命令行的mp4文件? 我是FFmpeg的开销者,需要将视频文件从android发送到服务器,我正在部署NDK库来完成这项工作,因为FFmpeg命令行实现有一些限制并且非常慢。
谢谢
I have a remuxing.c example working from ffmpeg but I need to change resolution to minimize file size, anybody can explain me how to do that? Or if there is another way to "compress" mp4 files without command line? I'm a begginer with FFmpeg and need to send video files from android to server, and I'm deploying a NDK library to make this job because FFmpeg command-line implementation have some limitations and is very slow.
Thanks
最满意答案
您应该查看过滤视频和转码示例。 第一个介绍了如何在ffmpeg中添加“过滤器”。 它包括一个缩放滤镜,可将视频重新缩放到给定的分辨率。 转码包括一些过滤,您实际上可以将filter_spec字符串更改为您想要的任何内容,并且程序应该缩放您的输入视频。
这可能不是最好的解决方案,我自己发现它,但它至少会向您介绍正在使用的组件。
You should take a look at the filtering video and the transcoding examples. The first one goes through how you add "filters" in ffmpeg. It includes a scaling filter, which will rescale the video to a given resolution. Transcoding includes some filtering, and you can actually change the filter_spec string to be whatever you want, and the program should scale your input video.
This is probably not the best solution, I just found it myself, but it at least introduces you to the components being used.
更多推荐
发布评论