重新调整mp4并以编程方式使用ffmpeg更改分辨率(Remuxing mp4 and change resolution with ffmpeg programmatically)

编程入门 行业动态 更新时间:2024-10-19 02:25:26
重新调整mp4并以编程方式使用ffmpeg更改分辨率(Remuxing mp4 and change resolution with ffmpeg programmatically)

我有一个从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.

更多推荐

本文发布于:2023-08-06 16:46:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1454561.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:并以   分辨率   方式   ffmpeg   change

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!