在ffmpeg中进行后处理以在MP4文件中移动'moov atom'(qt-faststart)

sil*_*npi 28 mp4 ffmpeg video-processing video-streaming video-conversion

是否可以从命令行运行ffmpeg,它将'moov atom'元数据放在MP4文件的开头或运行qt-faststart作为ffmpeg中的后处理操作,这样生成的文件就可以通过互联网?

我当然可以将它作为一个单独的命令运行,但更喜欢它是某种东西

  • 作为ffmpeg中的选项,或
  • 作为转换后的一部分,通过ffmpeg转换视频文件时的命令行选项

编辑1

http://ffmpeg.org/ffmpeg.html#mov

MOV/MP4复用器

多路复用器选项包括:

'-moov_size字节'

Reserves space for the moov atom at the beginning of the file instead of 
placing the moov atom at the end. If the space reserved is insufficient, 
muxing will fail.
Run Code Online (Sandbox Code Playgroud)

Sal*_*n A 60

好像快速启动支持已包含在ffmpeg中.FFmpeg格式文档:

-movflags faststart

运行第二遍,将moov原子移动到文件顶部.此操作可能需要一段时间,并且在分段输出等各种情况下不起作用,因此默认情况下不启用.

  • @SagarPilkhwal它可能使用HTTP Range标头从文件末尾请求字节.Web服务器必须支持它.与下载恢复相同的机制. (2认同)
  • 命令:ffmpeg -i input.mp4 -vcodec copy -acodec copy -movflags faststart output.mp4 (2认同)

sil*_*npi 9

在ffmpeg转换过程之后,结束设置并运行qt-faststart.

  • 这更恰当地是评论而非答案.@stharward回复更符合回答. (19认同)