update ffmpeg_window

This commit is contained in:
ochibani 2025-01-27 18:48:18 +02:00
parent a6987857bd
commit 982c64800b
No known key found for this signature in database
GPG Key ID: 2C6B61CE0C704ED4
2 changed files with 19 additions and 9 deletions

View File

@ -628,13 +628,11 @@ impl Ffmpeg {
ffmpeg_command.format("dshow")
.input(format!("audio=\"{}\"", &self.audio_input_id.active_text()
.ok_or_else(|| anyhow!("Failed to get audio input source."))?)
)
.format("ogg");
);
if self.audio_output_switch.is_active() {
ffmpeg_command.format("dshow")
.input(&self.audio_output_id);
}
ffmpeg_command.format("ogg");
// Disable bitrate if value is zero
if self.audio_record_bitrate.value() as u16 > 0 {
@ -646,6 +644,8 @@ impl Ffmpeg {
// Remove metadate
ffmpeg_command.args(["-map_metadata", "-1"]);
// Output
ffmpeg_command.arg(&self.saved_filename);
ffmpeg_command.overwrite();
@ -685,10 +685,12 @@ impl Ffmpeg {
pub fn start_output_audio(&mut self) -> Result<()> {
let mut ffmpeg_command = FfmpegCommand::new();
ffmpeg_command.format("dshow")
.input(format!("audio=\"{}\"", &self.audio_output_id))
.format("ogg");
.input(format!("audio=\"{}\"", &self.audio_output_id));
// Remove metadate
ffmpeg_command.args(["-map_metadata", "-1"]);
// Output
ffmpeg_command.arg(&self.saved_filename);
ffmpeg_command.overwrite();

View File

@ -872,7 +872,9 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
}
enable_input_widgets(_input_widgets.clone());
_record_button.show();
_record_time_label.set_visible(false);
_stop_button.hide();
stop_timer(_record_time_label.clone());
let text_buffer = TextBuffer::new(None);
text_buffer.set_text(&format!("{}", error));
_error_message.set_buffer(Some(&text_buffer));
@ -917,8 +919,8 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
#[cfg(target_os = "windows")]
let _window_title = window_title.borrow_mut();
disable_input_widgets(_input_widgets.clone());
start_timer(record_time_label.clone());
record_time_label.set_visible(true);
start_timer(_record_time_label.clone());
_record_time_label.set_visible(true);
if hide_switch.is_active() {
_main_window.minimize();
}
@ -941,7 +943,9 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
}
enable_input_widgets(_input_widgets.clone());
_record_button.show();
_record_time_label.set_visible(false);
_stop_button.hide();
stop_timer(_record_time_label.clone());
let text_buffer = TextBuffer::new(None);
text_buffer.set_text(&format!("{}", error));
_error_message.set_buffer(Some(&text_buffer));
@ -965,7 +969,9 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
}
enable_input_widgets(_input_widgets.clone());
_record_button.show();
_record_time_label.set_visible(false);
_stop_button.hide();
stop_timer(_record_time_label.clone());
let text_buffer = TextBuffer::new(None);
text_buffer.set_text(&format!("{}", error));
_error_message.set_buffer(Some(&text_buffer));
@ -1006,7 +1012,9 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
}
enable_input_widgets(_input_widgets.clone());
_record_button.show();
_record_time_label.set_visible(false);
_stop_button.hide();
stop_timer(_record_time_label.clone());
let text_buffer = TextBuffer::new(None);
text_buffer.set_text(&format!("{}", error));
_error_message.set_buffer(Some(&text_buffer));
@ -1037,8 +1045,8 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
stop_button.connect_clicked(move |_| {
_spinner_window.show();
let mut show_play = true;
_record_time_label.set_visible(false);
stop_timer(_record_time_label.clone());
record_time_label.set_visible(false);
stop_timer(record_time_label.clone());
if _audio_input_switch.is_active() && !_video_switch.is_active() {
match _ffmpeg_record_interface.borrow_mut().stop_input_audio() {
Ok(_) => {