Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with profile onDemand and DRM #2808

Open
MarianoFacundoArch opened this issue Apr 19, 2024 · 13 comments
Open

Bug with profile onDemand and DRM #2808

MarianoFacundoArch opened this issue Apr 19, 2024 · 13 comments

Comments

@MarianoFacundoArch
Copy link

When using profile onDemand and drm (also with dual) the output is weird.
Cannot be played, and most important, when we look at the M3U8 file it looks like this, so it doesn't even show it is DRM protected even it is (and if we look at full-segment.mp4 it shows all green as it is). However, when trying to play from the mpd file, that shows it is DRM, it cannot be played either.

Some weird thing is happening, I cannot figure out what

#EXTM3U
#EXT-X-TARGETDURATION:5
#EXT-X-VERSION:6
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MAP:URI="full-segment.mp4",BYTERANGE="1151@0"
#EXTINF:5
#EXT-X-BYTERANGE:142072@1283
full-segment.mp4

#EXT-X-ENDLIST
@MarianoFacundoArch
Copy link
Author

@jeanlf, how can I help track this? It's just not working.
The desired effect is to have a segment+init in the same resulting file

@MarianoFacundoArch
Copy link
Author

@rbouqueau Do you have any guess on this?

@rbouqueau
Copy link
Member

I confirm we loose the encryption info in the manifest:

gpac -i beepbop.mp4 cecrypt:cfile=gpac/tests/media/encryption/cbcs.xml -o enc.m3u8:profile=onDemand

gives:

enc.m3u8:

#EXTM3U
#EXT-X-VERSION:6
#EXT-X-INDEPENDENT-SEGMENTS

#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="1",AUTOSELECT=YES,URI="enc_1.m3u8",CHANNELS="1"
#EXT-X-STREAM-INF:BANDWIDTH=65816,CODECS="avc1.42C00D,mp4a.40.2",RESOLUTION=320x180,FRAME-RATE=25,AUDIO="audio"
enc_2.m3u8

enc_1.m3u8:

#EXTM3U
#EXT-X-TARGETDURATION:1
#EXT-X-VERSION:6
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MAP:URI="beepbop_track1__dashinit.mp4",BYTERANGE="1132@0"
#EXTINF:0.998458
#EXT-X-BYTERANGE:2197@1252
beepbop_track1__dashinit.mp4
#EXTINF:0.998458
#EXT-X-BYTERANGE:2311@3449
beepbop_track1__dashinit.mp4
#EXTINF:0.998458
#EXT-X-BYTERANGE:2341@5760
beepbop_track1__dashinit.mp4
#EXTINF:0.998458
#EXT-X-BYTERANGE:2393@8101
beepbop_track1__dashinit.mp4
#EXTINF:0.998458
#EXT-X-BYTERANGE:2479@10494
beepbop_track1__dashinit.mp4

#EXT-X-ENDLIST

enc_2.m3u8:

#EXTM3U
#EXT-X-TARGETDURATION:1
#EXT-X-VERSION:6
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MAP:URI="beepbop_track2__dashinit.mp4",BYTERANGE="1015@0"
#EXTINF:1
#EXT-X-BYTERANGE:7536@1135
beepbop_track2__dashinit.mp4
#EXTINF:1
#EXT-X-BYTERANGE:7750@8671
beepbop_track2__dashinit.mp4
#EXTINF:1
#EXT-X-BYTERANGE:8370@16421
beepbop_track2__dashinit.mp4
#EXTINF:1
#EXT-X-BYTERANGE:8847@24791
beepbop_track2__dashinit.mp4
#EXTINF:0.96
#EXT-X-BYTERANGE:8947@33638
beepbop_track2__dashinit.mp4

#EXT-X-ENDLIST

@MarianoFacundoArch
Copy link
Author

Yes, effectively, and cannot be played.

How shall we address this? I think it is a significant bug

@rbouqueau
Copy link
Member

I agree. There's been a huge slow down in our capacity to address issues in the last few weeks. I am completely overwhelmed but we care. Thanks.

@MarianoFacundoArch
Copy link
Author

I am sorry to hear that.
Please let me know if there’s anything I can help with.

@jeanlf
Copy link
Member

jeanlf commented May 22, 2024

It was simply not coded, now fixed thanks for the report

@jeanlf jeanlf closed this as completed May 22, 2024
@MarianoFacundoArch
Copy link
Author

Hi @jeanlf ,
It adds the key part to the m3u8 now, but I am not able to play the protected DRM content that cannot be plaid either in MPD with Widevine or in Apple with Fairplay.
I think, for some reason, the resulting full segment is being made with some corruption. I have attached a sample output I produced,
Archive.zip

It is impossible to play. If the profile on demand was not in place, then everything works perfectly.

@MarianoFacundoArch
Copy link
Author

Shall we reopen this? @jeanlf @rbouqueau ?

@rbouqueau rbouqueau reopened this May 24, 2024
@jeanlf
Copy link
Member

jeanlf commented May 29, 2024

i have no clue what could be wrong - the init segment part and the movie fragments are exactly the same in onDemand and live profile, only difference is in brands and in sidx boxes which is expected.

Do you have a working sample of an onDemand HLS asset that you could share ?

@MarianoFacundoArch
Copy link
Author

Of course,

Here is an example working file.

Let me know if this one is enough or there's anything else I can do to help!
https://github.com/gpac/gpac/assets/19694461/6e7eee30-c548-4cab-b6b1-da759f56bb45

@jeanlf
Copy link
Member

jeanlf commented May 30, 2024

In the file, the main differences with what we produce in vod are:

  • PSSHv1 in GPAC, v0 in your file: I doubt this has an impact as the live version works and uses v1
  • different track fragment defaults , but again the live version works with this same settings - you could try generating the vod with --cmaf=cmf2 to see if this changes anything
  • there is a mfro box in your example file, but this is not used by the client so I doubt this has an impact
  • presence of sidx in gpac, not in your file but again I doubt this is the cause of the issue

Do you have the corresponding m3u8 ?

Could you cross-check your test player works well with onDemand but without encryption ?

@MarianoFacundoArch
Copy link
Author

Hi Jean,
The attached file uses Bento4, which I am moving to GPAC now. In case that helps somehow to perform tests faster on your side too. The key option in mp4dash is the --no-split maybe that way we can directly compare same files and the outputs.
As for the corresponding m3u8 file, please note this fails in both mpd and m3u8 files, so the problem itself appears to be with the mp4 file not with the m3u8.
But if you still want me to share the m3u8 or mpd let me know, also if you want to share a video file, I can definitely pack it with the full mpd and m3u8 if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants