Safari中的HTML5视频

时间:2012-06-27 09:44:26

标签: html5 video safari h.264

目前有点困惑,我有2个.mp4文件,都有h.264编码的视频。

| #Safari | Video 1 | Video 2 |
| Windows | Failed  | Played  |
|   OSX   | Played  | Played  |

我的代码

<video width="550" height="400" controls>
    <source src="test/charlie.mp4" type="video/mp4" /> 
    <source src="test/charlie.ogv" type="video/ogg" /> 
  Nope.
</video>    

视频1

Status: HTTP/1.1 200 OK
Date:   Wed, 27 Jun 2012 09:19:02 GMT   
Server: Apache/2.2.22 (Debian)  
Last-Modified:  Wed, 27 Jun 2012 08:06:41 GMT   
ETag:   "aff04e8-49c7f3-4c36fb1f12640"  
Accept-Ranges:  bytes   
Content-Length: 4835315 
Connection: close   
Content-Type:   video/mp4

视频2

Status: HTTP/1.1 200 OK
Date:   Wed, 27 Jun 2012 09:18:37 GMT   
Server: Apache/2.2.22 (Debian)  
Last-Modified:  Mon, 28 Dec 2009 05:06:33 GMT   
ETag:   "aff04eb-45de48-47bc2de762840"  
Accept-Ranges:  bytes   
Content-Length: 4578888 
Connection: close   
Content-Type:   video/mp4

我用于视频1的ffmpeg命令是

ffmpeg -y -i input.avi -vcodec libx264 -r 24 -preset medium -crf 20 -bufsize 20M -acodec libfaac -ac 2 -ar 44100 -ab 128k out.mp4

之前有人见过这种行为吗?

1 个答案:

答案 0 :(得分:0)

-preset medium看起来有点可疑。究竟是什么? IIUC H264依赖于[级别](http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels],它们在设备和浏览器之间有不同的支持。