Skip to content

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

Closed
emilk wants to merge 13 commits intomainfrom
emilk/ffmpeg-decoder
Closed

Native H.264 decoding using FFMPEG over CLI/IPC#7658
emilk wants to merge 13 commits intomainfrom
emilk/ffmpeg-decoder

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 feat-video anything video decoding, player, querying, data modelling of videos etc. 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
@github-actions
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]>
emilk added a commit that referenced this pull request Nov 26, 2025
Changes in snapshot images should be pixel-alignment improvements thanks
to
* emilk/egui#7710


---

## egui changelog
### ⭐ Added
* Add `Plugin::on_widget_under_pointer` to support widget inspector
[#7652](emilk/egui#7652) by
[@juancampa](https://github.com/juancampa)
* Add `Response::total_drag_delta` and `PointerState::total_drag_delta`
[#7708](emilk/egui#7708) by
[@emilk](https://github.com/emilk)

### 🔧 Changed
* Improve accessibility and testability of `ComboBox`
[#7658](emilk/egui#7658) by
[@lucasmerlin](https://github.com/lucasmerlin)

### 🐛 Fixed
* Fix `profiling::scope` compile error when profiling using `tracing`
backend [#7646](emilk/egui#7646) by
[@PPakalns](https://github.com/PPakalns)
* Fix edge cases in "smart aiming" in sliders
[#7680](emilk/egui#7680) by
[@emilk](https://github.com/emilk)
* Hide scroll bars when dragging other things
[#7689](emilk/egui#7689) by
[@emilk](https://github.com/emilk)
* Prevent widgets sometimes appearing to move relative to each other
[#7710](emilk/egui#7710) by
[@emilk](https://github.com/emilk)
* Fix `ui.response().interact(Sense::click())` being flakey
[#7713](emilk/egui#7713) by
[@lucasmerlin](https://github.com/lucasmerlin)

## eframe changelog
* Fix jittering during window resize on MacOS for WGPU/Metal
[#7641](emilk/egui#7641) by
[@aspcartman](https://github.com/aspcartman)
* Make sure `native_pixels_per_point` is set during app creation
[#7683](emilk/egui#7683) by
[@emilk](https://github.com/emilk)

---------

Co-authored-by: Lucas Meurer <[email protected]>
Co-authored-by: lucasmerlin <[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 feat-video anything video decoding, player, querying, data modelling of videos etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native H.264

2 participants