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

Support h.264 video decoding on web #7511

Merged
merged 5 commits into from
Sep 26, 2024
Merged

Support h.264 video decoding on web #7511

merged 5 commits into from
Sep 26, 2024

Conversation

jprochazk
Copy link
Member

@jprochazk jprochazk commented Sep 25, 2024

What

  • The seeking logic now searches for the requested segment by the presentation/composition timestamp passed in by the user. This way if a user requests frame at 12s they will get the frame which will be presented at 12s, not decoded at 12s. See I/P/B frame terminology in video encoding for more information as to why this distinction matters.
  • EncodedVideoChunks are now given the composition timestamp of the sample instead of its decode timestamp, so the output VideoFrame objects are in composition timestamp order.

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

@jprochazk jprochazk marked this pull request as draft September 25, 2024 11:13
@jprochazk jprochazk added the 🕸️ web regarding running the viewer in a browser label Sep 25, 2024
@jprochazk jprochazk marked this pull request as ready for review September 26, 2024 13:07
@Wumpf Wumpf self-requested a review September 26, 2024 13:08
@jprochazk
Copy link
Member Author

Seems like the lint failure comes from main

Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really well document, also like it a lot how you split up the concerns of frame_at further and made everything more precise!

Comment on lines +220 to +224
// Some terminology:
// - presentation timestamp = composition timestamp
// = the time at which the frame should be shown
// - decode timestamp
// = determines the decoding order of samples
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call to document that here, makes this stuff a lot more maintainable 👍


// 2. Search _backwards_, starting at `decode_sample_idx`, looking for
// the first sample where `sample.composition_timestamp <= presentation_timestamp`.
// This is the sample the user requested.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "uhm, actually" the user technically doesn't request a sample. A single sample is not able to represent the user's request

... but I don't know how to describe it better either right now. Fine to leave it this way I think

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it to "This is the sample which when decoded will be presented at the timestamp the user requested."

@jprochazk jprochazk merged commit bf7f533 into main Sep 26, 2024
30 of 31 checks passed
@jprochazk jprochazk deleted the jan/actual-h264-support branch September 26, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include in changelog 🎞️ video 🕸️ web regarding running the viewer in a browser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support h.264 codec in re_video
2 participants