Dash-Industry-Forum / dash.js

A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.
http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html
Other
5.15k stars 1.68k forks source link

CEA-608 parsing can't handle emulation prevention bytes #3679

Closed grabofus closed 4 months ago

grabofus commented 3 years ago
Environment
Steps to reproduce
Observed behavior

The player doesn't remove the emulation prevention bytes prior to passing the data to the CEA-608 parser, this can cause an offset while reading the data leading to skipping the user data unit containing the caption on specific fragments.

Console output
[457][Protection] EME detected on this user agent! (ProtectionModel_21Jan2015) 
[459][MediaPlayer] Streaming Initialized 
[460][MediaPlayer] Playback Initialized 
[461][MediaPlayer] [dash.js 3.1.0] MediaPlayer has been initialized 
[612][DashParser] Parsing complete: ( xml2json: 8.80ms, objectiron: 0.200ms, total: 0.00900s) 
[619][TimeSyncController] Local time: Tue Jun 22 2021 16:01:24 GMT+0100 (British Summer Time) 
[620][TimeSyncController] Server time: Tue Jun 22 2021 16:01:21 GMT+0100 (British Summer Time) 
[620][TimeSyncController] Server Time - Local Time (ms): -3712 
[626][ManifestUpdater] Manifest has been refreshed at Tue Jun 22 2021 16:01:24 GMT+0100 (British Summer Time)[1624374084.706]  
[675][AbrController] [video] switch from 0 to 5/5 (buffer: 0) . 
[692][AbrController] [video] switch from 0 to 5/5 (buffer: 0) . 
[701][Stream] No text data. 
[701][Stream] No fragmentedText data. 
[703][Stream] No muxed data. 
[703][Stream] No image data. 
[717][ProtectionController] DRM: KeySystem Access Granted (com.widevine.alpha)!  Selecting key system... 
[788][BufferController][video] Init fragment finished loading saving to video's init cache 
[789][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://XXXXX/init_video_4500.m4s  
[795][BufferController][audio] Init fragment finished loading saving to audio's init cache 
[795][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://XXXXX/init_audio_412.m4s  
[821][ProtectionController] DRM: Ignoring initData because we have already seen it! 
[860][ScheduleController][video] Top quality video index has changed from undefined to 5 
[859][ProtectionController] DRM: Ignoring initData because we have already seen it! 
[862][ScheduleController][audio] Top quality audio index has changed from undefined to 0 
[905][VideoModel] Caught pending play exception - continuing (NotAllowedError: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD) 
[923][PlaybackController] Native video element event: loadedmetadata 
[995][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://XXXXX/media_audio_412-7756211.m4s  
[990][ProtectionController] DRM: Ignoring initData because we have already seen it! 
[1058][ProtectionController] DRM: Ignoring initData because we have already seen it! 
[1088][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://XXXXX/media_audio_412-7756212.m4s  
[1182][ProtectionController] DRM: Ignoring initData because we have already seen it! 
[1185][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://XXXXX/media_video_4500-7756211.m4s  
[1206][ProtectionController] DRM: Ignoring initData because we have already seen it! 
[1299][PlaybackController] Requesting internal seek to time: 46537260.084 
[ERROR] Cannot insert 4e (N) at position 32. Skipping it!
[ERROR] Cannot insert 49 (I) at position 32. Skipping it!
[ERROR] Cannot insert 54 (T) at position 32. Skipping it!
[ERROR] Cannot insert 41 (A) at position 32. Skipping it!
[ERROR] Cannot insert 59 (Y) at position 32. Skipping it!
[ERROR] Cannot insert 49 (I) at position 32. Skipping it!
[ERROR] Cannot insert 54 (T) at position 32. Skipping it!
[ERROR] Cannot insert 4c (L) at position 32. Skipping it!
[ERROR] Cannot insert 4c (L) at position 32. Skipping it!
[ERROR] Cannot insert 4d (M) at position 32. Skipping it!
[ERROR] Cannot insert 52 (R) at position 32. Skipping it!
[ERROR] Cannot insert 50 (P) at position 32. Skipping it!
[ERROR] Cannot insert 41 (A) at position 32. Skipping it!
[ERROR] Cannot insert 50 (P) at position 32. Skipping it!
[ERROR] Cannot insert 45 (E) at position 32. Skipping it!
[ERROR] Cannot insert 56 (V) at position 32. Skipping it!
[ERROR] Cannot insert 49 (I) at position 32. Skipping it!
[ERROR] Cannot insert 2c (,) at position 32. Skipping it!
[ERROR] Cannot insert 20 ( ) at position 32. Skipping it!
[ERROR] Cannot insert 42 (B) at position 32. Skipping it!
[ERROR] Cannot insert 20 ( ) at position 32. Skipping it!
[ERROR] Cannot insert 4e (N) at position 32. Skipping it!
[ERROR] Cannot insert 20 ( ) at position 32. Skipping it!
[ERROR] Cannot insert 4d (M) at position 32. Skipping it!
[ERROR] Cannot insert 2c (,) at position 32. Skipping it!
[1613][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://XXXXX/media_video_4500-7756212.m4s  
[1629][ProtectionController] DRM: Ignoring initData because we have already seen it! 
[5577][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://XXXXX/media_video_4500-7756213.m4s  
[5674][ProtectionController] DRM: Ignoring initData because we have already seen it! 
[6021][AbrController] [video] switching from throughput to buffer occupancy ABR rule (buffer: 12.150). 
[6046][ProtectionController] DRM: Ignoring initData because we have already seen it! 
[6439][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://XXXXX/media_audio_412-7756213.m4s  
[6485][ProtectionController] DRM: Ignoring initData because we have already seen it! 
[7850][PlaybackController] Native video element event: play 
[7879][PlaybackController] Native video element event: playing 
[ERROR] Cannot insert 41 (A) at position 32. Skipping it!
[ERROR] Cannot insert 4e (N) at position 32. Skipping it!
[ERROR] Cannot insert 52 (R) at position 32. Skipping it!
[ERROR] Cannot insert 4f (O) at position 32. Skipping it!
[ERROR] Cannot insert 56 (V) at position 32. Skipping it!
[ERROR] Cannot insert 41 (A) at position 32. Skipping it!
[ERROR] Cannot insert 44 (D) at position 32. Skipping it!
[ERROR] Cannot insert 41 (A) at position 32. Skipping it!
[ERROR] Cannot insert 54 (T) at position 32. Skipping it!
[ERROR] Cannot insert 48 (H) at position 32. Skipping it!
[ERROR] Cannot insert 48 (H) at position 32. Skipping it!
[ERROR] Cannot insert 41 (A) at position 32. Skipping it!
[ERROR] Cannot insert 43 (C) at position 32. Skipping it!
[ERROR] Cannot insert 4f (O) at position 32. Skipping it!
Trace headers of a segment with ffmpeg
[trace_headers @ 0x7fc48241a080] Access Unit Delimiter
[trace_headers @ 0x7fc48241a080] Supplemental Enhancement Information
[trace_headers @ 0x7fc48241a080]   Picture Timing
[trace_headers @ 0x7fc48241a080]   User Data Registered ITU-T T.35
[trace_headers @ 0x7fc48241a080] Slice Header
Expected behavior

Player should be able to parse CEA-608 captions.

grabofus commented 3 years ago

I have a patch for the issue in a fork of DASH.js, happy to raise a PR if this issue is being worked on by anyone else.

https://github.com/DiceTechnology/dash.js/tree/fix/cea608-emulation-prevention-byte

dsilhavy commented 3 years ago

yes please do a pr against the latest status of the development branch. would also be great if you can provide a sample stream to verify.

dsilhavy commented 3 years ago

@grabofus Can you provide a PR for this?

grabofus commented 3 years ago

Sorry, I've been busy with other stuff lately, I'll try to PR it this week. I haven't been able to get a stream I can share where this issue is reproducible though

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. However, it might still be relevant so please leave a short comment if it should remain open. Otherwise the issue will be closed automatically after two weeks. Thank you for your contributions.

grabofus commented 2 years ago

Issue still exists

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. However, it might still be relevant so please leave a short comment if it should remain open. Otherwise the issue will be closed automatically after two weeks. Thank you for your contributions.

dsilhavy commented 2 years ago

unstale

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. However, it might still be relevant so please leave a short comment if it should remain open. Otherwise the issue will be closed automatically after two weeks. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically closed because no further activity occurred. If you think this issue is still relevant please reopen it or contact @dsilhavy. Thank you for your contributions.

dsilhavy commented 4 months ago

Fixed in #4522