Skip to content

Commit

Permalink
Make video decoding errors recoverable (#7521)
Browse files Browse the repository at this point in the history
### What

* Fixes #7491

Unlike the issue title implies, the test video here always fails
decoding at some point for Firefox & Chrome, it's not entirely
deterministic though when & how often.


https://github.com/user-attachments/assets/8b04af17-66d2-47b0-8314-da9f3d5ee3f3


Latest version tested on Firefox & Chrome on Mac. Previously tested a
similar changeset on Firefox & Chrome on Windows.


### 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/7521?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/7521?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/7521)
- [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`.
  • Loading branch information
Wumpf authored Sep 26, 2024
1 parent ca44717 commit dd83419
Show file tree
Hide file tree
Showing 7 changed files with 163 additions and 121 deletions.
1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5321,6 +5321,7 @@ dependencies = [
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
"web-time",
"wgpu",
"wgpu-core",
"wgpu-types",
Expand Down
8 changes: 4 additions & 4 deletions crates/viewer/re_data_ui/src/blob.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use re_renderer::{external::re_video::VideoLoadError, video::FrameDecodingResult};
use re_renderer::{external::re_video::VideoLoadError, video::VideoFrameTexture};
use re_types::components::{Blob, MediaType, VideoTimestamp};
use re_ui::{list_item::PropertyContent, UiExt};
use re_viewer_context::UiLayout;
Expand Down Expand Up @@ -240,14 +240,14 @@ fn show_video_blob_info(

if let Some(texture) =
match video.frame_at(render_ctx, decode_stream_id, timestamp_in_seconds) {
FrameDecodingResult::Ready(texture) => Some(texture),
Ok(VideoFrameTexture::Ready(texture)) => Some(texture),

FrameDecodingResult::Pending(texture) => {
Ok(VideoFrameTexture::Pending(texture)) => {
ui.ctx().request_repaint();
Some(texture)
}

FrameDecodingResult::Error(err) => {
Err(err) => {
ui.error_label_long(&err.to_string());
None
}
Expand Down
5 changes: 3 additions & 2 deletions crates/viewer/re_renderer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ notify.workspace = true
getrandom = { workspace = true, features = [
"js",
] } # getrandom needs the `js` feature to be enabled. It is dragged in indirectly.
js-sys = { workspace = true }
js-sys.workspace = true
wasm-bindgen-futures.workspace = true
web-time.workspace = true
web-sys = { workspace = true, features = [
"DomException",
"EncodedVideoChunk",
Expand All @@ -110,7 +111,7 @@ web-sys = { workspace = true, features = [
"VideoDecoderInit",
"VideoFrame",
] }
wasm-bindgen = { workspace = true }
wasm-bindgen.workspace = true


[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/viewer/re_renderer/src/video/decoder/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ impl VideoDecoder {
_render_ctx: &RenderContext,
_presentation_timestamp_s: f64,
) -> FrameDecodingResult {
FrameDecodingResult::Error(DecodingError::NoNativeSupport)
Err(DecodingError::NoNativeSupport)
}
}
Loading

0 comments on commit dd83419

Please sign in to comment.