|
15 | 15 | // specific language governing permissions and limitations |
16 | 16 | // under the License. |
17 | 17 |
|
18 | | -use crate::config::OS::{MACOS, WINDOWS}; |
| 18 | +use crate::config::OS::{LINUX, MACOS, WINDOWS}; |
19 | 19 | use crate::downloads::download_to_tmp_folder; |
20 | 20 | use crate::files::{ |
21 | 21 | compose_driver_path_in_cache, create_parent_path_if_not_exists, get_filename_with_extension, |
@@ -44,7 +44,7 @@ const FFMPEG_MACOS_RELEASE_URL: &str = "https://evermeet.cx/ffmpeg/ffmpeg-{}.zip |
44 | 44 | const FFMPEG_RECORD_FRAME_RATE: &str = "30"; |
45 | 45 | const FFMPEG_RECORD_DESKTOP_WINDOWS_COMMAND: &str = "{} -f gdigrab -i desktop -r {} -q:v 1 -y {}"; |
46 | 46 | const FFMPEG_RECORD_DESKTOP_LINUX_COMMAND: &str = "{} -f x11grab -i {} -r {} -vcodec huffyuv -y {}"; |
47 | | -const FFMPEG_RECORD_DESKTOP_MACOS_COMMAND: &str = r#"{} -f avfoundation -i "{}:0" -r {} -y {}"#; |
| 47 | +const FFMPEG_RECORD_DESKTOP_MACOS_COMMAND: &str = r#"{} -f avfoundation -i "1:0" -r {} -y {}"#; |
48 | 48 | const FFMPEG_RECORDING_EXTENSION: &str = "avi"; |
49 | 49 | const FFMPEG_RECORDING_FOLDER: &str = "recordings"; |
50 | 50 | const FFMPEG_DEFAULT_DISPLAY: &str = ":0"; |
@@ -210,19 +210,19 @@ pub fn record_desktop_with_ffmpeg( |
210 | 210 | "Recording desktop with {} to {}", |
211 | 211 | FFMPEG_NAME, &recording_name |
212 | 212 | )); |
213 | | - let command = if WINDOWS.is(os) { |
214 | | - Command::new_single(format_three_args( |
| 213 | + let command = if LINUX.is(os) { |
| 214 | + let env_display = env::var(ENV_DISPLAY).unwrap_or(FFMPEG_DEFAULT_DISPLAY.to_string()); |
| 215 | + Command::new_single(format_four_args( |
215 | 216 | get_recording_command(os), |
216 | 217 | &path_to_string(&ffmpeg_path), |
| 218 | + &env_display, |
217 | 219 | FFMPEG_RECORD_FRAME_RATE, |
218 | 220 | &recording_name, |
219 | 221 | )) |
220 | 222 | } else { |
221 | | - let env_display = env::var(ENV_DISPLAY).unwrap_or(FFMPEG_DEFAULT_DISPLAY.to_string()); |
222 | | - Command::new_single(format_four_args( |
| 223 | + Command::new_single(format_three_args( |
223 | 224 | get_recording_command(os), |
224 | 225 | &path_to_string(&ffmpeg_path), |
225 | | - &env_display, |
226 | 226 | FFMPEG_RECORD_FRAME_RATE, |
227 | 227 | &recording_name, |
228 | 228 | )) |
|
0 commit comments