如何使用ffmpeg分割mp4文件. [英] How to fragment an mp4 file using ffmpeg.

查看:118
本文介绍了如何使用ffmpeg分割mp4文件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用ffmpeg分割mp4文件.我遵循以下命令"如何使用ffmpeg输出片段化的mp4?",但文件大小几乎增加了一倍.还有其他办法吗?

How to fragment an mp4 file using ffmpeg.I have followed this command "How to output fragmented mp4 with ffmpeg?" but it almost doubles the file size. Is there any other way ?

推荐答案

我认为您获得了更大的文件大小,因为您以比输入文件更高的比特率对其进行了重新编码.

I think you get a higher file size because you reencode it with higher bitrates than the input file.

在链接的答案中,您可以修改 -ab -vb 的设置:

In the linked answer, you can modify the settings for -ab and -vb:

ffmpeg -i infile.ext -g 52 \
-strict experimental -acodec aac -ab 64k -vcodec libx264 -vb 448k \
-f mp4 -movflags frag_keyframe+empty_moov \
output.mp4

(提示:如果不需要,请不要使用 -re )

(Hint: Do not user -re if not necessary)

如果您没有输入文件中的比特率,请使用ffprobe获取所有流的比特率:

If you don't have the bitrates from the input file, use ffprobe to get it for all streams:

ffprobe -i input.mp4

(查找Stream#0:0,Stream#0:1等等,如果是音频或视频)

(look for Stream#0:0, Stream#0:1 and so on and if it is Audio or Video)

未经测试:您也可以尝试复制流:

Not tested: You can also try to copy the streams:

ffmpeg -i input.mp4 -g 52 \
-strict experimental -c copy \
-f mp4 -movflags frag_keyframe+empty_moov \
output.mp4

(仅适用于mp4输入吗?!)

(only works with mp4 input?!)

这篇关于如何使用ffmpeg分割mp4文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆