mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 04:42:18 +02:00
mac-videotoolbox: Enforce non-zero keyframe interval in CRF mode
This commit is contained in:
parent
6254e031d9
commit
3fed2e081e
@ -596,6 +596,17 @@ static bool create_encoder(struct vt_encoder *enc)
|
||||
|
||||
if (enc->codec_type == kCMVideoCodecType_H264 ||
|
||||
enc->codec_type == kCMVideoCodecType_HEVC) {
|
||||
/* Apple's documentation states that a keyframe interval of 0 will result in
|
||||
* the encoder automatically picking times to insert them; However, Apple's
|
||||
* encoder, when in CRF mode, will never actually insert any keyframes past
|
||||
* the very first one, rendering the files near-unusable in editors or
|
||||
* video players. So to avoid that happening, enforce a reasonable default
|
||||
* of 10 seconds in CRF mode. */
|
||||
if (enc->keyint == 0 && strcmp(enc->rate_control, "CRF") == 0) {
|
||||
VT_BLOG(LOG_INFO,
|
||||
"Enforcing non-zero keyframe interval in CRF mode");
|
||||
enc->keyint = 10;
|
||||
}
|
||||
|
||||
// This can fail when using GPU hardware encoding
|
||||
code = session_set_prop_int(
|
||||
|
Loading…
Reference in New Issue
Block a user