Skip to content

Commit

Permalink
show download link in selection menu. iterate on error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Nov 4, 2024
1 parent 4df4425 commit e907571
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/store/re_video/src/decode/ffmpeg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use super::{AsyncDecoder, Chunk, Frame, OutputCallback};

#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("Requires an install of FFmpeg, none has been found in PATH.")]
#[error("Couldn't find an installation of the FFmpeg executable.")]
FfmpegNotInstalled {
/// Download URL for the latest version of `FFmpeg` on the current platform.
/// None if the platform is not supported.
Expand Down
4 changes: 3 additions & 1 deletion crates/store/re_video/src/decode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ mod webcodecs;

use crate::Time;

pub use ffmpeg::Error as FfmpegError;

#[derive(thiserror::Error, Debug, Clone)]
pub enum Error {
#[error("Unsupported codec: {0}")]
Expand Down Expand Up @@ -115,7 +117,7 @@ pub enum Error {

#[cfg(with_ffmpeg)]
#[error(transparent)]
Ffmpeg(std::sync::Arc<ffmpeg::Error>),
Ffmpeg(std::sync::Arc<FfmpegError>),

#[error("Unsupported bits per component: {0}")]
BadBitsPerComponent(usize),
Expand Down
12 changes: 12 additions & 0 deletions crates/viewer/re_data_ui/src/video.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,18 @@ pub fn show_video_blob_info(

Err(err) => {
ui.error_label_long(&err.to_string());

if let re_renderer::video::VideoPlayerError::Decoding(
re_video::decode::Error::Ffmpeg(ffmpeg),
) = err
{
if let re_video::decode::FfmpegError::FfmpegNotInstalled {
download_url: Some(url),
} = ffmpeg.as_ref()
{
ui.markdown_ui(&format!("You can download a build of `FFmpeg` [here]({url}). For Rerun to be able to use it, its binaries need to be reachable from `PATH`."));
}
}
}
}
}
Expand Down

0 comments on commit e907571

Please sign in to comment.