0

I want to download the subtitle of a video, it has separated m3u8 file for subtitle:

webvtt source in m3u8 format: https://sdn-global-streaming-cache.3qsdn.com/9378/files/19/05/1199332/Dqt6jZBkvX2nLyY4CGhxmpK89PbQRFV7-drm-aes.ism/Dqt6jZBkvX2nLyY4CGhxmpK89PbQRFV7-drm-aes-textstream_deu=1000.m3u8

looks like:

#EXTM3U
#EXT-X-VERSION:4
## Created with Unified Streaming Platform(version=1.9.5)
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-TARGETDURATION:989
#USP-X-TIMESTAMP-MAP:MPEGTS=900000,LOCAL=1970-01-01T00:00:00Z
#EXTINF:24.72, no desc
Dqt6jZBkvX2nLyY4CGhxmpK89PbQRFV7-drm-aes-textstream_deu=1000-1.webvtt
#EXTINF:2.56, no desc
Dqt6jZBkvX2nLyY4CGhxmpK89PbQRFV7-drm-aes-textstream_deu=1000-13.webvtt
#EXTINF:50.88, no desc
Dqt6jZBkvX2nLyY4CGhxmpK89PbQRFV7-drm-aes-textstream_deu=1000-14.webvtt
#EXTINF:3.079, no desc
Dqt6jZBkvX2nLyY4CGhxmpK89PbQRFV7-drm-aes-textstream_deu=1000-40.webvtt
#EXTINF:60.401, no desc
....

Then use the command to download the multiple webvtts into one vtt file "EN.vtt":

ffmpeg -i  "https://sdn-global-streaming-cache.3qsdn.com/9378/files/19/05/1199332/Dqt6jZBkvX2nLyY4CGhxmpK89PbQRFV7-drm-aes.ism/Dqt6jZBkvX2nLyY4CGhxmpK89PbQRFV7-drm-aes-textstream_deu=1000.m3u8"  "DE.vtt"

In output "DE.vtt" the X-TIMESTAMP-MAP=MPEGTS:xxxxxx,LOCAL:00:00:00.000 from each webvtt file (webvtt in m3u8) are ignored.

so that the time Synchronisation is broken, the start time of each Segment always begins from 00:00:00, looks like:

WEBVTT

00:00.000 --> 00:02.560
So viel Macht.

00:00.000 --> 00:03.079
Was er sagte.

00:00.000 --> 00:04.680
oder
die Schönheit

00:00.000 --> 00:01.440
Er sagte immer:

00:00.000 --> 00:03.840
Auf seinen Klang 

00:00.000 --> 00:07.519
Seine Paranoia.

Could ffmpeg support the relative time stamp to convert into absolute time stamp? Or use other method to download perfect webvvt file?

Panda Xia
  • 3
  • 1
  • 2

1 Answers1

0

All i could find was this very old patch that has never been merged into FFmpeg: https://patchwork.ffmpeg.org/project/ffmpeg/patch/20170205194344.333-1-franklinphillips@gmx.com/

I edited it a little bit and applied it to the current ffmpeg source code, recompiled and successfully converted some webVTT subtitles served via HLS with X-TIMESTAMP-MAP tags.

This is the patch i finally used: https://gist.github.com/SebiderSushi/bdf8d46d5501f7085d0b27d8a19eb12c

Edit:
There is an open ticket on the FFmpeg issue tracker about this: https://trac.ffmpeg.org/ticket/8825

Brian
  • 51
  • 3
  • I got a very old CD ROM in 1996. the MOV files are encoded with Indeo 3.2.(Intel Indeo™ Video R3.2) Audio is normal pcm, two example file can be found in https://1drv.ms/u/s!AgFGtfExBIBTkiGy1vB4oYvh5t4N?e=v4u7CV https://1drv.ms/u/s!AgFGtfExBIBTkjL1gZtJOz9CV9tz?e=12z3gb do you know how to chang to h264 or other format? – Panda Xia Feb 08 '21 at 23:41
  • @PandaXia Explanation: https://gist.github.com/SebiderSushi/be89ede578881f22c66d667e717c9859 Fixed files: https://mega.nz/folder/AqpAmZxb#q4wInpkC_b9RZEVfVMkIRQ I assume you can deal with the audio yourself so i only converted the video track. – Brian Feb 10 '21 at 08:02
  • Yet again, there seems to be an obscure and forgotten ticket about this https://trac.ffmpeg.org/ticket/6581 – Brian Feb 10 '21 at 08:20
  • @PandaXia I replied to that FFmpeg ticked i linked and they want the input indeo3 files. Is it okay if i send them or link them your files? – Brian Feb 12 '21 at 17:35
  • Vielen vielen Dank! – Panda Xia Feb 12 '21 at 21:53