@@ -44,10 +44,8 @@ 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 =
48
- r#"{} -f avfoundation -video_device_index 0 -r {} -y {}"# ;
47
+ const FFMPEG_RECORD_DESKTOP_MACOS_COMMAND : & str = r#"{} -f avfoundation -i "0:0" -r {} -y {}"# ;
49
48
const FFMPEG_RECORDING_EXTENSION_AVI : & str = "avi" ;
50
- const FFMPEG_RECORDING_EXTENSION_MKV : & str = "mkv" ;
51
49
const FFMPEG_RECORDING_FOLDER : & str = "recordings" ;
52
50
const FFMPEG_DEFAULT_DISPLAY : & str = ":0" ;
53
51
@@ -191,14 +189,9 @@ pub fn uncompress_ffmpeg(
191
189
Ok ( ( ) )
192
190
}
193
191
194
- fn get_recording_name ( os : & str ) -> String {
192
+ fn get_recording_name ( ) -> String {
195
193
let now = chrono:: Local :: now ( ) ;
196
- let extension = if MACOS . is ( os) {
197
- FFMPEG_RECORDING_EXTENSION_MKV
198
- } else {
199
- FFMPEG_RECORDING_EXTENSION_AVI
200
- } ;
201
- now. format ( "%Y-%m-%d_%H-%M-%S" ) . to_string ( ) + "." + extension
194
+ now. format ( "%Y-%m-%d_%H-%M-%S" ) . to_string ( ) + "." + FFMPEG_RECORDING_EXTENSION_AVI
202
195
}
203
196
204
197
pub fn record_desktop_with_ffmpeg (
@@ -209,7 +202,7 @@ pub fn record_desktop_with_ffmpeg(
209
202
) -> Result < ( ) , Error > {
210
203
let recording_target = cache_path
211
204
. join ( FFMPEG_RECORDING_FOLDER )
212
- . join ( get_recording_name ( os ) ) ;
205
+ . join ( get_recording_name ( ) ) ;
213
206
let recording_name = path_to_string ( & recording_target) ;
214
207
create_parent_path_if_not_exists ( & recording_target) ?;
215
208
0 commit comments