Opened 4 years ago

Last modified 3 years ago

#8825 new defect

Corrupt timestamps on WebVTT subtitles

Reported by: paralucent Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

When processing WebVTT subtitles FFMPEG skips the X-TIMESTAMP-MAP data resulting in a temporally corrupt subtitle output file in which every caption starts at 0:00:00.000.

How to reproduce:

ffmpeg  -i "https://sdn-global-streaming-cache-3qsdn.akamaized.net/stream/9378/files/18/12/1068412/9378-HWQKVTXrYyxwncZq.ism/9378-HWQKVTXrYyxwncZq-textstream_eng=1000.m3u8?mime=mp4&source=html5" subs.srt

Attachments (6)

ffmpeg-20200728-102425.log (1.2 MB ) - added by paralucent 4 years ago.
subs_sample.srt (61.4 KB ) - added by paralucent 4 years ago.
0002-avformat-webvttdec-Change-prefer_hls_mpegts_pts-into.2.patch (1.5 KB ) - added by giwiniswut 3 years ago.
.
0001-avformat-webvttdec-Add-support-for-HLS-WebVTT-MPEG-t.patch (4.2 KB ) - added by giwiniswut 3 years ago.
The original patch by Franklin Phillips <​franklinphillips@gmx.com> applied to the current master.
0002-avformat-webvttdec-Change-prefer_hls_mpegts_pts-into.patch (1.5 KB ) - added by giwiniswut 3 years ago.
.
0003-avformat-webvttdec-Calculate-hls_ts_offset-relative-.patch (1.7 KB ) - added by giwiniswut 3 years ago.
A change to treat X-TIMESTAMP-MAPs relative to the first fragment.

Download all attachments as: .zip

Change History (9)

by paralucent, 4 years ago

Attachment: ffmpeg-20200728-102425.log added

by paralucent, 4 years ago

Attachment: subs_sample.srt added

comment:1 by Carl Eugen Hoyos, 4 years ago

Please attach the input file, do not attach the output file to avoid confusion.

comment:2 by giwiniswut, 3 years ago

I am also affected by this issue. German TV station ZDF for example serves their livestream with WebVTT subtitles served via HLS.

I found that there is a patch for X-TIMESTAMP-MAP support on patchwork.ffmpeg.org.

The E-Mail address used to submit this original patch appears not to exist anymore. I tried to contact it but the particular mail server answered with an error 550 and the message "mailbox unavailable".

It is rather old (from 2017-02-05) but i changed it a little bit so that it applies to the current master branch. I also made it so that it treats all timestamps relative to the first fragment. See the attached patches.

Using these patches i successfully converted an HLS livestream with webVTT subtitles into one video file.

Last edited 3 years ago by giwiniswut (previous) (diff)

by giwiniswut, 3 years ago

The original patch by Franklin Phillips <​franklinphillips@gmx.com> applied to the current master.

by giwiniswut, 3 years ago

A change to treat X-TIMESTAMP-MAPs relative to the first fragment.

comment:3 by giwiniswut, 3 years ago

I just found an FFmpeg fork on GitHub which contains a version of the aforementioned patch by Franklin Phillips <​​franklinphillips@gmx.com> which was already committed on 2014-04-06. There are also some other related commits.

Last edited 3 years ago by giwiniswut (previous) (diff)
Note: See TracTickets for help on using tickets.