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 4B01C4282C for ; Sun, 1 May 2022 19:12:04 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A3EB768B2BB; Sun, 1 May 2022 22:12:02 +0300 (EEST) Received: from relay.yourmailgateway.de (unknown [188.68.63.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BFD8268AEF0 for ; Sun, 1 May 2022 22:11:55 +0300 (EEST) Received: from mors-relay8203.netcup.net (localhost [127.0.0.1]) by mors-relay8203.netcup.net (Postfix) with ESMTPS id 4Krwnk19q9z8YQx for ; Sun, 1 May 2022 19:11:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lisanet.de; s=key2; t=1651432314; bh=B8snnwiIVZdA1yCKxtKwiI2GGXB5euSSbWKNdAB6O6s=; h=From:Subject:Date:References:To:In-Reply-To:From; b=SiZioy51KtpcOQTJVvhJCgN+nRfjqG+I5tDdxmA0F/zkUR2j7RR8E48weJAWv7woE C6s5UxC8IXqINpfPsne8AU7eywIVgnEF4wxKDF1gn3x7qinWcNVmN8DgbHqmxA/+6w QNy6LM5OZgmo1cY87Sok2zAX0a1DWczDCTsrJCf/8mVD5DCcKkcKarMpKJ5QldWgU0 ppwnEq1qXbOEzJMmjniA6MqAKAl2+mqrLCp3k8xXJirKZVgQ2uUmmMQN54O1uaSO8T VUcJlCoOYs6+YHoiwjxj57cora3BG1GCedyaIirTg22y4AiBWsLMe1XzSRmWiAiUx0 gplZSPi/m7htw== Received: from policy02-mors.netcup.net (unknown [46.38.225.53]) by mors-relay8203.netcup.net (Postfix) with ESMTPS id 4Krwnk0n9Fz8YQw for ; Sun, 1 May 2022 19:11:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at policy02-mors.netcup.net X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no Received: from mx2f68.netcup.net (unknown [10.243.12.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by policy02-mors.netcup.net (Postfix) with ESMTPS id 4Krwnh5K8Lz8sWQ for ; Sun, 1 May 2022 21:11:52 +0200 (CEST) Received: from smtpclient.apple (ip-046-005-115-148.um12.pools.vodafone-ip.de [46.5.115.148]) by mx2f68.netcup.net (Postfix) with ESMTPSA id A210DA0C76 for ; Sun, 1 May 2022 21:11:51 +0200 (CEST) Authentication-Results: mx2f68; spf=pass (sender IP is 46.5.115.148) smtp.mailfrom=simone@lisanet.de smtp.helo=smtpclient.apple Received-SPF: pass (mx2f68: connection is authenticated) From: Simone Karin Lehmann Content-Type: multipart/mixed; boundary="Apple-Mail=_CC3CDD95-65ED-4682-BF07-16D32C03702F" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Date: Sun, 1 May 2022 21:11:51 +0200 References: <4D6BE20A-02C3-420E-B666-D8F92B7EE6ED@gmail.com> To: FFmpeg development discussions and patches In-Reply-To: <4D6BE20A-02C3-420E-B666-D8F92B7EE6ED@gmail.com> Message-Id: X-Mailer: Apple Mail (2.3696.80.82.1.1) X-PPP-Message-ID: <165143231203.19938.15355399980679018033@mx2f68.netcup.net> X-PPP-Vhost: lisanet.de X-NC-CID: Q2wsXwff3gG1mBuTmzHeqkskk3v5cfNe6g6m2v0vF+oT 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=_CC3CDD95-65ED-4682-BF07-16D32C03702F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi, =E2=80=A6 I=E2=80=99m so sorry, the patch I recently sent didn=E2=80=99t = test the prio_speed bool. This corrects it. I really sorry. :-/ Regards Simone --Apple-Mail=_CC3CDD95-65ED-4682-BF07-16D32C03702F Content-Disposition: attachment; filename=0001-add-options-to-h264-hevc-and-prores-encoders-to-prio.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-add-options-to-h264-hevc-and-prores-encoders-to-prio.patch" Content-Transfer-Encoding: quoted-printable =46rom=202cce97b985719813f0c5178c01c6824d9fea73bc=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Simone=20Karin=20Lehmann=20=0A= Date:=20Sun,=201=20May=202022=2021:07:47=20+0200=0ASubject:=20[PATCH]=20= add=20options=20to=20h264,=20hevc=20and=20prores=20encoders=20to=20= prioritize=0A=20speed.=20Speeds=20up=20encoding=20by=2050%=20-=2070%=0A=0A= Signed-off-by:=20Simone=20Karin=20Lehmann=20=0A---=0A=20= libavcodec/videotoolboxenc.c=20|=2017=20++++++++++++++++-=0A=201=20file=20= changed,=2016=20insertions(+),=201=20deletion(-)=0A=0Adiff=20--git=20= a/libavcodec/videotoolboxenc.c=20b/libavcodec/videotoolboxenc.c=0Aindex=20= 270496b7a7..69d9fe75bf=20100644=0A---=20a/libavcodec/videotoolboxenc.c=0A= +++=20b/libavcodec/videotoolboxenc.c=0A@@=20-100,6=20+100,7=20@@=20= static=20struct{=0A=20=0A=20=20=20=20=20CFStringRef=20= kVTCompressionPropertyKey_RealTime;=0A=20=20=20=20=20CFStringRef=20= kVTCompressionPropertyKey_TargetQualityForAlpha;=0A+=20=20=20=20= CFStringRef=20= kVTCompressionPropertyKey_PrioritizeEncodingSpeedOverQuality;=0A=20=0A=20= =20=20=20=20CFStringRef=20= kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder;=0A=20= =20=20=20=20CFStringRef=20= kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder;=0A= @@=20-161,6=20+162,8=20@@=20static=20void=20loadVTEncSymbols(){=0A=20=20=20= =20=20GET_SYM(kVTCompressionPropertyKey_RealTime,=20"RealTime");=0A=20=20= =20=20=20GET_SYM(kVTCompressionPropertyKey_TargetQualityForAlpha,=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20"TargetQualityForAlpha");=0A+=20=20=20=20= GET_SYM(kVTCompressionPropertyKey_PrioritizeEncodingSpeedOverQuality,=0A= +=20=20=20=20=20=20=20=20=20=20=20=20= "PrioritizeEncodingSpeedOverQuality");=0A=20=0A=20=20=20=20=20= GET_SYM(kVTVideoEncoderSpecification_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@@=20= static=20int=20vtenc_create_encoder(AVCodecContext=20=20=20*avctx,=0A=20=20= =20=20=20=20=20=20=20return=20AVERROR_EXTERNAL;=0A=20=20=20=20=20}=0A=20=0A= +=20=20=20=20if=20(vtctx->prio_speed=20>=3D=200)=20{=0A+=20=20=20=20=20=20= =20=20status=20=3D=20VTSessionSetProperty(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=20= compat_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=20vtctx->prio_speed=20?=20= kCFBooleanTrue=20:=20kCFBooleanFalse);=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=20= not=20supported=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=20= AV_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=20= max_rate=20>>=203;=0A@@=20-2682,7=20+2695,9=20@@=20static=20const=20enum=20= AVPixelFormat=20prores_pix_fmts[]=20=3D=20{=0A=20=20=20=20=20{=20= "frames_before",=20"Other=20frames=20will=20come=20before=20the=20frames=20= in=20this=20session.=20This=20helps=20smooth=20concatenation=20issues.",=20= \=0A=20=20=20=20=20=20=20=20=20OFFSET(frames_before),=20= AV_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=20= the=20frames=20in=20this=20session.=20This=20helps=20smooth=20= concatenation=20issues.",=20\=0A-=20=20=20=20=20=20=20=20= OFFSET(frames_after),=20AV_OPT_TYPE_BOOL,=20{=20.i64=20=3D=200=20},=200,=20= 1,=20VE=20},=0A+=20=20=20=20=20=20=20=20OFFSET(frames_after),=20= AV_OPT_TYPE_BOOL,=20{=20.i64=20=3D=200=20},=200,=201,=20VE=20},=20\=0A+=20= =20=20=20{=20"prio_speed",=20"prioritize=20encoding=20speed",=20= OFFSET(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=20= OFFSET(x)=20offsetof(VTEncContext,=20x)=0A=20static=20const=20AVOption=20= h264_options[]=20=3D=20{=0A--=20=0A2.32.0=20(Apple=20Git-132)=0A=0A= --Apple-Mail=_CC3CDD95-65ED-4682-BF07-16D32C03702F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Am 01.05.2022 um 20:25 schrieb Richard Kern : >=20 >=20 >=20 >> 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 >>=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 we >>>> won't need to worry about the default value changing for different = codecs >>>> 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 first place. Thanks for the hint. >>>=20 >>> Here=E2=80=99s the modified patch >>>=20 >>> Simone >>>=20 > <0001-add-options-to-h264-hevc-and-prores-encoders-to-prio.patch> >>=20 >>>=20 >>> _______________________________________________ >>> ffmpeg-devel mailing list >>> ffmpeg-devel@ffmpeg.org >>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel >>>=20 >>> 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 >>=20 >> 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 >=20 > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --Apple-Mail=_CC3CDD95-65ED-4682-BF07-16D32C03702F 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=_CC3CDD95-65ED-4682-BF07-16D32C03702F--