且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 FFMPEG 为 Android 转换视频

更新时间:2022-03-18 02:08:19

由 ffmpeg 创建的 MP4 在尾部有 moov 标头.这就是您收到此错误消息的原因.ffmpeg 可以将 moov header 放在前面(适合流式传输).

The MP4 created by ffmpeg has the moov header at the tail. That is why you are getting this error message. ffmpeg can put the moov header in front (suitable for streaming).

只需运行:

ffmpeg -i <input> -c:v libx264 -c:a aac -movflags +faststart output.mp4

另请参阅在 ffmpeg 中进行后处理以移动 MP4 文件中的moov atom"(qt-faststart)