[FFmpeg-devel] [PATCH] libavformat/hlsenc: Add option to correct subtitles duration in webvtt subtitles

Jan Ekström jeebjp at gmail.com
Mon Dec 9 16:53:34 EET 2024


On Mon, Dec 9, 2024 at 1:24 PM Vladimir Kharchevin
<vkharchevin at gmail.com> wrote:
>
> When importing text subtitles from libzvbi_teletext stream the duration of subtitle
> frames is -1 by default or fixed value per codec setting.
> For hls webvtt stream it makes disappear time always 1193:02:47.295 for every subtitle.
> Suggested to add hls option fix_teletext_durations to fix this behavior and set subtitle
> duration to the next subtitle packet time.
>
> Signed-off-by: Vladimir Kharchevin <vkharchevin at gmail.com>

I would point you towards `fix_sub_duration` together with the related
heartbeat option for this for CLI usage.

Also as a note, there are already multiple formats that support "show
until next" functionality:

- US captions
- ARIB captions from Japan and South America
- DVB Teletext

So this is not specific to one specific format or decoder.

Finally, the way to support actual pass-through of show-until-next
values with webvtt would be to check if the specification supports
handling show-until-next subtitles. This could then be then
implemented in the WebVTT encoder and muxer. Not in the HLS muxer.

Best regards,
Jan


More information about the ffmpeg-devel mailing list