Change #271765
| Category | ffmpeg |
| Changed by | Jun Zhao <barryjzhao@tencent.com> |
| Changed at | Fri 19 Jun 2026 06:33:18 |
| Repository | https://git.ffmpeg.org/ffmpeg.git |
| Project | ffmpeg |
| Branch | master |
| Revision | a4317c4ff8b0fcd0b486f6a57628bbcf6f0aa5eb |
Comments
avcodec/webvttdec: map WebVTT cue timestamps to ASS {\kf} tags
Split each cue at its inline timestamps and emit every segment as
"{\kf<cs>}<text>", the duration being the segment's own span (next
timestamp minus current); the tag precedes the text so the karaoke fill
runs during the segment. Boundaries are rounded to centiseconds against
the cue start and differenced, so durations telescope to the cue length
without drift. Packet timing uses pkt_timebase rather than assuming a
1/1000 time base. Out-of-range, non-monotonic and malformed timestamps
are ignored; cues without timestamps are emitted unchanged.
ASS {\kf} only approximates WebVTT timed text (no ::cue(:past/:future)).
Fixes: ticket #23289
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Changed files
- libavcodec/webvttdec.c