DolbyLaboratories / dlb_mp4base

The Dolby MP4 streaming muxer (dlb_mp4base) is a software implementation of a muxer of fragmented or unfragmented ISO base media file format (mp4). It supports muxing of Dolby Digital (AC-3), Dolby Digital Plus (E-AC-3), and Dolby AC-4 audio formats as well as Dolby Vision.
BSD 3-Clause "New" or "Revised" License
254 stars 60 forks source link

Black screen on iOS/ATV even dvh1flag #28

Closed sw5163 closed 1 year ago

sw5163 commented 2 years ago

When converting dvhe->dvh1, mp4muxer leads to black screen on iOS/ATV. File produced by mp4box and mp4mux(bento4) will be fine. Someone send me this:

'hvc1' stores all parameter sets inside the MP4 container below the sample description boxes. 
'hev1' stores all parameter sets in band (inside the HEVC stream).

The parameter sets are essentially mandatory metadata necessary to decode the streams.

So you have two slightly different ways of muxing HEVC into MP4.

I'd choose based on the play out and transport scenario.

Your player or your transport specification may require one or the other.
XingzhaoYun commented 2 years ago

Could you help provide the details of how to convert?

sw5163 commented 2 years ago

Dolby's official demo can directly play on iOS internal player.

ffmpeg -i video.mp4 -c copy dv.hevc to extract

mp4muxer -i dv.hevc --dv-profile 5 --dvh1flag 0 black screen on iOS/ATV.

mp4box -add dv.hevc -new p5.dvh1.mp4 play as normal.

mp4mux(bento4) --track dv.hevc#dv_profile=5,frame_rate=59.94 play as normal.

But I'm really not good at programming, sorry.

sw5163 commented 1 year ago

It turns out Apple can retrieve the information needed to initialize the decoder even if the file is wrongly muxed. But it requires powerful processor. So on newer iPhone/Mac/ATV playback will not have the black screen problem.