Skip to content

Commit

Permalink
make ffmpeg warnigns warn_once, fix swscalar message showing up a lot…
Browse files Browse the repository at this point in the history
… for deprecated video formats
  • Loading branch information
Wumpf committed Nov 4, 2024
1 parent 696ea49 commit e2dc61e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions crates/store/re_video/src/decode/ffmpeg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ fn read_ffmpeg_output(
let patterns = [
"Duration: N/A, bitrate: N/A",
"frame= 0 fps=0.0 q=0.0 size= 0kB time=N/A bitrate=N/A speed=N/A",
"encoder : ", // Describes the encoder that was used to encode a video.
"Metadata:",
// TODO(andreas): we should just handle yuv420p directly!
"No accelerated colorspace conversion found from yuv420p to rgb24",
Expand All @@ -272,12 +273,20 @@ fn read_ffmpeg_output(
match event {
FfmpegEvent::Log(LogLevel::Info, msg) => {
if !should_ignore_log_msg(&msg) {
re_log::debug!("{debug_name} decoder: {msg}");
re_log::trace!("{debug_name} decoder: {msg}");
}
}

FfmpegEvent::Log(LogLevel::Warning, msg) => {
FfmpegEvent::Log(LogLevel::Warning, mut msg) => {
if !should_ignore_log_msg(&msg) {
// Make warn_once work on `[swscaler @ 0x148db8000]` style warnings even if the address is different every time.
if let Some(pos) = msg.find("[swscaler @ 0x") {
msg = [
&msg[..pos],
&msg[(pos + "[swscaler @ 0x148db8000]".len())..],
]
.join("[swscaler]");
};
re_log::warn_once!("{debug_name} decoder: {msg}");
}
}
Expand All @@ -298,7 +307,7 @@ fn read_ffmpeg_output(
return;
}
if !should_ignore_log_msg(&msg) {
re_log::debug!("{debug_name} decoder: {msg}");
re_log::warn_once!("{debug_name} decoder: {msg}");
}
}

Expand Down

0 comments on commit e2dc61e

Please sign in to comment.