Unable to get MediaSource working with mp4 format in chrome

前端 未结 2 1361
忘掉有多难
忘掉有多难 2020-12-28 09:48

Based on the example here

I downloaded the webm file and encoded as an mp4 file which will play locally but I\'m unable to use it as a media source.

MP4Box r

相关标签:
2条回答
  • 2020-12-28 10:26

    The problem is your file. Media source extensions requires fragmented MP4 with the moov(movie header box) at the beginning of the file, in your case it is placed last.

    Also there need to be a moof (Movie fragment box) preceding the mdat (media data box). MP4Box is capable of generating DASH compliant fragmented mp4, but I would recommend that you use their latest nightly releases.

    MP4Box -dash 1000 -rap -frag-rap test.mp4
    

    This will generate the a correctly structured fragmented mp4 file with the moov placed in the beginning of the file. Each fragment will be 1 second, starting with a key frame.

    0 讨论(0)
  • 2020-12-28 10:27

    Your codec is wrong too, would be 'video/mp4; codecs="avc1.4D4001,mp4a.40.2"'

    0 讨论(0)
提交回复
热议问题