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 49BCA43050 for ; Mon, 18 Jul 2022 16:57:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AA7C168B845; Mon, 18 Jul 2022 19:57:52 +0300 (EEST) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E707A68B45F for ; Mon, 18 Jul 2022 19:57:44 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 396D220004 for ; Mon, 18 Jul 2022 16:57:43 +0000 (UTC) Date: Mon, 18 Jul 2022 18:57:43 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220718165743.GR2088045@pb2> References: <20220717133256.35929-1-facefunk@fcfnk.com> <20220718160833.12397-1-facefunk@fcfnk.com> <20220718160833.12397-2-facefunk@fcfnk.com> MIME-Version: 1.0 In-Reply-To: <20220718160833.12397-2-facefunk@fcfnk.com> Subject: Re: [FFmpeg-devel] [PATCH 1/3] libavcodec: Make disposition forced work with mov_text subtitles. 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="===============2520916013120078027==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2520916013120078027== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vvRocJ6whMXXNc9q" Content-Disposition: inline --vvRocJ6whMXXNc9q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 18, 2022 at 05:08:31PM +0100, facefunk wrote: > We are not currently able to force mov_text subtitles by setting -disposi= tion:s:0 +forced or equivalent. By setting the forced flags in movtextenc a= s specifid in https://developer.apple.com/library/archive/documentation/Qui= ckTime/QTFF/QTFFChap3/qtff3.html subtitles can be forced as expected in VLC= and similar players. >=20 > Copy AVStream disposition to AVCodecContext and use to set DISPLAY_FLAG_A= LL_SAMPLES_FORCED in movtextenc.c. >=20 > Signed-off-by: facefunk > --- > fftools/ffmpeg_opt.c | 5 +++++ > libavcodec/avcodec.h | 16 ++++++++++++++++ > libavcodec/movtextenc.c | 41 ++++++++++++++++++++++++++++++++++++++++- > 3 files changed, 61 insertions(+), 1 deletion(-) >=20 > diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c > index e08455478f..d8ea1d4bc1 100644 > --- a/fftools/ffmpeg_opt.c > +++ b/fftools/ffmpeg_opt.c > @@ -2244,6 +2244,11 @@ static int set_dispositions(OutputFile *of, AVForm= atContext *ctx) > =20 > if (ret < 0) > return ret; > + > + // For output streams, copy stream disposition to the AVCode= cContext > + // object. > + if(ost->enc_ctx) > + ost->enc_ctx->stream_disposition =3D ost->st->dispositio= n; > } > } else { > // For each media type with more than one stream, find a suitabl= e stream to > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > index cb5c25bf63..eb11de0293 100644 > --- a/libavcodec/avcodec.h > +++ b/libavcodec/avcodec.h > @@ -37,6 +37,8 @@ > #include "libavutil/pixfmt.h" > #include "libavutil/rational.h" > =20 > +#include "libavformat/avformat.h" libavcodec should not depend on libavformat > + > #include "codec.h" > #include "codec_desc.h" > #include "codec_par.h" > @@ -2054,6 +2056,20 @@ typedef struct AVCodecContext { > * The decoder can then override during decoding as need= ed. > */ > AVChannelLayout ch_layout; > + > + /** > + * Stream disposition - a combination of AV_DISPOSITION_* flags from > + * libavformat. > + * > + * Copied from the relevant AVStream object for codecs that need acc= ess to > + * the stream disposition parameter, such as movtextenc.c which need= s to > + * read the AV_DISPOSITION_FORCED flag so it knows when to set forced > + * subtitles. > + * > + * - encoding: Set by set_dispositions in ffmpeg_opt.c. ffmpeg is one application that uses libavcodec.=20 libavcodec API should not really talk about ffmpeg doing this or that, thats kind of odd also, your patches dont contain a full name, thats ok if thats what you want but if you want your full name in git then you may want to correct that thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB "I am not trying to be anyone's saviour, I'm trying to think about the future and not be sad" - Elon Musk --vvRocJ6whMXXNc9q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYtWRBwAKCRBhHseHBAsP q3dkAJ0Tv3zHaJdFPCst+Eq9vT74suFM+QCgmSgCinfZ0vhOzozrWurvOfu2ZNU= =snpw -----END PGP SIGNATURE----- --vvRocJ6whMXXNc9q-- --===============2520916013120078027== 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". --===============2520916013120078027==--