简体   繁体   English

用ffmpeg编码的视频无法在Chrome中播放

[英]Video encoded with ffmpeg not playing in Chrome

I've been trying just about every single permutation of options on ffmpeg to try to get a transcoded video to display on Chrome - OSX 39.0.2171.71 (64-bit) - so far nothing has worked. 我一直在尝试在ffmpeg上进行几乎每个选项的排列,以尝试将转码后的视频显示在Chrome上-OSX 39.0.2171.71(64位)-到目前为止没有任何效果。

The settings I am currently using look like: 我当前使用的设置如下所示:

/usr/local/Cellar/ffmpeg/2.4.3/bin/ffmpeg -i source.m4v -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3.0 -preset slower -crf 23 -vf scale=640:360 target.mp4

but I've tried various options from various other answers with no success. 但我尝试了其他各种答案的各种选择,但都没有成功。

The video-js demo video works fine, so it must be possible somehow. video-js演示视频可以正常工作,因此一定可以实现。 Here's a dump of the encoded video: 这是编码视频的转储:

*** General Parameters ***
- Name:  test-1 (2).mp4 
- Container:  MP4 - QuickTime 
- Size:  3.45 MB 
- Duration:  32s 299ms 
- Bitrate:  856 Kbps 

*** Video Track Parameters ***
- Format:  H.264/MPEG-4 AVC 
- Bitrate:  Max.: --- / Average: 721 Kbps / Min.: --- 
- Frame rate (fps):  Max.: --- / Average: 30.000 / Min.: --- 
- Encoding profile:  Baseline@L3.0 
- Image size:  640*360 
- Pixel Aspect Ratio:  Undefined 
- Display Aspect Ratio:  16:9 
- Interlacing:  Progressive 

*** First Audio Track Parameters ***
- Format:  AAC - MPEG-4 audio 
- Bitrate:  128 Kbps 
- Resolution:  Undefined 
- Rate:  44.1 KHz 
- Channel(s):  2 (stereo) 
- Position:  Front: L R 

Turns out that the metadata is in the wrong place. 原来,元数据放置在错误的位置。 Adding -movflags +faststart to the ffmpeg parameter list makes it start working. 在ffmpeg参数列表中添加-movflags +faststart使其开始工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM