From ea54f03a8c4cb646e29edc7049fd33d9e86359ec Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Tue, 8 Oct 2024 13:54:36 +0200 Subject: [PATCH] Show video bit depth anmd warn about HDR videos not being supported --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/viewer/re_data_ui/src/blob.rs | 5 +++++ crates/viewer/re_renderer/src/video/decoder/mod.rs | 9 +++++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81cdf237dad73..10bae2820ed4c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5367,7 +5367,7 @@ dependencies = [ [[package]] name = "re_mp4" version = "0.1.0" -source = "git+https://github.com/rerun-io/re_mp4?rev=9783a604eb940885c67995059f426a916d9e994f#9783a604eb940885c67995059f426a916d9e994f" +source = "git+https://github.com/rerun-io/re_mp4?rev=b98a60b1741fc4bea18e2a91d74e3fa850089bac#b98a60b1741fc4bea18e2a91d74e3fa850089bac" dependencies = [ "byteorder", "bytes", diff --git a/Cargo.toml b/Cargo.toml index 01dc883f7e93b..9b11278e09bb5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -551,7 +551,7 @@ missing_errors_doc = "allow" # egui_commonmark = { git = "https://github.com/rerun-io/egui_commonmark", rev = "7a9dc755bfa351a3796274cb8ca87129b051c084" } # https://github.com/lampsitter/egui_commonmark/pull/65 -re_mp4 = { git = "https://github.com/rerun-io/re_mp4", rev = "9783a604eb940885c67995059f426a916d9e994f" } # TODO: merge PR +re_mp4 = { git = "https://github.com/rerun-io/re_mp4", rev = "b98a60b1741fc4bea18e2a91d74e3fa850089bac" } # TODO: merge PR # re_mp4 = { path = "../re_mp4" } # commit on `rerun-io/re_arrow2` `main` branch diff --git a/crates/viewer/re_data_ui/src/blob.rs b/crates/viewer/re_data_ui/src/blob.rs index ee1e13a779f6c..805513a7c5c2f 100644 --- a/crates/viewer/re_data_ui/src/blob.rs +++ b/crates/viewer/re_data_ui/src/blob.rs @@ -193,6 +193,11 @@ fn show_video_blob_info( data.height() )), ); + if let Some(bit_depth) = data.config.stsd.contents.bit_depth() { + ui.list_item_flat_noninteractive( + PropertyContent::new("Bit depth").value_text(bit_depth.to_string()), + ); + } ui.list_item_flat_noninteractive( PropertyContent::new("Duration") .value_text(format!("{}", re_log_types::Duration::from(data.duration()))), diff --git a/crates/viewer/re_renderer/src/video/decoder/mod.rs b/crates/viewer/re_renderer/src/video/decoder/mod.rs index 3563cc9c18856..1bb4459c8f042 100644 --- a/crates/viewer/re_renderer/src/video/decoder/mod.rs +++ b/crates/viewer/re_renderer/src/video/decoder/mod.rs @@ -115,6 +115,15 @@ impl VideoDecoder { data.human_readable_codec_string() ); + if let Some(bit_depth) = data.config.stsd.contents.bit_depth() { + #[allow(clippy::comparison_chain)] + if bit_depth < 8 { + re_log::warn!("{debug_name} has unusual bit_depth of {bit_depth}"); + } else if 8 < bit_depth { + re_log::warn!("{debug_name}: HDR videos not supported. See https://github.com/rerun-io/rerun/issues/7594 for more."); + } + } + cfg_if::cfg_if! { if #[cfg(target_arch = "wasm32")] { let decoder = web::WebVideoDecoder::new(data.clone(), hw_acceleration)?;