转换后的mp4 h264基准格式会长时间加载 [英] Converted mp4 h264 baseline format loads long time

查看:167
本文介绍了转换后的mp4 h264基准格式会长时间加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将视频转换为mp4 x264基准格式,并且可以在所有PC/手机上正常使用,问题是加载视频需要很长时间,而谷歌搜索得知ffmpeg会在该位置转换并设置索引文件视频中的任何一个,以便将其加载到最后以阅读然后播放视频.因此,任何建议都可以缩短加载时间. 注意:尝试了QT指数swapper2,但差异很大,请提出建议.

I have converted my video to mp4 x264 baseline format and it works fine with all pc/mobile phones , the problem is it takes long time to load the video while googling came to know that ffmpeg converts and sets the index file at the eof the video so it loads to the end to read and then plays the video, So any advices would be appreciatable to cut short the loading time. Note:tryied out QT index swapper2 but dint give much difference , please advice .

这是我用来转换的cmd-

this is the cmd i used to convert -

ffmpeg -i…-c:v libx264 -profile:v基线-级别1…

感谢您的时间.

推荐答案

您有几种方法可以重新放置moov原子,以便在客户端完全下载视频之前就可以开始播放视频.

You have several options to relocate the moov atom so the video can begin playback before it is completely downloaded by the client.

最简单的是重新编码时的选项-movflags faststart:

The easiest is the option -movflags faststart when re-encoding:

ffmpeg -i input -c:v libx264 -profile:v baseline -movflags faststart output.mp4

如果您已经对.mp4文件进行了编码,但只想移动原子:

If you already encoded your .mp4 file, but simply want to move the atom:

ffmpeg -i input.mp4 -codec copy -movflags faststart output.mp4

您可能需要获取较新的ffmpeg版本才能使用此选项.请参阅 FFmpeg下载页面,以获取适用于Linux,OS X和Windows的ffmpeg版本的链接,也可以按照以下说明进行操作:逐步编译ffmpeg的指南.

You may need to get a more recent ffmpeg version to use this option. See the FFmpeg download page for links to ffmpeg builds for Linux, OS X, and Windows, or you can follow a step-by-step guide to compile ffmpeg.

或者,您可以使用ffmpeg源附带的qt-faststart工具:

Alternatively you can use the qt-faststart tool that comes with the ffmpeg source:

cd ~/ffmpeg/tools
make qt-faststart
./qt-faststart input.mp4 output.mp4

MP4Box

或者您可以使用MP4Box(通常由gpac软件包提供,具体取决于您的发行版):

MP4Box

Or you could use MP4Box (usually provided by the gpac package depending on your distro):

MP4Box -add input.mp4 output.mp4


另请参见

  • FFmpeg和x264编码指南
  • FFmpeg和AAC音频编码指南

  • Also See

    • FFmpeg and x264 Encoding Guide
    • FFmpeg and AAC Audio Encoding Guide
    • 这篇关于转换后的mp4 h264基准格式会长时间加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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