简体   繁体   English

重塑mp4并以编程方式使用ffmpeg更改分辨率

[英]Remuxing mp4 and change resolution with ffmpeg programmatically

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? 我有一个从ffmpeg运行的remuxing.c示例,但是我需要更改分辨率以最小化文件大小,任何人都可以解释我该怎么做? Or if there is another way to "compress" mp4 files without command line? 或者,如果有另一种无需命令行即可“压缩” mp4文件的方法? 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. 我是FFmpeg的初学者,需要将android的视频文件发送到服务器,并且我正在部署NDK库来完成此工作,因为FFmpeg命令行实现有一定的局限性并且非常慢。

Thanks 谢谢

You should take a look at the filtering video and the transcoding examples. 您应该看一下过滤视频转码示例。 The first one goes through how you add "filters" in ffmpeg. 第一个介绍了如何在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. 转码包括一些过滤,您实际上可以将filter_spec字符串更改为所需的值,并且程序应缩放您的输入视频。

This is probably not the best solution, I just found it myself, but it at least introduces you to the components being used. 这可能不是最好的解决方案,我只是自己找到了,但是它至少向您介绍了所使用的组件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM