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

Native H.264 decoding using FFMPEG over CLI/IPC #7658

Closed
wants to merge 13 commits into from
Closed

Conversation

emilk
Copy link
Member

@emilk emilk commented Oct 9, 2024

What

TODO

  • Add watchdog to restart ffmpeg if it dies (e.g. due to pkill)
  • Check if ffmpeg is installed once, and then add helpful error message if not
  • Fix all remaining TODOs

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.

@emilk emilk added exclude from changelog PRs with this won't show up in CHANGELOG.md 🎞️ video labels Oct 9, 2024
@emilk emilk force-pushed the emilk/ffmpeg-decoder branch from d16365d to dfaaf9d Compare October 9, 2024 13:42
@emilk emilk mentioned this pull request Oct 9, 2024
6 tasks
@emilk emilk force-pushed the emilk/ffmpeg-decoder branch 2 times, most recently from 56e6539 to 43037fa Compare October 9, 2024 14:21
Copy link

github-actions bot commented Oct 9, 2024

Deployed docs

Commit Link
43037fa https://landing-owgu25rqv-rerun.vercel.app/docs

emilk added a commit that referenced this pull request Oct 10, 2024
### What
Some small improvements in service of coming ffmpeg stuff

* Extracted from #7658
* Part of #7606

### 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/7660?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/7660?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/7660)
- [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`.
@Wumpf Wumpf self-assigned this Oct 24, 2024
@Wumpf
Copy link
Member

Wumpf commented Oct 31, 2024

created a new pr for this from a different branch

@Wumpf Wumpf closed this Oct 31, 2024
@Wumpf Wumpf deleted the emilk/ffmpeg-decoder branch October 31, 2024 16:15
Wumpf added a commit that referenced this pull request Nov 4, 2024
### What

* Most of #7607 
* Replaces #7658 

Tested this with videos containing b frames, both long and short.

<img width="1403" alt="image"
src="https://github.com/user-attachments/assets/12da809b-5aee-4c06-ba30-394d82073a2a">

(note how PTS != DTS, indicating that there's a b-frame _somewhere_ ;-))

Biggest risk overall with the approach taken is that we can't detect
dropped frames properly

Left to do before landing:
* [x] test 4k 60fps video material
* works smoothly in release, not at 60fps in debug builds on my mac
because of rgb->rgba conversions on our side (see todos below)
* [x] test black & white (yuv400)
* [x] works but my video test material gave me:
`re_video::decode::ffmpeg]
/\//Users/andreas/dev/rerun-io/internal-test-assets/video/greyscale_360p_h264.mp4,
codec: H.264 (avc1.64001E) decoder: [swscaler @ 0x3001d8000] [warning]
deprecated pixel format used, make sure you did set range correctly`
every time ffmpeg started, need to fix that to a log_once (if ffmpeg
says it's deprecated then I figure we may report that 🤷, just don't
spam)
* [x] test yuv444/rgb video
* worked, but the test 4.4s test video I used stops working starting at
3.2s, recovers fine though
* Direct play browser: Firefox says the file is corrupt, Safari refuses
to play. Chrome handles it
        * Rerun play browser: Same, but different errors
        * ... letting this issue slide for now 🤷 

What's left to do (beyond general video bugs I logged while working on
this) before calling this "done":
* download ffmpeg for the user or at least tell users what to do when
there's no ffmpeg (haven't checked even yet on the error message)
* add version & ability check for ffmpeg?
* consume 420p and friends directly to speed up processing
* try to provoke frame dropping and see if we can detect & handle that -
one of the shortcomings of the overall approach today is that we don't
track this!

### 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/7962?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/7962?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/7962)
- [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`.

---------

Co-authored-by: Emil Ernerfeldt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude from changelog PRs with this won't show up in CHANGELOG.md 🎞️ video
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Native H.264
2 participants