简体   繁体   中英

MPEG-DASH picky in fragmented mp4 sampleOffsets and sampleSizes?

Hey StackOverflow fellows. Currently I encountered a problem with MPEG-DASH players not wanting to play DASH content. Basically, I have an MP4 source in which I'm feeding it in 2 channels, 1 is through RTMP and the other is in RTSP. I then connect to both channels and create an MPEG-DASH content out of it. The output DASH for both is basically the same, same manifest content, same number of fragments. When playing with industry's DASH player (ie GPAC Osmo4, digital primates, castlabs dashas), The DASH content generated from the RTMP source is working perfectly, however, the DASH content generated from the RTSP source is problematic (ie a lot of video freezes, a/v out of sync, etc...). When comparing the DASH fragments generated from RTMP against RTSP, the only difference is the samplingOffsets and samplingSizes in the Trun box. But they have the same sampleCounts. Same fragments was used in MSS and the MSS player played both okay regardless of the difference in samplingOffsets and samplingSize.

Does anyone know if MPEG DASH has a requirement with regards to the size of each samples in Trun and also for the offsets? Or what could cause this problem?

I welcome any opinions, advice. Just shoot it...

Based on your description the issues are most likely caused due to wrong parameters during the content generation. Please have a look at 'MPEG-DASH CONTENT GENERATION USING MP4BOX AND X264' , as they describe helpful tools and steps to get valid content.

Have you already checked if the baseMediaDecodeTime- timestamps (which can be found in the tfdt box of media segments) are valid for both audio and video?

Best, Alex

With some hours of brain exhausting R&D, I found out that the a/v out of sync, fast-forward playback, and too long buffer time is caused by a wrong "timescale" value in the segment initialization file. The manifest and the fragmented mp4s (.m4s) are encoded with 1000 timescale, however the segment initialization has a timescale value in its "tfhd" box of 90000. Changing this to 1000 solve the problem mentioned above. The other problem is the occasional freezing of video, I found out that the cause of this problem is an invalid sample. There are samples with size == 0 bytes but with duration > 0, in MSS this is okay, the player will still play it, but in MPEG-DASH the player will freeze. Not writing those samples with size == 0 in the fragmented mp4 solved the problem.

cheers :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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