@@ -24,7 +24,7 @@ use crate::files::{
2424use crate :: lock:: Lock ;
2525use crate :: logger:: Logger ;
2626use crate :: shell:: { run_shell_command_with_stderr, Command } ;
27- use crate :: { format_four_args , format_one_arg , format_three_args , format_two_args, ENV_DISPLAY } ;
27+ use crate :: { format_five_args , format_four_args , format_one_arg , format_two_args, ENV_DISPLAY } ;
2828use anyhow:: { anyhow, Error } ;
2929use reqwest:: Client ;
3030use std:: fs:: File ;
@@ -38,10 +38,11 @@ const FFMPEG_WINDOWS_RELEASE_URL: &str =
3838 "https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-{}-essentials_build.7z" ;
3939const FFMPEG_LINUX_RELEASE_URL : & str = "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n{}-latest-linux64-gpl-{}.tar.xz" ;
4040const FFMPEG_MACOS_RELEASE_URL : & str = "https://evermeet.cx/ffmpeg/ffmpeg-{}.zip" ;
41+ const FFMPEG_RECORD_DESKTOP_WINDOWS_COMMAND : & str = "{} -f gdigrab -i desktop -r {} -c:v {} -y {}" ;
42+ const FFMPEG_RECORD_DESKTOP_LINUX_COMMAND : & str = "{} -f x11grab -i {} -r {} -c:v {} -y {}" ;
43+ const FFMPEG_RECORD_DESKTOP_MACOS_COMMAND : & str = "{} -f avfoundation -i 0 -r {} -c:v {} -y {}" ;
4144const FFMPEG_RECORD_FRAME_RATE : & str = "30" ;
42- const FFMPEG_RECORD_DESKTOP_WINDOWS_COMMAND : & str = "{} -f gdigrab -i desktop -r {} -y {}" ;
43- const FFMPEG_RECORD_DESKTOP_LINUX_COMMAND : & str = "{} -f x11grab -i {} -r {} -y {}" ;
44- const FFMPEG_RECORD_DESKTOP_MACOS_COMMAND : & str = "{} -f avfoundation -i 0 -r {} -y {}" ;
45+ const FFMPEG_RECORD_VIDEO_CODEC : & str = "mpeg4" ;
4546const FFMPEG_RECORDING_EXTENSION : & str = "avi" ;
4647const FFMPEG_RECORDING_FOLDER : & str = "recordings" ;
4748const FFMPEG_DEFAULT_DISPLAY : & str = ":0" ;
@@ -211,18 +212,20 @@ pub fn record_desktop_with_ffmpeg(
211212 ) ) ;
212213 env_display = FFMPEG_DEFAULT_DISPLAY . to_string ( ) ;
213214 }
214- Command :: new_single ( format_four_args (
215+ Command :: new_single ( format_five_args (
215216 get_recording_command ( os) ,
216217 & path_to_string ( & ffmpeg_path) ,
217218 & env_display,
218219 FFMPEG_RECORD_FRAME_RATE ,
220+ FFMPEG_RECORD_VIDEO_CODEC ,
219221 & recording_name,
220222 ) )
221223 } else {
222- Command :: new_single ( format_three_args (
224+ Command :: new_single ( format_four_args (
223225 get_recording_command ( os) ,
224226 & path_to_string ( & ffmpeg_path) ,
225227 FFMPEG_RECORD_FRAME_RATE ,
228+ FFMPEG_RECORD_VIDEO_CODEC ,
226229 & recording_name,
227230 ) )
228231 } ;
0 commit comments