From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id ED59B42825 for ; Sun, 1 May 2022 18:26:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E7B6C68B2C6; Sun, 1 May 2022 21:26:05 +0300 (EEST) Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 47E87689F20 for ; Sun, 1 May 2022 21:26:00 +0300 (EEST) Received: by mail-qt1-f176.google.com with SMTP id x22so4731096qto.2 for ; Sun, 01 May 2022 11:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:in-reply-to:to; bh=lpD6uE2W97q/krZgiEq05LjxWA/ma7S5IKm8LN6xStU=; b=PfJMTCCsQJo4h8YbfOKzp5TyNzKg976Pn06c+dRBowa+vtZzH78JcJor/f2lMQ68Oe kr63DaB0YEFL9b1aiIVjwvFZHiSPxzaT7EUuX1HO0ncYotZDkhkWLZK96KqIji8b83Kc jnLaW0RMHwdw/ZN8d2Qhwrh5MOyzFBWy/fuSNZQ2MEFor2JAIdnFHEqHavOy0ZvCKMgI QddsZU38LpYYMUy2cR6sGoC2RqxwQLfyPbdGn1yC+uS3Maj7XBy6uJRYispKRm5pSu8i rBqwkEglWHQROSD6Zm7QbXyG5+8cSId4CfiRcY/MITz93jjvf64LYlOwndfNhGWxnuDU iynQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:in-reply-to:to; bh=lpD6uE2W97q/krZgiEq05LjxWA/ma7S5IKm8LN6xStU=; b=k8ATd7SjoyBRREcrH9jh5V6nNr87Y7TOHPq5hX+1vD+dmVLlXB+5NvAmwDy8rtck69 zNN6L1kdP9FVZ12zkQUncyhYeFf/SSohIXVYO/2IpPE/lcJ1QqeoChhvDXRebXPa4CJG 9Bgv6tsCnIK+septQJjtAsIo451Tqnc7hOR0SeBlXnf0GB1WhW8S468vUTt+rQuST9On yhlOSJ74Lc7+2LV/3qPfoPgHSkYNQfZlFs3cg7MH4fWrA8HA8r6EdHH/ldZOx/uKy1TD P4h/vhPwg+ZlgXQfqr5D3LNd34lz62pHXHTCLl1kKi0k5ERvRtmm9wcuVjLrafgqtXZ9 8N1A== X-Gm-Message-State: AOAM533kqcZpEK6gjWanqhVxQ50L/HESQXOMoUGA3pg7yqYcYzvGw5UA SLsD0IEgHVEph0OZWzW+edskGcGktog= X-Google-Smtp-Source: ABdhPJy72zEZFb3pXUq+HSWEb3sBlBL960BdAmW66pYXSbj0U8oXO2kTfyhoqVyAfLmedhzsbbsBEA== X-Received: by 2002:ac8:5991:0:b0:2f3:911c:fb3 with SMTP id e17-20020ac85991000000b002f3911c0fb3mr7537776qte.555.1651429558689; Sun, 01 May 2022 11:25:58 -0700 (PDT) Received: from smtpclient.apple ([2600:1004:b042:9d7c:d48:efc4:f71b:172f]) by smtp.gmail.com with ESMTPSA id u16-20020ac87510000000b002f39b99f689sm2946707qtq.35.2022.05.01.11.25.57 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 May 2022 11:25:58 -0700 (PDT) Content-Type: multipart/mixed; boundary=Apple-Mail-B0020A65-6A12-451D-B3A9-B4C5B2763B6A Content-Transfer-Encoding: 7bit From: Richard Kern Mime-Version: 1.0 (1.0) Date: Sun, 1 May 2022 14:25:50 -0400 Message-Id: <4D6BE20A-02C3-420E-B666-D8F92B7EE6ED@gmail.com> References: In-Reply-To: To: FFmpeg development discussions and patches X-Mailer: iPhone Mail (19E258) Subject: Re: [FFmpeg-devel] [PATCH] libavcodec/videotoolboxenc.c: add option to hevc encoder to prioritize speed. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --Apple-Mail-B0020A65-6A12-451D-B3A9-B4C5B2763B6A Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > On May 1, 2022, at 1:31 PM, Simone Karin Lehmann wrote= : >=20 > =EF=BB=BFHi, >=20 > may I kindly ask you to check, if this patch could now be applied?=20 I=E2=80=99ll look at it today.=20 >=20 > Regards > Simone >=20 > Von meinem iPad gesendet >=20 >> Am 25.04.2022 um 22:33 schrieb Simone Karin Lehmann : >>=20 >> =EF=BB=BF >>=20 >>>>> Am 25.04.2022 um 21:14 schrieb Rick Kern : >>>>>=20 >>>>>=20 >>>>> { "a53cc", "Use A53 Closed Captions (if available)", OFFSET(a53_cc), >>>>> AV_OPT_TYPE_BOOL, {.i64 =3D 1}, 0, 1, VE }, >>>>> + { "prio_speed", "prioritize encoding speed", OFFSET(prio_speed), >>>>> AV_OPT_TYPE_BOOL, { .i64 =3D 0 }, 0, 1, VE }, >>>>>=20 >>> It might be simpler to make the default value of prio_speed -1, and set >>> this property on the encoder session only when it's non-negative. Then w= e >>> won't need to worry about the default value changing for different codec= s >>> or different OS versions. It could also be moved into COMMON_OPTIONS in >>> this case. >>=20 >> oh yes, that=E2=80=99s way better. I didn=E2=80=99t think of that in the f= irst place. Thanks for the hint. >>=20 >> Here=E2=80=99s the modified patch >>=20 >> Simone >>=20 --Apple-Mail-B0020A65-6A12-451D-B3A9-B4C5B2763B6A Content-Type: application/octet-stream; name=0001-add-options-to-h264-hevc-and-prores-encoders-to-prio.patch; x-apple-part-url=A30A018A-AD68-4705-A797-52E70895E362 Content-Disposition: attachment; filename=0001-add-options-to-h264-hevc-and-prores-encoders-to-prio.patch Content-Transfer-Encoding: quoted-printable =46rom 309388dd39817bd52d045c99b2f6264033e32115=20Mon=20Sep=2017=2000:00:00=20= 2001=0AFrom:=20Simone=20Karin=20Lehmann=20=0ADate:=20Mon,= =2025=20Apr=202022=2022:24:14=20+0200=0ASubject:=20[PATCH]=20add=20options=20= to=20h264,=20hevc=20and=20prores=20encoders=20to=20prioritize=0A=20speed.=20= Speeds=20up=20encoding=20by=2050%=20-=2070%=0A=0ASigned-off-by:=20Simone=20K= arin=20Lehmann=20=0A---=0A=20libavcodec/videotoolboxenc.c= =20|=2017=20++++++++++++++++-=0A=201=20file=20changed,=2016=20insertions(+),= =201=20deletion(-)=0A=0Adiff=20--git=20a/libavcodec/videotoolboxenc.c=20b/li= bavcodec/videotoolboxenc.c=0Aindex=20270496b7a7..8b1af30d44=20100644=0A---=20= a/libavcodec/videotoolboxenc.c=0A+++=20b/libavcodec/videotoolboxenc.c=0A@@=20= -100,6=20+100,7=20@@=20static=20struct{=0A=20=0A=20=20=20=20=20CFStringRef=20= kVTCompressionPropertyKey_RealTime;=0A=20=20=20=20=20CFStringRef=20kVTCompre= ssionPropertyKey_TargetQualityForAlpha;=0A+=20=20=20=20CFStringRef=20kVTComp= ressionPropertyKey_PrioritizeEncodingSpeedOverQuality;=0A=20=0A=20=20=20=20=20= CFStringRef=20kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEnc= oder;=0A=20=20=20=20=20CFStringRef=20kVTVideoEncoderSpecification_RequireHar= dwareAcceleratedVideoEncoder;=0A@@=20-161,6=20+162,8=20@@=20static=20void=20= loadVTEncSymbols(){=0A=20=20=20=20=20GET_SYM(kVTCompressionPropertyKey_RealT= ime,=20"RealTime");=0A=20=20=20=20=20GET_SYM(kVTCompressionPropertyKey_Targe= tQualityForAlpha,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20"TargetQualityFor= Alpha");=0A+=20=20=20=20GET_SYM(kVTCompressionPropertyKey_PrioritizeEncoding= SpeedOverQuality,=0A+=20=20=20=20=20=20=20=20=20=20=20=20"PrioritizeEncoding= SpeedOverQuality");=0A=20=0A=20=20=20=20=20GET_SYM(kVTVideoEncoderSpecificat= ion_EnableHardwareAcceleratedVideoEncoder,=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20"EnableHardwareAcceleratedVideoEncoder");=0A@@=20-237,6=20+240,7=20@@=20= typedef=20struct=20VTEncContext=20{=0A=20=20=20=20=20int=20allow_sw;=0A=20=20= =20=20=20int=20require_sw;=0A=20=20=20=20=20double=20alpha_quality;=0A+=20=20= =20=20int=20prio_speed;=0A=20=0A=20=20=20=20=20bool=20flushing;=0A=20=20=20=20= =20int=20has_b_frames;=0A@@=20-1146,6=20+1150,15=20@@=20static=20int=20vtenc= _create_encoder(AVCodecContext=20=20=20*avctx,=0A=20=20=20=20=20=20=20=20=20= return=20AVERROR_EXTERNAL;=0A=20=20=20=20=20}=0A=20=0A+=20=20=20=20if=20(vtc= tx->prio_speed=20>=3D=200)=20{=0A+=20=20=20=20=20=20=20=20status=20=3D=20VTS= essionSetProperty(vtctx->session,=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20c= ompat_keys.kVTCompressionPropertyKey_PrioritizeEncodingSpeedOverQuality,=0A+= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20kCFBooleanTrue);=0A+=20=20=20=20=20=20=20= =20if=20(status)=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=20av_log(avctx,=20= AV_LOG_WARNING,=20"PrioritizeEncodingSpeedOverQuality=20property=20is=20not=20= supported=20on=20this=20device.=20Ignoring.\n");=0A+=20=20=20=20=20=20=20=20= }=0A+=20=20=20=20}=0A+=0A=20=20=20=20=20if=20((vtctx->codec_id=20=3D=3D=20AV= _CODEC_ID_H264=20||=20vtctx->codec_id=20=3D=3D=20AV_CODEC_ID_HEVC)=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20&&=20max_rate=20>=200)=20{=0A=20=20=20=20=20=20= =20=20=20bytes_per_second_value=20=3D=20max_rate=20>>=203;=0A@@=20-2682,7=20= +2695,9=20@@=20static=20const=20enum=20AVPixelFormat=20prores_pix_fmts[]=20=3D= =20{=0A=20=20=20=20=20{=20"frames_before",=20"Other=20frames=20will=20come=20= before=20the=20frames=20in=20this=20session.=20This=20helps=20smooth=20conca= tenation=20issues.",=20\=0A=20=20=20=20=20=20=20=20=20OFFSET(frames_before),= =20AV_OPT_TYPE_BOOL,=20{=20.i64=20=3D=200=20},=200,=201,=20VE=20},=20\=0A=20= =20=20=20=20{=20"frames_after",=20"Other=20frames=20will=20come=20after=20th= e=20frames=20in=20this=20session.=20This=20helps=20smooth=20concatenation=20= issues.",=20\=0A-=20=20=20=20=20=20=20=20OFFSET(frames_after),=20AV_OPT_TYPE= _BOOL,=20{=20.i64=20=3D=200=20},=200,=201,=20VE=20},=0A+=20=20=20=20=20=20=20= =20OFFSET(frames_after),=20AV_OPT_TYPE_BOOL,=20{=20.i64=20=3D=200=20},=200,=20= 1,=20VE=20},=20\=0A+=20=20=20=20{=20"prio_speed",=20"prioritize=20encoding=20= speed",=20OFFSET(prio_speed),=20AV_OPT_TYPE_BOOL,=20\=0A+=20=20=20=20=20=20=20= =20{=20.i64=20=3D=20-1=20},=20-1,=201,=20VE=20},=20\=0A=20=0A=20#define=20OFF= SET(x)=20offsetof(VTEncContext,=20x)=0A=20static=20const=20AVOption=20h264_o= ptions[]=20=3D=20{=0A--=20=0A2.32.0=20(Apple=20Git-132)=0A=0A= --Apple-Mail-B0020A65-6A12-451D-B3A9-B4C5B2763B6A Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit >> >> _______________________________________________ >> ffmpeg-devel mailing list >> ffmpeg-devel@ffmpeg.org >> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel >> >> To unsubscribe, visit link above, or email >> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --Apple-Mail-B0020A65-6A12-451D-B3A9-B4C5B2763B6A Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --Apple-Mail-B0020A65-6A12-451D-B3A9-B4C5B2763B6A--