Skip to content

Commit d066205

Browse files
committed
[rust] Temporal ffmpeg command to list devices in Linux and macOS
1 parent 2be2d02 commit d066205

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

rust/src/ffmpeg.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ const FFMPEG_LINUX_RELEASE_URL: &str = "https://github.com/BtbN/FFmpeg-Builds/re
4343
const FFMPEG_MACOS_RELEASE_URL: &str = "https://evermeet.cx/ffmpeg/ffmpeg-{}.zip";
4444
const FFMPEG_RECORD_FRAME_RATE: &str = "30";
4545
const FFMPEG_RECORD_DESKTOP_WINDOWS_COMMAND: &str = "{} -f gdigrab -i desktop -r {} -q:v 1 -y {}";
46-
const FFMPEG_RECORD_DESKTOP_LINUX_COMMAND: &str = "{} -f x11grab -i {} -r {} -vcodec huffyuv -y {}";
47-
const FFMPEG_RECORD_DESKTOP_MACOS_COMMAND: &str = "{} -f avfoundation -i {} -r {} -y {}";
46+
const FFMPEG_RECORD_DESKTOP_LINUX_COMMAND: &str = "{} -f x11grab -list_devices true -i \"\"";
47+
const FFMPEG_RECORD_DESKTOP_MACOS_COMMAND: &str = "{} -f avfoundation -list_devices true -i \"\"";
48+
// const FFMPEG_RECORD_DESKTOP_WINDOWS_COMMAND: &str = "{} -f gdigrab -i desktop -r {} -q:v 1 -y {}";
49+
// const FFMPEG_RECORD_DESKTOP_LINUX_COMMAND: &str = "{} -f x11grab -i {} -r {} -vcodec huffyuv -y {}";
50+
// const FFMPEG_RECORD_DESKTOP_MACOS_COMMAND: &str = "{} -f avfoundation -i {} -r {} -y {}";
4851
const FFMPEG_RECORDING_EXTENSION: &str = "avi";
4952
const FFMPEG_RECORDING_FOLDER: &str = "recordings";
5053

@@ -217,14 +220,18 @@ pub fn record_desktop_with_ffmpeg(
217220
&recording_name,
218221
))
219222
} else {
220-
let env_display = env::var(ENV_DISPLAY).unwrap_or_default();
221-
Command::new_single(format_four_args(
223+
//let env_display = env::var(ENV_DISPLAY).unwrap_or_default();
224+
Command::new_single(format_one_arg(
222225
get_recording_command(os),
223226
&path_to_string(&ffmpeg_path),
224-
&env_display,
225-
FFMPEG_RECORD_FRAME_RATE,
226-
&recording_name,
227227
))
228+
// Command::new_single(format_four_args(
229+
// get_recording_command(os),
230+
// &path_to_string(&ffmpeg_path),
231+
// &env_display,
232+
// FFMPEG_RECORD_FRAME_RATE,
233+
// &recording_name,
234+
// ))
228235
};
229236
run_shell_command_with_log(log, os, command).unwrap();
230237
Ok(())

0 commit comments

Comments
 (0)