Remove unwanted ffmpeg output when check if available

This commit is contained in:
ByteDream 2022-12-08 01:40:19 +01:00
parent 54018f9773
commit c4540ada50

View file

@ -1,12 +1,12 @@
use log::debug; use log::debug;
use std::io::ErrorKind; use std::io::ErrorKind;
use std::path::PathBuf; use std::path::PathBuf;
use std::process::Command; use std::process::{Command, Stdio};
use std::{env, io}; use std::{env, io};
use tempfile::{Builder, NamedTempFile}; use tempfile::{Builder, NamedTempFile};
pub fn has_ffmpeg() -> bool { pub fn has_ffmpeg() -> bool {
if let Err(e) = Command::new("ffmpeg").spawn() { if let Err(e) = Command::new("ffmpeg").stderr(Stdio::null()).spawn() {
if ErrorKind::NotFound != e.kind() { if ErrorKind::NotFound != e.kind() {
debug!( debug!(
"unknown error occurred while checking if ffmpeg exists: {}", "unknown error occurred while checking if ffmpeg exists: {}",