aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/videotoolboxenc.c
diff options
context:
space:
mode:
authorrcombs <rcombs@rcombs.me>2021-12-18 14:39:19 -0600
committerrcombs <rcombs@rcombs.me>2021-12-22 18:43:34 -0600
commit4778ab2b1fa993457bb3657de56a12dc9a55f3a0 (patch)
treefdb0c73d7a8e4651cc67624407556e4fcd0222f7 /libavcodec/videotoolboxenc.c
parent802c0515067fa3f5a67feb56241789dfcfb1ad09 (diff)
downloadffmpeg-4778ab2b1fa993457bb3657de56a12dc9a55f3a0.tar.gz
lavc/videotoolboxenc: explicitly set realtime=false
On some encoders, this defaults to true, which can result in encode speed being _limited_ to only slightly above realtime (as a power-saving measure), so we need a way to disable it.
Diffstat (limited to 'libavcodec/videotoolboxenc.c')
-rw-r--r--libavcodec/videotoolboxenc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index a2f5aa9be9..418ff00b8d 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -1389,10 +1389,10 @@ static int vtenc_create_encoder(AVCodecContext *avctx,
}
}
- if (vtctx->realtime) {
+ if (vtctx->realtime >= 0) {
status = VTSessionSetProperty(vtctx->session,
compat_keys.kVTCompressionPropertyKey_RealTime,
- kCFBooleanTrue);
+ vtctx->realtime ? kCFBooleanTrue : kCFBooleanFalse);
if (status) {
av_log(avctx, AV_LOG_ERROR, "Error setting realtime property: %d\n", status);
@@ -2677,7 +2677,7 @@ static const enum AVPixelFormat prores_pix_fmts[] = {
{ "require_sw", "Require software encoding", OFFSET(require_sw), AV_OPT_TYPE_BOOL, \
{ .i64 = 0 }, 0, 1, VE }, \
{ "realtime", "Hint that encoding should happen in real-time if not faster (e.g. capturing from camera).", \
- OFFSET(realtime), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, \
+ OFFSET(realtime), AV_OPT_TYPE_BOOL, { .i64 = 0 }, -1, 1, VE }, \
{ "frames_before", "Other frames will come before the frames in this session. This helps smooth concatenation issues.", \
OFFSET(frames_before), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, \
{ "frames_after", "Other frames will come after the frames in this session. This helps smooth concatenation issues.", \