From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 1/3] libavcodec: Make disposition forced work with mov_text subtitles.
Date: Mon, 18 Jul 2022 18:57:43 +0200
Message-ID: <20220718165743.GR2088045@pb2> (raw)
In-Reply-To: <20220718160833.12397-2-facefunk@fcfnk.com>
[-- Attachment #1.1: Type: text/plain, Size: 3027 bytes --]
On Mon, Jul 18, 2022 at 05:08:31PM +0100, facefunk wrote:
> We are not currently able to force mov_text subtitles by setting -disposition:s:0 +forced or equivalent. By setting the forced flags in movtextenc as specifid in https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html subtitles can be forced as expected in VLC and similar players.
>
> Copy AVStream disposition to AVCodecContext and use to set DISPLAY_FLAG_ALL_SAMPLES_FORCED in movtextenc.c.
>
> Signed-off-by: facefunk <facefunk@fcfnk.com>
> ---
> fftools/ffmpeg_opt.c | 5 +++++
> libavcodec/avcodec.h | 16 ++++++++++++++++
> libavcodec/movtextenc.c | 41 ++++++++++++++++++++++++++++++++++++++++-
> 3 files changed, 61 insertions(+), 1 deletion(-)
>
> 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, AVFormatContext *ctx)
>
> if (ret < 0)
> return ret;
> +
> + // For output streams, copy stream disposition to the AVCodecContext
> + // object.
> + if(ost->enc_ctx)
> + ost->enc_ctx->stream_disposition = ost->st->disposition;
> }
> } else {
> // For each media type with more than one stream, find a suitable 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"
>
> +#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 needed.
> */
> AVChannelLayout ch_layout;
> +
> + /**
> + * Stream disposition - a combination of AV_DISPOSITION_* flags from
> + * libavformat.
> + *
> + * Copied from the relevant AVStream object for codecs that need access to
> + * the stream disposition parameter, such as movtextenc.c which needs 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.
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
[...]
--
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
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
next prev parent reply other threads:[~2022-07-18 16:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-17 13:32 [FFmpeg-devel] (no subject) facefunk
2022-07-17 13:32 ` [FFmpeg-devel] [PATCH 1/2] Typos facefunk
2022-07-17 13:32 ` [FFmpeg-devel] [PATCH 2/2] Copy AVStream disposition to AVCodecContext and use to set DISPLAY_FLAG_ALL_SAMPLES_FORCED in movtextenc.c facefunk
2022-07-18 16:08 ` [FFmpeg-devel] Make disposition forced work with mov_text subtitles facefunk
2022-07-18 16:08 ` [FFmpeg-devel] [PATCH 1/3] libavcodec: " facefunk
2022-07-18 16:57 ` Michael Niedermayer [this message]
2022-07-18 20:00 ` [FFmpeg-devel] " facefunk
2022-07-18 20:00 ` [FFmpeg-devel] [PATCH v3] libavcodec: " facefunk
2022-07-18 16:08 ` [FFmpeg-devel] [PATCH 2/3] libavcodec: Correct typo in mov_text encoder class name facefunk
2022-07-18 16:08 ` [FFmpeg-devel] [PATCH 3/3] libavutil: Correct number of parameters in flag type options documentation facefunk
2022-07-18 17:48 ` [FFmpeg-devel] Make disposition forced work with mov_text subtitles Leo Izen
2022-07-18 18:01 ` facefunk
2022-07-18 20:07 ` facefunk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220718165743.GR2088045@pb2 \
--to=michael@niedermayer.cc \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git