2011-05-27

【系統】Nginx : H.264 (mp4) 影片不能在 Flash Player 中播放


今天遇到個怪問題,在Flash Player 中,影片居然不能播放。
但大部份的影片都是可以的,怪了。
一直以為是Player 的問題。
因為Server 都有正常吐檔 200,而且Player 也正確的載入了影片。
但就是不會播放……
後來Google 了一下,找到有人也有一樣的問題。
nginx module & flowplayer particular videos error
最後他們的解法就是使用 MP4Box
節錄一些他們討論的重點:

arjen said:
When most of the videos play (and seek) correctly then it's most likely an issue with the encoding.
What you could try is to run your encoded MP4 files through MP4Box (part of gpac). This program catches a lot of errors and can fix most of them.


akhkharu said:
Thanks, Arjen, it was indeed the problem in the file (but some strange problem since MP4Box -info showed me no errors).
After passing those files through the MP4Box (MP4Box -add file.mp4 out.mp4) the videos are loading fine with flowplayer.


所以我們將有問題的檔案,再經過 MP4Box 來處理一下。
結果真的可以正常播放了,太帥氣了。
呼~~

UPDATE : 2011-06-01
BY KYO:
從GPAC 的 MP4Box 官網得知以下訊息 :
As of version 0.2.4, MP4Box always stores the file with 0.5 second interleaving and meta-data at the begining, making it suitable for HTTP streaming.
When using -add option, MP4Box will automatically create default BIFS and OD tracks to make the resulting file compliant with the ISMA 1.0 standard if possible.
原文 : http://gpac.wp.institut-telecom.fr/mp4box/mp4box-documentation/

1 comments: