diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-07-06 01:51:56 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-07-06 01:51:56 +0200 |
commit | edb770ba34efb7a48eee07b4b3eadf57a1345138 (patch) | |
tree | 894dc2a4e22a98053875c9b88a54ac2b4708da9c | |
parent | c611c519bc453e9be8ec0f43afe85eaf0fafd37a (diff) |
Add support for vp8 and vp9 (experimental)
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | com.dec05eba.gpu_screen_recorder.appdata.xml | 13 | ||||
-rw-r--r-- | src/main.cpp | 28 |
3 files changed, 40 insertions, 3 deletions
@@ -23,3 +23,5 @@ Implement profiles to quickly switch between settings. Use https://hosted.weblate.org/ for translation. Detect game name by using x11 window class or title. Fallback to finding pressure vessel, find the binary is runs and get the directory name directly under the proton game list directory. Fallback to pure wine. + +Add option to use software encoder (-encoder cpu).
\ No newline at end of file diff --git a/com.dec05eba.gpu_screen_recorder.appdata.xml b/com.dec05eba.gpu_screen_recorder.appdata.xml index 7d05e52..3a36046 100644 --- a/com.dec05eba.gpu_screen_recorder.appdata.xml +++ b/com.dec05eba.gpu_screen_recorder.appdata.xml @@ -26,8 +26,10 @@ <p>Supported video codecs:</p> <ul> <li>H264 (default)</li> - <li>HEVC</li> - <li>AV1 (not currently supported on NVIDIA in the flatpak)</li> + <li>HEVC (Optionally with HDR)</li> + <li>AV1 (Optionally with HDR. Not currently supported on NVIDIA if you use GPU Screen Recorder flatpak)</li> + <li>VP8</li> + <li>VP9</li> </ul> <p>Supported audio codecs:</p> <ul> @@ -82,6 +84,13 @@ </screenshots> <releases> + <release version="3.8.3" date="2024-07-06"> + <description> + <ul> + <li>Add VP8 and VP9 if supported by the hardware</li> + </ul> + </description> + </release> <release version="3.8.2" date="2024-06-22"> <description> <ul> diff --git a/src/main.cpp b/src/main.cpp index 0a171dd..d665298 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -182,6 +182,8 @@ struct SupportedVideoCodecs { bool h264; bool hevc; bool av1; + bool vp8; + bool vp9; }; static SupportedVideoCodecs supported_video_codecs; @@ -2490,6 +2492,8 @@ static int get_supported_video_codecs(SupportedVideoCodecs *supported_video_code supported_video_codecs->h264 = false; supported_video_codecs->hevc = false; supported_video_codecs->av1 = false; + supported_video_codecs->vp8 = false; + supported_video_codecs->vp9 = false; FILE *f = popen("gpu-screen-recorder --list-supported-video-codecs", "r"); if(!f) { @@ -2512,6 +2516,10 @@ static int get_supported_video_codecs(SupportedVideoCodecs *supported_video_code supported_video_codecs->hevc = true; if(strstr(output, "av1")) supported_video_codecs->av1 = true; + if(strstr(output, "vp8")) + supported_video_codecs->vp8 = true; + if(strstr(output, "vp9")) + supported_video_codecs->vp9 = true; int status = pclose(f); if(WIFEXITED(status)) @@ -2770,6 +2778,10 @@ static GtkWidget* create_common_settings_page(GtkStack *stack, GtkApplication *a gtk_combo_box_text_append(video_codec_input_menu, "hevc", "HEVC"); if(supported_video_codecs.av1) gtk_combo_box_text_append(video_codec_input_menu, "av1", "AV1"); + if(supported_video_codecs.vp8) + gtk_combo_box_text_append(video_codec_input_menu, "vp8", "VP8"); + if(supported_video_codecs.vp9) + gtk_combo_box_text_append(video_codec_input_menu, "vp9", "VP9"); if(wayland) { if(supported_video_codecs.hevc) @@ -2988,6 +3000,9 @@ static GtkWidget* create_replay_page(GtkApplication *app, GtkStack *stack) { for(auto &supported_container : supported_containers) { gtk_combo_box_text_append(replay_container, supported_container.container_name, supported_container.file_extension); } + if(supported_video_codecs.vp8 || supported_video_codecs.vp9) { + gtk_combo_box_text_append(replay_container, "webm", "webm"); + } gtk_widget_set_hexpand(GTK_WIDGET(replay_container), true); gtk_grid_attach(container_grid, GTK_WIDGET(replay_container), 1, 0, 1, 1); gtk_combo_box_set_active(GTK_COMBO_BOX(replay_container), 0); // TODO: @@ -3121,6 +3136,9 @@ static GtkWidget* create_recording_page(GtkApplication *app, GtkStack *stack) { for(auto &supported_container : supported_containers) { gtk_combo_box_text_append(record_container, supported_container.container_name, supported_container.file_extension); } + if(supported_video_codecs.vp8 || supported_video_codecs.vp9) { + gtk_combo_box_text_append(record_container, "webm", "webm"); + } gtk_widget_set_hexpand(GTK_WIDGET(record_container), true); gtk_grid_attach(container_grid, GTK_WIDGET(record_container), 1, 0, 1, 1); gtk_combo_box_set_active(GTK_COMBO_BOX(record_container), 0); // TODO: @@ -3243,6 +3261,9 @@ static GtkWidget* create_streaming_page(GtkApplication *app, GtkStack *stack) { for(auto &supported_container : supported_containers) { gtk_combo_box_text_append(custom_stream_container, supported_container.container_name, supported_container.file_extension); } + if(supported_video_codecs.vp8 || supported_video_codecs.vp9) { + gtk_combo_box_text_append(custom_stream_container, "webm", "webm"); + } gtk_widget_set_hexpand(GTK_WIDGET(custom_stream_container), true); gtk_grid_attach(custom_stream_container_grid, GTK_WIDGET(custom_stream_container), 1, 0, 1, 1); gtk_combo_box_set_active(GTK_COMBO_BOX(custom_stream_container), 1); @@ -3446,8 +3467,13 @@ static void load_config(const gpu_info &gpu_inf) { if(config.main_config.quality != "medium" && config.main_config.quality != "high" && config.main_config.quality != "very_high" && config.main_config.quality != "ultra") config.main_config.quality = "very_high"; - if(config.main_config.codec != "auto" && config.main_config.codec != "h264" && config.main_config.codec != "h265" && config.main_config.codec != "hevc" && config.main_config.codec != "av1" && config.main_config.codec != "hevc_hdr" && config.main_config.codec != "av1_hdr") + if(config.main_config.codec != "auto" && config.main_config.codec != "h264" && config.main_config.codec != "h265" + && config.main_config.codec != "hevc" && config.main_config.codec != "av1" + && config.main_config.codec != "hevc_hdr" && config.main_config.codec != "av1_hdr" + && config.main_config.codec != "vp8" && config.main_config.codec != "vp9") + { config.main_config.codec = "auto"; + } if(!wayland && (config.main_config.codec == "hevc_hdr" || config.main_config.codec == "av1_hdr")) config.main_config.codec = "auto"; |