Remove buggy video formats

This commit is contained in:
ochibani 2022-10-14 19:37:25 +02:00
parent 835e4660da
commit 3428d6dd35
5 changed files with 19 additions and 18 deletions

View File

@ -73,7 +73,7 @@ impl Ffmpeg {
height: u16,
) -> (Option<u32>, Option<u32>) {
if self.video_process_id.is_some() || self.audio_process_id.is_some() {
self.stop_record();
//self.stop_record();
}
self.saved_filename = Some(
@ -88,14 +88,15 @@ impl Ffmpeg {
} else {
self.filename.1.text().to_string().trim().to_string()
},
self.filename.2.active_id().unwrap())))
self.filename.2.active_id().unwrap()
)))
.as_path()
.display()
.to_string(),
);
let is_file_already_exists =
std::path::Path::new(self.saved_filename.clone().unwrap().as_str())
std::path::Path::new(&self.saved_filename.clone().unwrap())
.exists();
if is_file_already_exists {
@ -122,7 +123,7 @@ impl Ffmpeg {
ffmpeg_command.arg("-f");
ffmpeg_command.arg("pulse");
ffmpeg_command.arg("-i");
ffmpeg_command.arg(self.audio_id.active_id().unwrap());
ffmpeg_command.arg(&self.audio_id.active_id().unwrap());
ffmpeg_command.arg("-f");
ffmpeg_command.arg("ogg");
ffmpeg_command.arg(format!(
@ -221,7 +222,6 @@ impl Ffmpeg {
)
.exists();
if is_video_record {
let mut move_command = Command::new("mv");
move_command.arg(format!(
@ -311,7 +311,7 @@ impl Ffmpeg {
self.progress_widget.set_progress(
"execute custom command after finish".to_string(),
5,
6
6,
);
Exec::shell(self.command.text().trim()).popen().unwrap();
}
@ -320,7 +320,6 @@ impl Ffmpeg {
.progress_widget
.set_progress("Finish".to_string(), 6, 6);
self.progress_widget.hide();
}
pub fn play_record(self) {
@ -334,7 +333,7 @@ impl Ffmpeg {
.unwrap();
} else {
Command::new("xdg-open")
.arg(self.saved_filename.as_ref().unwrap())
.arg(self.saved_filename.unwrap())
.spawn()
.unwrap();
}
@ -343,5 +342,5 @@ impl Ffmpeg {
}
fn is_snap() -> bool {
std::env::var("SNAP").unwrap_or_default().is_empty()
!std::env::var("SNAP").unwrap_or_default().is_empty()
}

2
src/indicator.rs Normal file
View File

@ -0,0 +1,2 @@
// TODO: add timer
// https://docs.rs/stray/0.1.1/stray/index.html

View File

@ -111,16 +111,16 @@ pub fn build_ui(application: &Application) {
command_entry.set_text(&config_management::get("default", "command"));
// CheckBox
format_chooser_combobox.append(Some("webm"), &gettext("WEBM (Open Web Media File)"));
//format_chooser_combobox.append(Some("webm"), &gettext("WEBM (Open Web Media File)"));
format_chooser_combobox.append(Some("mp4"), &gettext("MP4 (MPEG-4 Part 14)"));
format_chooser_combobox.append(Some("gif"), &gettext("GIF (Graphics Interchange Format)"));
//format_chooser_combobox.append(Some("gif"), &gettext("GIF (Graphics Interchange Format)"));
format_chooser_combobox.append(
Some("mkv"),
&gettext("MKV (Matroska multimedia container format)"),
);
format_chooser_combobox.append(Some("avi"), &gettext("AVI (Audio Video Interleaved)"));
format_chooser_combobox.append(Some("wmv"), &gettext("WMV (Windows Media Video)"));
format_chooser_combobox.append(Some("nut"), &gettext("NUT (NUT Recording Format)"));
//format_chooser_combobox.append(Some("avi"), &gettext("AVI (Audio Video Interleaved)"));
//format_chooser_combobox.append(Some("wmv"), &gettext("WMV (Windows Media Video)"));
//format_chooser_combobox.append(Some("nut"), &gettext("NUT (NUT Recording Format)"));
format_chooser_combobox.set_active(Some(0));
// get audio sources
@ -376,7 +376,6 @@ pub fn build_ui(application: &Application) {
}));
let mut _ffmpeg_record_interface = ffmpeg_record_interface.clone();
let mut _area_capture = area_capture.clone();
let _stop_button = stop_button.clone();
let _record_button = record_button.clone();
record_button.connect_clicked(move |_| {
@ -405,9 +404,8 @@ pub fn build_ui(application: &Application) {
let _stop_button = stop_button.clone();
let _play_button = play_button.clone();
stop_button.connect_clicked(move |_| {
let _record_button = record_button.clone();
_ffmpeg_record_interface.borrow_mut().clone().stop_record();
_record_button.show();
record_button.show();
_stop_button.hide();
_play_button.show();
});

1
src/timer.rs Normal file
View File

@ -0,0 +1 @@
// TODO: add timer

1
src/waylan_interface.rs Normal file
View File

@ -0,0 +1 @@
// TODO: add wayland screen record support