|
15 | 15 | // specific language governing permissions and limitations |
16 | 16 | // under the License. |
17 | 17 |
|
18 | | -use crate::config::OS::{LINUX, MACOS, WINDOWS}; |
| 18 | +use crate::config::OS::{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, |
@@ -43,9 +43,8 @@ const FFMPEG_LINUX_RELEASE_URL: &str = "https://github.com/BtbN/FFmpeg-Builds/re |
43 | 43 | 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 | | -const FFMPEG_RECORD_DESKTOP_LINUX_COMMAND: &str = |
47 | | - "{} -f x11grab -i {}+0,0 -r {} -vcodec huffyuv -y {}"; |
48 | | -const FFMPEG_RECORD_DESKTOP_MACOS_COMMAND: &str = r#"{} -f avfoundation -i "0:0" -r {} -y {}"#; |
| 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 {}"#; |
49 | 48 | const FFMPEG_RECORDING_EXTENSION: &str = "avi"; |
50 | 49 | const FFMPEG_RECORDING_FOLDER: &str = "recordings"; |
51 | 50 | const FFMPEG_DEFAULT_DISPLAY: &str = ":0"; |
@@ -211,19 +210,19 @@ pub fn record_desktop_with_ffmpeg( |
211 | 210 | "Recording desktop with {} to {}", |
212 | 211 | FFMPEG_NAME, &recording_name |
213 | 212 | )); |
214 | | - let command = if LINUX.is(os) { |
215 | | - let env_display = env::var(ENV_DISPLAY).unwrap_or(FFMPEG_DEFAULT_DISPLAY.to_string()); |
216 | | - Command::new_single(format_four_args( |
| 213 | + let command = if WINDOWS.is(os) { |
| 214 | + Command::new_single(format_three_args( |
217 | 215 | get_recording_command(os), |
218 | 216 | &path_to_string(&ffmpeg_path), |
219 | | - &env_display, |
220 | 217 | FFMPEG_RECORD_FRAME_RATE, |
221 | 218 | &recording_name, |
222 | 219 | )) |
223 | 220 | } else { |
224 | | - Command::new_single(format_three_args( |
| 221 | + let env_display = env::var(ENV_DISPLAY).unwrap_or(FFMPEG_DEFAULT_DISPLAY.to_string()); |
| 222 | + Command::new_single(format_four_args( |
225 | 223 | get_recording_command(os), |
226 | 224 | &path_to_string(&ffmpeg_path), |
| 225 | + &env_display, |
227 | 226 | FFMPEG_RECORD_FRAME_RATE, |
228 | 227 | &recording_name, |
229 | 228 | )) |
|
0 commit comments