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

Setting the minimum ID3 cue length to 0.25 seconds breaks frame metadata use case #2963

Closed
bxthomas opened this issue Aug 10, 2020 · 6 comments

Comments

@bxthomas
Copy link

PR #2951, introduced a minimum ID3 cue length of 0.25 seconds. However, ID3 tags can be used to hold user metadata that may describe data specific to a particular video frame. By imposing this artificial limitation, we can no longer correlate ID3 cues to video frames, and this breaks useful functionality.

@robwalch robwalch added this to the 0.14.9 milestone Aug 10, 2020
@itsjamie
Copy link
Collaborator

So the underlying reason for the original PR as explained to me was that the TextTrack events would sometimes not fire because the ID3 tags had such short durations they were never part of the activeCues properties.

@bxthomas it would be useful to know, what are you using to detect the active ID3 tag on the web platform for ones where your needing sample level accuracy so we can make sure to test that in the future (include a unit test) where the current time doesn't advance at sample-level accuracy.

As a follow-up based on that, I'm curious if having two properties, a "realDuration" and a fake "duration" intended for the web API to enable "cuechange" based usage would be nice, or if @bxthomas simply has a better answer 👍

@robwalch
Copy link
Collaborator

robwalch commented Aug 10, 2020

So the underlying reason for the original PR as explained to me was that the TextTrack events would sometimes not fire because the ID3 tags had such short durations they were never part of the activeCues properties.

In this case, it was always with cues found on the last sample, where cue duration was being set to 0.0001. The change to make the minimum for all cues 0.25 followed the thinking that browsers still may trigger "timeupdate" events as infrequently as 4 times a second, and that active cue changes only occur on time updates when currentTime intersects with a cue's time range. It was a defensive change that didn't consider use cases where the sample time based duration was critical. And, I'm to blame for steering @jnatalzia in that direction with peer feedback on the fix.

@bxthomas it would be useful to know, what are you using to detect the active ID3 tag on the web platform for ones where your needing sample level accuracy so we can make sure to test that in the future (include a unit test) where the current time doesn't advance at sample-level accuracy.

I would like to know more as well. For now though I am happy to provide a patch that should work for either use-case with #2964.

@tpaszun
Copy link
Contributor

tpaszun commented Aug 11, 2020

@bxthomas it would be useful to know, what are you using to detect the active ID3 tag on the web platform for ones where your needing sample level accuracy so we can make sure to test that in the future (include a unit test) where the current time doesn't advance at sample-level accuracy.

Hi all, I'll answer for Brian. Our use case is that we send frame metadata in ID3 tags (e.g. timecode). And then we do not use activeCues to access cues, we do a binary search for the right cue from cues instead (we use startTime and endTime properties to find the active cue).

@robwalch
Copy link
Collaborator

Thank you @bxthomas and @tpaszun for creating this issue and providing feedback.

Please let me know if this build https://deploy-preview-2964--hls-js-dev.netlify.app/demo/ of #2964 addresses this issue. I will cut a patch once confirmed. Thanks!

@robwalch
Copy link
Collaborator

@bxthomas ^

robwalch pushed a commit that referenced this issue Aug 18, 2020
* patch/v0.14.x:
  Only apply minimum ID3 cue duration when cue has none resolves #2963
robwalch pushed a commit to jwplayer/hls.js that referenced this issue Aug 18, 2020
* upstream_hls.js/master:
  Bump @types/mocha from 8.0.2 to 8.0.3
  Bump netlify-cli from 2.59.0 to 2.59.1
  Bump @types/mocha from 8.0.1 to 8.0.2
  Fix demo buffer-bar scaling and repaint issues
  Bump sinon from 9.0.2 to 9.0.3
  Bump @babel/core from 7.11.0 to 7.11.1
  Bump mocha from 8.1.0 to 8.1.1
  Only apply minimum ID3 cue duration when cue has none resolves video-dev#2963
robwalch pushed a commit to jwplayer/hls.js that referenced this issue Aug 18, 2020
* release:
  Bump @types/mocha from 8.0.2 to 8.0.3
  Bump netlify-cli from 2.59.0 to 2.59.1
  Bump @types/mocha from 8.0.1 to 8.0.2
  Fix demo buffer-bar scaling and repaint issues
  Bump sinon from 9.0.2 to 9.0.3
  Bump @babel/core from 7.11.0 to 7.11.1
  Bump mocha from 8.1.0 to 8.1.1
  Only apply minimum ID3 cue duration when cue has none resolves video-dev#2963
@robwalch
Copy link
Collaborator

alangdm pushed a commit to alangdm/hls.js that referenced this issue Sep 15, 2020
tchakabam pushed a commit to emliri/hls.js that referenced this issue Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants