Skip to content

Instantly share code, notes, and snippets.

@martijnberger
Created September 16, 2021 19:50
Show Gist options
  • Save martijnberger/87e119fb9c9b6363d5fc1d9ca9ef37e1 to your computer and use it in GitHub Desktop.
Save martijnberger/87e119fb9c9b6363d5fc1d9ca9ef37e1 to your computer and use it in GitHub Desktop.
diff --git a/src/file_io/incaGstUtils.cpp b/src/file_io/incaGstUtils.cpp
index f564c9fd4..d54c5ba9a 100644
--- a/src/file_io/incaGstUtils.cpp
+++ b/src/file_io/incaGstUtils.cpp
@@ -219,6 +219,7 @@ void gstSetHardOMXH264Settings(GstElement* encoder, uint bitrate, uint iframeInt
if (profile >= 2) {
cabacEntropyCodingEnabled = true; //CABAC entropy encoding mode, supported at Main or High profile
}
+ profile = (profile == 4) ? 8 : profile; // We use v4l based settings
g_object_set(encoder,
"control-rate", 1, // 1 = variable bit rate
"bitrate", bitrate * 1000,
diff --git a/src/virtcam/recording/EncodingSettings.h b/src/virtcam/recording/EncodingSettings.h
index 049b3d8f2..84389863a 100644
--- a/src/virtcam/recording/EncodingSettings.h
+++ b/src/virtcam/recording/EncodingSettings.h
@@ -28,7 +28,7 @@ public:
SettingTypes::Setting<uint32_t> bitrate = {20000, "bitrate", SettingState::Custom, "The bitrate for the stream"};
SettingTypes::Setting<uint8_t> speedPreset = {1, "speedPreset", SettingState::Custom, "The speedPreset for the software encoder"};
SettingTypes::Setting<std::string> codec = {"h264", "codec", SettingState::Custom, "Either h264 or h265"};
- SettingTypes::Setting<uint8_t> profile = {2, "profile", SettingState::Custom, "Depends on the used encoder omx: 1 - Base, 2 - Main, 8 - High; v4l: 0 - Base, 2 - Main, 4 - High"};
+ SettingTypes::Setting<uint8_t> profile = {4, "profile", SettingState::Custom, "Depends on the used encoder omx: 1 - Base, 2 - Main, 8 - High; v4l: 0 - Base, 2 - Main, 4 - High"};
SettingTypes::Setting<uint32_t> iframeInterval = {120, "iframeInterval", SettingState::Custom, "I-Frame Interval, in frames"};
SettingTypes::Setting<bool> audio = {false, "audio", SettingState::Custom, "If true, virtcam will try to record audio."};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment