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

MP4 Sample Description CODEC Parsing #5528

Merged
merged 1 commit into from
Jun 2, 2023
Merged

Conversation

robwalch
Copy link
Collaborator

@robwalch robwalch commented Jun 1, 2023

This PR will...

  • Add mp4 "stsd" codec parsing for Dolby Vision, VP9, AV1, and audio codec passthrough
  • Update contributed mp4a, avc, and hevc mp4 "stsd" codec parsing
  • Clean up mp4 init segment track parsed codec handling
  • Clean up SourceBuffer changeType detection and appends

Why is this Pull Request needed?

  • Allows for Media Playlist playback with MSE SourceBuffer creation using media parsed codec strings
  • Allows player to compare/correct issues in Multivariant Playlist Variant CODECS attribute values
  • Allows for proper handling of codec changes between mp4 init segments

Are there any points in the code the reviewer needs to double check?

These changes do not include parsing channel count for mp4a/AAC audio. Attempting to append multi-channel AAC with MSE fails in Chrome #5162 https://bugs.chromium.org/p/chromium/issues/detail?id=241171

Resolves issues:

Resolves #4744

Related issues:

Related to #5378
Related to #5162

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

@robwalch robwalch added this to the 1.5.0 milestone Jun 1, 2023
@robwalch
Copy link
Collaborator Author

robwalch commented Jun 1, 2023

Hi @jprjr @uvjustin @fogarasyroland,

Thank you for your contributions in this area. Let me know if you have any feedback, as well as if these changes impact playback of content used in testing and development on your end.

@robwalch robwalch changed the title MP4 CODEC Parsing MP4 Sample Description CODEC Parsing Jun 1, 2023
…dec passthrough

Update contributed mp4a, avc, and hevc mp4 "stsd" codec parsing
Clean up mp4 init segment track parsed codec handling
Clean up SourceBuffer `changeType` detection and appends
@robwalch robwalch merged commit fc112bc into master Jun 2, 2023
@robwalch robwalch deleted the feature/mp4-codec-parsing branch June 2, 2023 20:24
@zemlanin
Copy link

Shouldn't isSupported be also updated to account for non-H.264 types?

(Sorry for commenting on a merged PR. I don't have a test stream to justify opening an issue)

@robwalch
Copy link
Collaborator Author

robwalch commented Nov 27, 2023

Hi @zemlanin,

You can choose to file a Feature Request or Question rather than commenting on closed PR/Issues: https://github.com/video-dev/hls.js/issues/new/choose

The isTypeSupported check for AVC in MP4 is a baseline for MSE playback. For maximum compatibility, at least one variant of this type should be delivered in any HLS video asset. If you need something more specific, you can include it in your application. I must emphasize that this is an MSE support check, not a decoder support check. If anything, we might remove this part of the check. All variants and init segments loaded result in a more specific compatibility check before loading or appending.

Related to this, #5847 has implemented an isHEVCSupported check. I'm not sure this is a precedent we want to follow through on. Eventually, we'd need to add an "isSupported" method for every conceivable CODEC, rather than simply checking that MSE is present and proceeding with the expectation that Multivariant HLS Playlists are used to cover a range of decoder capabilities.

@robwalch robwalch mentioned this pull request Nov 27, 2023
4 tasks
@robwalch
Copy link
Collaborator Author

All variants and init segments loaded result in a more specific compatibility check before loading or appending.

The code in this PR is for those init segments codec checks to be performed correctly, while isSupported is a check you would use before attempting to use HLS.js at all (for example on older versions of iOS where neither MSE nor Managed Media Source are supported).

@zemlanin
Copy link

If anything, we might remove this part of the check

isSupported is a check you would use before attempting to use HLS.js at all (for example on older versions of iOS where neither MSE nor Managed Media Source are supported).

The codec check kinda blocks Firefox-without-H.264 from using HLS.js. Either extending the check or removing it might help with that

@robwalch
Copy link
Collaborator Author

The codec check kinda blocks Firefox-without-H.264 from using HLS.js. Either extending the check or removing it might help with that

Please file a new issue. Suggesting what baseline mime-type to check for Firefox so that HLS.js requires at least one supported type or suggesting that we remove the AVC type check may be considered.

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

Successfully merging this pull request may close these issues.

dolby vision proflie 5 dvh1 can't play normally in edge of win11 and safari of mac big sur
2 participants