diff --git a/core/src/ffmpeg_linux.rs b/core/src/ffmpeg_linux.rs index aee73e5..304fa5c 100644 --- a/core/src/ffmpeg_linux.rs +++ b/core/src/ffmpeg_linux.rs @@ -296,28 +296,23 @@ impl Ffmpeg { return Err(Error::msg("Unable to validate tmp video file.")); } } - if is_input_audio_record(&self.temp_input_audio_filename) || - is_output_audio_record(&self.temp_output_audio_filename) { - let mut ffmpeg_command = FfmpegCommand::new(); - ffmpeg_command.input(&self.temp_video_filename); - ffmpeg_command.format("ogg"); - if is_input_audio_record(&self.temp_input_audio_filename) { - ffmpeg_command.input(&self.temp_input_audio_filename); - } - if is_output_audio_record(&self.temp_output_audio_filename) { - ffmpeg_command.input(&self.temp_output_audio_filename); - } - ffmpeg_command.args([ - "-c:a", - "aac", - &self.saved_filename.clone() - ]); - ffmpeg_command.overwrite() - .spawn()? - .wait()?; - } else { - std::fs::copy(&self.temp_video_filename, &self.saved_filename)?; - } + let mut ffmpeg_command = FfmpegCommand::new(); + ffmpeg_command.input(&self.temp_video_filename); + ffmpeg_command.format("ogg"); + if is_input_audio_record(&self.temp_input_audio_filename) { + ffmpeg_command.input(&self.temp_input_audio_filename); + } + if is_output_audio_record(&self.temp_output_audio_filename) { + ffmpeg_command.input(&self.temp_output_audio_filename); + } + ffmpeg_command.args([ + "-c:a", + "aac", + &self.filename, + ]); + ffmpeg_command.overwrite() + .spawn()? + .wait()?; } else { // Validate video file integrity let start_time = Instant::now(); @@ -590,7 +585,7 @@ impl Ffmpeg { // Stop video recording pub fn stop_video(&mut self) -> Result<()> { - // Kill the process to stop recording + // Quit the process to stop recording if self.video_process.is_some() { self.video_process .clone() diff --git a/core/src/ffmpeg_windows.rs b/core/src/ffmpeg_windows.rs index 2eba07e..78f9712 100644 --- a/core/src/ffmpeg_windows.rs +++ b/core/src/ffmpeg_windows.rs @@ -37,9 +37,12 @@ pub struct Ffmpeg { pub record_delay: u16, pub record_frames: u16, pub video_record_bitrate: u16, + pub audio_input_switch: bool, + pub audio_output_switch: bool, pub follow_mouse: bool, pub record_mouse: bool, pub show_area: bool, + pub video_switch: bool, } #[cfg(feature = "gtk")] @@ -62,9 +65,12 @@ pub struct Ffmpeg { pub record_delay: SpinButton, pub record_frames: SpinButton, pub video_record_bitrate: SpinButton, + pub audio_input_switch: CheckButton, + pub audio_output_switch: CheckButton, pub follow_mouse: CheckButton, pub record_mouse: CheckButton, pub show_area: CheckButton, + pub video_switch: CheckButton, } #[cfg(feature = "cmd")]