Dash-Industry-Forum / livesim2

DASH Live Source Simulator v2 in Go
Other
37 stars 6 forks source link

Support HbbTV pre-encrypted content that works with livesim1 #219

Open tobbee opened 2 weeks ago

tobbee commented 2 weeks ago

Something in livesim2 prohibits the looping of some pre-encrypted HbbTV test content that works with livesim1.

This issue is about making the necessary changes to livesim2 in order to make that content work. Some minimal changes may also be needed on the content.

This may include things like:

  1. Making a more transparent MPD processing with a SAX XML parser
  2. Check and possibly improve the handling of encrypted audio segments

See #213 for a case where pre-encrypted Widevine video was made to work by tuning the packager.

Murmur commented 2 weeks ago

If you need test content(zipped assets data) feel free to contact me. We run nodrm on Livesim2 and drm on Livesim1.

Test player https://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html

Livesim2: NoDRM https://refapp.hbbtv.org/livesim2/tsbd_240/mup_4/spd_8/utc_keep/00_llama_h264_v9/manifest_1080p.mpd

Livesim1: DRM CENC widevine laUrl works for few weeks. https://refapp.hbbtv.org/livesim/mup_4/spd_8/00_llama_h264_v9_8s_cenc/manifest_baseurl_wv.mpd https://wv.service.expressplay.com/hms/wv/rights/?ExpressPlayToken=BwAAABc2KeEAJDY2NzY5OWMwLTViODYtNDMwOS1iMjA4LTRlY2JkMjdmMWNmOAAAAIC7eetKNLrt0kWI-1g6u46WqQO13UEUkHevGFyrWZgfOYoPqWTl_d7A3qn7T1XpfADcozqapYVkHYwVekuq56wND7Sl35MlUFe4ecVKIHU5vjzoczEpth9-q-bIc1vrWZNfoQbBKBxy3Q1jXib_CbukzBiQv3HxYmFezmal6JCiawF3LH4Ptqg6iG38rTNCaAnAuLKM

Livesim1: DRM CBCS widevine laUrl works for few weeks. https://refapp.hbbtv.org/livesim/mup_4/spd_8/00_llama_h264_v9_8s_cbcs/manifest_baseurl_wv.mpd https://wv.service.expressplay.com/hms/wv/rights/?ExpressPlayToken=BwAAABc2KfcAJDY2NzY5OWMwLTViODYtNDMwOS1iMjA4LTRlY2JkMjdmMWNmOAAAAIDO1fImL3H2sAcEsPbaJ7lvHKsudYA2crFN_RqG9_eMl5Veynbrosm-HsP_Cv_2Gvt8veUp2rt-2iGK45Kqx-1riTiiCn9fhfNRKDyGFk9qq_KCkyh8hpXXQMaMIKFRlXuBNvcHWu8NDIy0W8shSYGVNfNPZ6HhMIYmEMb0P9CrBnnyJ9Jwth-GoDCiNyqRIaLO96rr

Vod without livesim: DRM CENC widevine laurl works for few weeks. https://refapp.hbbtv.org/videos/00_llama_h264_v9/cenc/manifest_wvcenc_1080p.mpd https://wv.service.expressplay.com/hms/wv/rights/?ExpressPlayToken=BwAAABc2KeEAJDY2NzY5OWMwLTViODYtNDMwOS1iMjA4LTRlY2JkMjdmMWNmOAAAAIC7eetKNLrt0kWI-1g6u46WqQO13UEUkHevGFyrWZgfOYoPqWTl_d7A3qn7T1XpfADcozqapYVkHYwVekuq56wND7Sl35MlUFe4ecVKIHU5vjzoczEpth9-q-bIc1vrWZNfoQbBKBxy3Q1jXib_CbukzBiQv3HxYmFezmal6JCiawF3LH4Ptqg6iG38rTNCaAnAuLKM


This does not work, it's an init segment 404NotFound reply, I know all files are available in an asset folder. ps: we do have extra init files in a folder but guess it's just files referenced in a vod manifest that's prepared by livesim2 (we copypaste vod folders to livesim2 asset folder).

Livesim2: DRM CENC widevine laUrl works for few weeks but this playback does not work. https://refapp.hbbtv.org/livesim2/tsbd_240/mup_4/spd_8/utc_keep/00_llama_h264_v9_cenc/manifest_wvcenc_1080p.mpd https://wv.service.expressplay.com/hms/wv/rights/?ExpressPlayToken=BwAAABc2KeEAJDY2NzY5OWMwLTViODYtNDMwOS1iMjA4LTRlY2JkMjdmMWNmOAAAAIC7eetKNLrt0kWI-1g6u46WqQO13UEUkHevGFyrWZgfOYoPqWTl_d7A3qn7T1XpfADcozqapYVkHYwVekuq56wND7Sl35MlUFe4ecVKIHU5vjzoczEpth9-q-bIc1vrWZNfoQbBKBxy3Q1jXib_CbukzBiQv3HxYmFezmal6JCiawF3LH4Ptqg6iG38rTNCaAnAuLKM

tobbee commented 1 day ago

I looked a little at loading https://refapp.hbbtv.org/videos/00_llama_h264_v9/cenc/manifest_wvcenc_1080p.mpd into livesim2. As far as I can tell, the MPD and init segments look fine and I managed to fetch all the init segments.

When it comes to the video and audio segments, there are problems though.

One particular issue with them is that they all have two fragments which are independently encrypted. That complexity may contribute to the error I see when analysing the first output segment, number 0, by specifying:

curl -O http://localhost:8888/livesim2/hbbtv/v1/0.m4s\?nowMS\=10000
mp4ff-info 0.m4s

results in the result offset from saio (730) relative moof start differs from senc data start 726. I cannot guarantee it, but segments with a single fragment may work better.

It should of course be possible to support this type of segments, but I don't know when I will get time to look into it.

Murmur commented 1 day ago

@tobbee thanks, we do indeed use a multi moof+mdat(2..N) structure in a test material to see clients support it properly.

I create a separate test with the same settings but just one moof+mdat pair and let you know.