mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-05-05 06:20:43 +09:00
Only show codec warning for image output
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -23,3 +23,6 @@ gsr-kms-server
|
|||||||
*.mov
|
*.mov
|
||||||
*.webm
|
*.webm
|
||||||
*.ts
|
*.ts
|
||||||
|
*.jpg
|
||||||
|
*.jpeg
|
||||||
|
*.png
|
||||||
|
|||||||
@@ -3086,13 +3086,14 @@ static AudioDeviceData create_application_audio_audio_input(const MergedAudioInp
|
|||||||
|
|
||||||
static void set_video_codec_for_image_output(const char *filename, VideoCodec *video_codec, const char **video_codec_to_use) {
|
static void set_video_codec_for_image_output(const char *filename, VideoCodec *video_codec, const char **video_codec_to_use) {
|
||||||
const bool video_codec_auto = strcmp(*video_codec_to_use, "auto") == 0;
|
const bool video_codec_auto = strcmp(*video_codec_to_use, "auto") == 0;
|
||||||
if(!video_codec_auto)
|
|
||||||
fprintf(stderr, "Warning: expected -k option to be set to 'auto' (or not specified) for image output\n");
|
|
||||||
|
|
||||||
if(string_ends_with(filename, ".jpg") || string_ends_with(filename, ".jpeg")) {
|
if(string_ends_with(filename, ".jpg") || string_ends_with(filename, ".jpeg")) {
|
||||||
|
if(!video_codec_auto)
|
||||||
|
fprintf(stderr, "Warning: expected -k option to be set to 'auto' (or not specified) for jpeg output\n");
|
||||||
*video_codec = VideoCodec::JPEG;
|
*video_codec = VideoCodec::JPEG;
|
||||||
*video_codec_to_use = "jpeg";
|
*video_codec_to_use = "jpeg";
|
||||||
} else if(string_ends_with(filename, ".png")) {
|
} else if(string_ends_with(filename, ".png")) {
|
||||||
|
if(!video_codec_auto)
|
||||||
|
fprintf(stderr, "Warning: expected -k option to be set to 'auto' (or not specified) for png output\n");
|
||||||
*video_codec = VideoCodec::PNG;
|
*video_codec = VideoCodec::PNG;
|
||||||
*video_codec_to_use = "png";
|
*video_codec_to_use = "png";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user