使用 FFMPEG 将 -movflags +faststart 添加到 MP4 的最快方法,其他一切保持原样 [英] Fastest way to add -movflags +faststart to an MP4 using FFMPEG, leaving everything else as-is

查看:47
本文介绍了使用 FFMPEG 将 -movflags +faststart 添加到 MP4 的最快方法,其他一切保持原样的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将 -movflags +faststart 添加到 mp4 文件中.基本上这就是我想做的一切,其他什么都不应该改变.我正在使用 ffmpeg.

I want to add -movflags +faststart to an mp4 file. Basically that is all I want to do, nothing else should be changed. I am using ffmpeg.

最快的方法是什么?我必须重新编码整个视频吗?或者有更好/更简单的方法吗?

What's the fastest way to do this? Do I have to re-encode the whole video? Or is there a better/easier way?

推荐答案

就这么简单:

ffmpeg -i in.mp4 -c copy -map 0 -movflags +faststart out.mp4

或者如果你可以从源代码编译FFmpeg,在tools/目录下制作工具qt-faststart并运行它:

Or if you can compile FFmpeg from source, make the tool qt-faststart in the tools/ directory and run it:

qt-faststart in.mp4 out.mp4

您也可以使用 mp4box,它可以让您通过以下命令将 MOOV 原子移动到开头:

You can also use mp4box, which lets you move the MOOV atom to the start via this command:

mp4box -inter 0 in.mp4 -out out.mp4

或者如果你想完全通过交错音频/视频数据来优化流式传输,以便可以轻松地实时流式传输文件:

Or if you want to fully optimize for streaming by also interleaving the audio/video data so that the file can be easily streamed in realtime:

mp4box -inter 500 in.mp4 -out out.mp4

这篇关于使用 FFMPEG 将 -movflags +faststart 添加到 MP4 的最快方法,其他一切保持原样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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