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 parsing hev1 #9

Merged
merged 6 commits into from
Oct 2, 2024
Merged

Support parsing hev1 #9

merged 6 commits into from
Oct 2, 2024

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Oct 2, 2024

HEVC (H.265) comes in two flavors: hvc1 and hev1. To quote from the newly added docs:

    /// HVC1 video codec (h.265)
    ///
    ///  hvc1 parameter sets are stored out-of-band in the sample entry
    /// (i.e. below the Sample Description Box ( stsd ) box)
    Hvc1(HevcBox),

    /// HEV1 video codec (h.265)
    ///
    /// hev1 parameter sets are stored out-of-band in the sample entry and/or in-band in the samples
    /// (i.e. SPS/PPS/VPS NAL units in the bitstream/ mdat box)
    Hev1(HevcBox),

So far, we failed to load hev1, not detecting it as a video at all!

This PR..

  • makes stsd box implementation more rusty/less insane
    • the code is full of these things, my deepest sympathy to @jprochazk who previously pointed out to me that working with it was quite painful & that there's a lot refactor potential here
  • fixes aforementioned support
  • adds more tests including a previously failing one

Confirmed before/after in Rerun: Before we'd fail to load hev1.mp4 in Chrome (but succeed with hvc1.mp4), after we succeed!
See

Commit by commit!

@Wumpf Wumpf added exclude from changelog Will not appear in CHANGELOG.md include in changelog Will appear in CHANGELOG.md and removed exclude from changelog Will not appear in CHANGELOG.md labels Oct 2, 2024
@jprochazk
Copy link
Member

(drive-by: Do you mean H.265 wherever you mention H.264?)

@Wumpf
Copy link
Member Author

Wumpf commented Oct 2, 2024

oops. Also copy & paste error on the quoted doc there
edit: fixed!

@emilk emilk self-requested a review October 2, 2024 16:17
Copy link
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

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

Very nice

src/lib.rs Outdated Show resolved Hide resolved
src/mp4box/hevc.rs Show resolved Hide resolved
@Wumpf Wumpf merged commit 4705e85 into main Oct 2, 2024
6 checks passed
@Wumpf Wumpf deleted the andreas/hev1-support branch October 2, 2024 16:53
Wumpf added a commit to rerun-io/rerun that referenced this pull request Oct 3, 2024
### What

* Details over on rerun-io/re_mp4#9

In short: we supported some kinds of hevc and not others.

<img width="295" alt="image"
src="https://github.com/user-attachments/assets/570115c5-bbd0-4624-bf55-eaf9a9679e52">
<img width="295" alt="image"
src="https://github.com/user-attachments/assets/a85bc5d7-7b4d-43e6-a1d3-972c6bbed3b0">

Test videos:

https://rerun.io/viewer/pr/7569?url=https://static.rerun.io/rrd/0.19.0/hvc1_5b55f7b0f38dc9ce3fca58b8e0ec9f1e084aa8a9.rrd

https://rerun.io/viewer/pr/7569?url=https://static.rerun.io/rrd/0.19.0/hev1_1132ff3c2853de110ae7f323af10bbc1a556ac17.rrd


TODO gather testing data from...
* [x] Windows Chrome
* [x] Windows Firefox
* [x] Linux Chrome
* [x] Linux Firefox
* [x]  More linux Chrome samples - the note there is tentative so far.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7569?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7569?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!
* [x] If have noted any breaking changes to the log API in
`CHANGELOG.md` and the migration guide

- [PR Build Summary](https://build.rerun.io/pr/7569)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include in changelog Will appear in CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants