feat: check for ffmpeg on startup
This commit is contained in:
parent
a19aa8206b
commit
6f46c768ce
2 changed files with 8 additions and 2 deletions
|
@ -57,6 +57,13 @@ impl From<String> for Codec {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn check() -> Result<()> {
|
||||
std::process::Command::new("ffmpeg").output()?;
|
||||
std::process::Command::new("ffprobe").output()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn get_video_meta(path: &Path) -> Result<VideoMeta> {
|
||||
let output = Command::new("ffprobe")
|
||||
.args([
|
||||
|
|
|
@ -391,7 +391,6 @@ impl AsyncComponent for Tyrolienne {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO check for ffmpeg
|
||||
// TODO app icon
|
||||
fn main() -> Result<()> {
|
||||
tracing_subscriber::fmt()
|
||||
|
@ -400,7 +399,7 @@ fn main() -> Result<()> {
|
|||
|
||||
color_eyre::install()?;
|
||||
|
||||
match get_config() {
|
||||
match ffmpeg::check().and_then(|_| get_config()) {
|
||||
Ok(config) => RelmApp::new("net.uku3lig.Tyrolienne").run_async::<Tyrolienne>(config),
|
||||
Err(e) => RelmApp::new("net.uku3lig.Tyrolienne").run::<StandaloneDialog>(e.to_string()),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue