question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for preferred video role flags

See original GitHub issue

Use case description

Some manifests can include alternative video tracks for example for sign language interpretation of the same video. The manifest parser is able to parse the roles included on these representations and is accessible via format.roleFlags. A client should be able to give a preferred role flag for video from those defined in C.java to the track selector in the same way preferred language or audio role flags are catered for. Right now this is possible with setting a custom selection override, but that also entails including all other filters such as bitrate and viewport width filtering in a custom override rather than using the default trackselector’s built-in support.

Proposed solution

DefaultTrackSelector.ParametersBuilder would have a setPreferredVideoRoleFlags(int flags) that would accept single or combined flags for instance setPreferredVideoRoleFlags(ROLE_FLAG_ALTERNATE|ROLE_FLAG_SIGN). In the case of a single flag the track selector would select tracks that may have more flags than those specified, but includes at least all of the specified flags, so in the example above, it would be able to select a track with flags=ROLE_FLAG_SIGN|ROLE_FLAG_ALTERNATE|ROLE_FLAG_SUPPLEMENTARY but not one with flags=ROLE_FLAG_ALTERNATE|ROLE_FLAG_EASY_TO_READ. If the specified flags are not available on any video track, revert to ROLE_FLAG_MAIN or 0, which is the default flag if none is specified.

Alternatives considered

The order of filtering related to other parameters, such as maxVideoBitrate, might be a point that needs some thought. Should flags be filtered on after bitrate filters are already applied or rather bitrate filter be applied after role flags are already filtered. In my opinion the latter is preferable, as that would be most compatible with user needs.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ojw28commented, Sep 9, 2021

Thanks! There is one small change I’d propose for the existing logic, which is to boost the “exact match” case so that tracks whose flags match exactly are preferred over tracks that also declare additional flags, in the case that both are present.

1reaction
ojw28commented, Sep 8, 2021

The track selector would select tracks that may have more flags than those specified, but include at least all of the specified flags

Would you expect this logic for audio and text as well, because we don’t enforce the part in bold for those at the moment. We should probably make sure all three work in the same way, else it’s going to be pretty confusing for someone who’s using more than one of them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flag Instances with the Hudl Remote • Hudl Sportscode Support
Use your Hudl Remote to flag instances while reviewing video. Info: You must enable your Hudl Remote in your Sportscode preferences first.
Read more >
Use Live Caption in Chrome - Google Help
When you play a video, to turn on captions, at the top right click Media ... Select the captions to move them to...
Read more >
YouTube Embedded Players and Player Parameters
This page currently defines all parameters supported in any YouTube embedded ... Follow the IFrame Player API instructions to insert a video player...
Read more >
The 7 Chrome Flags You Should Enable (And 2 You Shouldn't)
Chrome Flags that make your browsing experience exponentially better · 1. Show Autofill predictions · 2. Tab freeze and discard · 3. Parallel...
Read more >
Flags for video I/O - OpenCV
V4L/V4L2 capturing support via libv4l. CAP_V4L2. Python: cv.CAP_V4L2. Same as CAP_V4L. CAP_FIREWIRE. Python: cv.CAP_FIREWIRE.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found