Skip to content

Commit

Permalink
Show video bit depth anmd warn about HDR videos not being supported
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Oct 8, 2024
1 parent b6812a3 commit ea54f03
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions crates/viewer/re_data_ui/src/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()))),
Expand Down
9 changes: 9 additions & 0 deletions crates/viewer/re_renderer/src/video/decoder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down

0 comments on commit ea54f03

Please sign in to comment.