From: Lynne <dev@lynne.ee>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [RFC] Subtitle Filtering Ramp-Up
Date: Wed, 4 Jun 2025 01:00:01 +0900
Message-ID: <d0b5ae64-2947-498c-aaba-0f1813ed80c2@lynne.ee> (raw)
In-Reply-To: <DM8P223MB0365BD8492EA1137948089E5BA6DA@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM>
You don't get to say "oh, there were no more objections, so it was fine"
or "the use is evident" after the mess that your original patchsets were.
You're still not using the native time fields, nor the packet buffers,
which is a very hard NAK from me.
On 03/06/2025 23:20, softworkz . wrote:
> Hello everybody,
>
> [just deleted a whole page of introduction text that was
> essentially pointless]
>
> Getting right to the point, I will give it once another try,
> rework and resubmit an updated version of the subtitle filtering
> patchset, including all improvements and fixes that have been
> made in the meantime.
>
> To avoid unnecessary work, it would be great to get one
> crucial part settled up-front.
>
>
> New fields on AVFrame for Subtitle Filtering
> ============================================
>
> Some of them are used from so many places, that it's a really
> tedious job to change them, hence I'd like to get this cleared-up
> before.
>
> Let's go through them:
>
>
> - enum AVMediaType type;
> This had never been questioned, it should be clear why it's needed
>
>
> - unsigned num_subtitle_areas;
> - AVSubtitleArea **subtitle_areas;
> There were extensive discussions about why the data isn't stored in
> the video buffers, but eventually there was no more objection
>
>
> - AVBufferRef *subtitle_header;
> The reason why the ASS header needs to be moved around has been
> explained and wasn't objected eventually
>
>
> - int repeat_sub;
> The use case is evident. But I have seen that a number of similar
> fields have been removed meanwhile and replaced by flags.
> So, the question here would be whether this should also be migrated
> to a flag?
>
>
> - Time Fields
> This has been the one most discussed topic, but nothing has
> changed in this regard: it requires a separate start and a
> separate duration field for subtitles.
> There's one improvement I make, which is the addition of a flow_mode
> field. I'll explain the details further down below.
>
> My preferred way for including the field in the AVFrame struct
> used to be a sub-struct - simply because it unclutters the list
> of AVFrame members:
>
> struct SubtitleTiming
> {
> int64_t start_pts;
> int64_t duration;
> AVSubtitleFlowMode flow_mode;
>
> } subtitle_timing;
>
>
> The same could be done for the other fields:
>
> struct Subtitles
> {
> unsigned num_subtitle_areas;
> AVSubtitleArea **subtitle_areas;
> AVBufferRef *subtitle_header;
>
> } subtitles;
>
>
> Or all in one:
>
> struct Subtitles
> {
> unsigned num_subtitle_areas;
> AVSubtitleArea **subtitle_areas;
> AVBufferRef *subtitle_header;
>
> int64_t start_pts;
> int64_t duration;
> AVSubtitleFlowMode flow_mode;
>
> } subtitles;
>
>
>
> Of course, they can also be added as flat members, but will
> require a prefix then, like:
>
> int64_t subtitle_start_pts;
> int64_t subtitle_duration;
> AVSubtitleFlowMode subtitle_flow_mode;
>
>
> Please let me know which way you would deem to be most suitable and
> whatever thoughts or questions you might have beyond this.
>
>
>
> Subtitle Flow Mode
> ==================
>
> Please see the list and explanation of flow modes here:
> https://github.com/softworkz/SubtitleFilteringDemos/issues/4
>
> This is not something conceptually new. It has always existed, but just
> implicitly behind the scenes and you had to know about it in some way
> for creating working FFmpeg command lines, because not
> every subtitle decoder, neither every subtitle filter nor every subtitle
> encoder is compatible with each other, even when there's a match in
> subtitle type (text/bitmap). Actually, it also needs the flow modes
> to match or be compatible. In the original set, it just failed in those
> cases or deadlocked.
>
> Making it explicit now in the form of the AVSubtitleFlowMode enum
> provides a number of benefits:
>
> - It finally provides an understandable explanation for why those two
> extra timing fields are needed
>
> - It makes clear what I had continuously failed to explain
>
> - By giving names to the modes, it will be much easier to understand
> and talk about
>
> - It allows to provide better feedback to users in case of error,
> like writing out something like "incompatible flow modes"
>
> - It will be possible to simplify usage: By including this as
> a parameter in filter negotiation, we will be able to perform
> auto-filter insertions in cases where its reasonable.
>
>
> Please let me know about your thoughts!
>
> Best regards,
> softworkz
>
>
> _______________________________________________
> 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".
next prev parent reply other threads:[~2025-06-03 16:00 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-03 14:20 softworkz .
2025-06-03 16:00 ` Lynne [this message]
2025-06-03 16:02 ` James Almer
2025-06-03 16:40 ` Nicolas George
2025-06-03 16:48 ` James Almer
2025-06-03 16:51 ` Devlist Archive
2025-06-03 17:59 ` Nicolas George
2025-06-03 16:12 ` softworkz .
2025-06-03 16:12 ` Devin Heitmueller
2025-06-03 16:43 ` Nicolas George
2025-06-03 17:07 ` softworkz .
2025-06-03 17:15 ` Devlist Archive
2025-06-03 17:16 ` Devlist Archive
2025-06-03 17:19 ` softworkz .
2025-06-04 15:49 ` Rémi Denis-Courmont
2025-06-04 17:13 ` softworkz .
2025-06-04 17:25 ` Nicolas George
2025-06-04 17:31 ` softworkz .
2025-06-04 19:02 ` softworkz .
2025-06-03 17:17 ` softworkz .
2025-06-03 16:28 ` softworkz .
2025-06-03 18:02 ` Hendrik Leppkes
2025-06-03 18:34 ` Zach Swena
2025-06-04 0:01 ` Michael Niedermayer
2025-06-04 7:13 ` Nicolas George
2025-06-04 7:22 ` Diederick C. Niehorster
2025-06-04 7:25 ` Nicolas George
2025-06-04 17:24 ` softworkz .
2025-06-04 17:29 ` Nicolas George
2025-06-04 17:33 ` softworkz .
2025-06-04 17:35 ` Nicolas George
2025-06-04 17:40 ` softworkz .
2025-06-04 17:44 ` Nicolas George
2025-06-04 17:54 ` softworkz .
2025-06-04 17:57 ` Nicolas George
2025-06-04 18:11 ` softworkz .
2025-06-04 18:12 ` Nicolas George
2025-06-04 18:17 ` softworkz .
2025-06-04 20:42 ` Michael Niedermayer
2025-06-05 0:17 ` softworkz .
2025-06-06 14:32 ` Nicolas George
2025-06-06 14:50 ` Devin Heitmueller
2025-06-08 13:10 ` Nicolas George
2025-06-06 16:54 ` softworkz .
2025-06-07 16:19 ` softworkz .
2025-06-07 17:25 ` Kieran Kunhya via ffmpeg-devel
2025-06-07 17:45 ` softworkz .
2025-06-03 19:13 ` softworkz .
2025-06-04 7:34 ` Nicolas George
2025-06-04 1:16 ` softworkz .
2025-06-04 7:36 ` Nicolas George
2025-06-03 19:23 ` softworkz .
2025-06-04 7:33 ` Nicolas George
2025-06-04 18:35 ` softworkz .
2025-06-05 0:44 ` softworkz .
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=d0b5ae64-2947-498c-aaba-0f1813ed80c2@lynne.ee \
--to=dev@lynne.ee \
--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