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 CDAF4445E0 for ; Thu, 20 Oct 2022 07:46:41 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4409A68BD71; Thu, 20 Oct 2022 10:46:38 +0300 (EEST) Received: from mx.sdf.org (mx.sdf.org [205.166.94.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CAE8368BD71 for ; Thu, 20 Oct 2022 10:46:31 +0300 (EEST) Received: from aecf642c91546b177d47b7680ad3cd11 ([1.145.213.234]) (authenticated (0 bits)) by mx.sdf.org (8.15.2/8.14.5) with ESMTPSA id 29K7kOiU024791 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for ; Thu, 20 Oct 2022 07:46:29 GMT Date: Thu, 20 Oct 2022 18:46:20 +1100 From: Peter Ross To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches References: <406d03fabf0bcf44fbfc894cf9960e3ad3947caf.1666229366.git.pross@xvid.org> <48a2b0b2ccefd79444b467e7d69527028ee5f3cb.1666229366.git.pross@xvid.org> <4adabb90-7d6a-eb6a-4457-3d62017d7cbf@gmail.com> MIME-Version: 1.0 In-Reply-To: <4adabb90-7d6a-eb6a-4457-3d62017d7cbf@gmail.com> Subject: Re: [FFmpeg-devel] [PATCHv2 3/4] avcodec/svq1enc: output ident string in extradata field 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 Content-Type: multipart/mixed; boundary="===============8435375434324144277==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============8435375434324144277== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9dIui66x/OIMlaBl" Content-Disposition: inline --9dIui66x/OIMlaBl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 19, 2022 at 10:42:39PM -0300, James Almer wrote: > On 10/19/2022 10:30 PM, Peter Ross wrote: > > This will enable the acurate identification of FFmpeg produced > > SVQ1 streams, should there be new bugs found in the encoder. > > --- > > libavcodec/svq1enc.c | 9 +++++++++ > > 1 file changed, 9 insertions(+) > >=20 > > diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c > > index 9bd5a04368..6aacaef88d 100644 > > --- a/libavcodec/svq1enc.c > > +++ b/libavcodec/svq1enc.c > > @@ -41,6 +41,7 @@ > > #include "svq1.h" > > #include "svq1encdsp.h" > > #include "svq1enc_cb.h" > > +#include "version.h" > > #include "libavutil/avassert.h" > > #include "libavutil/frame.h" > > @@ -628,6 +629,14 @@ static av_cold int svq1_encode_init(AVCodecContext= *avctx) > > ff_h263_encode_init(&s->m); // mv_penalty > > + if (!(s->avctx->flags & AV_CODEC_FLAG_BITEXACT)) { > > + avctx->extradata =3D av_malloc(sizeof(LIBAVCODEC_IDENT)); > > + if (!avctx->extradata) > > + return AVERROR(ENOMEM); > > + memcpy(avctx->extradata, LIBAVCODEC_IDENT, sizeof(LIBAVCODEC_I= DENT)); > > + avctx->extradata_size =3D sizeof(LIBAVCODEC_IDENT); >=20 > Can you explain what effect is this meant to have and where? Do or should > muxers like mp4 and matroska expect extradata from svq1 streams that they > are meant to write to the output file? the intention is to populate MOV stsd atom with a unique version number, su= ch that if another encoder bug is discovered, we can acurately detect the vers= ion of the encoder and apply workarounds. the mov stsd atom is mapped to avctx-= >extradata. we already use this approach for other encoders. the MPEG4 ASP video encoder inserts the codec ident in a free text part of the header. there is no simi= lar free text space in the SVQ1 bitstream. fortunately the official/binary deco= der ignores the stsd atom, so i propose to use that. the SVQ1 official decoder = has not received updates for a long time and i dont expect it to change. the wi= ndows binaries are marked end of life, and have not recieved update since 2009. for other file formats, i expect them just to carry the extradata if they c= an. this already works fine for avi. in the case of matroska, FFmpeg already in= serts the extradata in a V_QUICKTIME block per the specification (https://www.matroska.org/technical/codec_specs.html ), so nothing to do th= ere. however now that i look closely, FFmpeg also adds a custom atom around the = extradata (commit in 8456bd2c0f3b08756f353646fe3b40a6772e665e), and doesn't strip thi= s away on demux. this is wrong, imho.=20 it may be worth improving this patch set the following two ways: 1) modify the SVQ1 encoder ident extradata to look like an stsd atom, by inserting length and tag fields at the beginning. 2) modify the matroska muxer *not* to emit this custom atom for codecs who= 's extradta is also in atom format (SVQ1 and SVQ3). -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) --9dIui66x/OIMlaBl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSpB+AvpuUM0jTNINJnYHnFrEDdawUCY1D8yAAKCRBnYHnFrEDd awetAJ0RY5g7XOwEkfZcz8ZCyRcYfZ1a5wCghGBmbevXAv2YqMOwdxcYvA0GOMI= =Gj8q -----END PGP SIGNATURE----- --9dIui66x/OIMlaBl-- --===============8435375434324144277== 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". --===============8435375434324144277==--