Add support for HLS WebVTT subtitles #5029

Open
opened 2026-02-21 00:30:38 -05:00 by deekerman · 10 comments
Owner

Originally created by @yadayada on GitHub (Jun 27, 2015).

JSON dumps of CICGC URLs already include a link to sliced English subtitles in WebVTT format that could easily be downloaded using ffmpeg. It would be nice if the ComCarCoff extractor was able to detect these.

Originally created by @yadayada on GitHub (Jun 27, 2015). JSON dumps of CICGC URLs already include a link to sliced English subtitles in WebVTT format that could easily be downloaded using ffmpeg. It would be nice if the ComCarCoff extractor was able to detect these.
Author
Owner

@yadayada commented on GitHub (Jun 27, 2015):

Any URL should do. As far as I can tell, any episode includes subs.

For example, take
http://comediansincarsgettingcoffee.com/bill-maher-the-comedy-team-of-smug-and-arrogant

Using --dump-json you'll find a subtitle URL in the format object with id 398, e.g.
http://content-ause2.uplynk.com/a1a924b17afe47a0b86c0c4bd085fc4c/sub4.m3u8?ad=crackle_live&pbs=c97ce4e47cdf453eaad38536c7ceb4e1

@yadayada commented on GitHub (Jun 27, 2015): Any URL should do. As far as I can tell, any episode includes subs. For example, take http://comediansincarsgettingcoffee.com/bill-maher-the-comedy-team-of-smug-and-arrogant Using `--dump-json` you'll find a subtitle URL in the format object with id 398, e.g. http://content-ause2.uplynk.com/a1a924b17afe47a0b86c0c4bd085fc4c/sub4.m3u8?ad=crackle_live&pbs=c97ce4e47cdf453eaad38536c7ceb4e1
Author
Owner

@fstirlitz commented on GitHub (Jun 28, 2015):

I got some code to do it. There are two problems:

  • Since the URL points to an m3u8 manifest, it has to be post-processed to obtain offline-viewable subtitles. My code just injects a FFmpegSubtitlesConvertorPP (always converting to WebVTT) unless one's already been added.
  • FFmpeg (git snapshot as of 2015-06-23) cannot actually download playable subtitles. The downloaded WebVTT mixes up timestamps from multiple video fragments. The .vtt fragment files contain X-TIMESTAMP-MAP tags that can be used to synchronise the subtitles against the video, but FFmpeg doesn't make use of them.

Also, FYI:

I suppose the short-term option is to write a parser for HLS WebVTT streams…

@fstirlitz commented on GitHub (Jun 28, 2015): I got some code to do it. There are two problems: - Since the URL points to an m3u8 manifest, it has to be post-processed to obtain offline-viewable subtitles. My code just injects a `FFmpegSubtitlesConvertorPP` (always converting to WebVTT) unless one's already been added. - FFmpeg (git snapshot as of 2015-06-23) cannot actually download playable subtitles. The downloaded WebVTT mixes up timestamps from multiple video fragments. The `.vtt` fragment files contain `X-TIMESTAMP-MAP` tags that can be used to synchronise the subtitles against the video, but FFmpeg doesn't make use of them. Also, FYI: - https://trac.ffmpeg.org/ticket/2833 - https://ffmpeg.org/pipermail/ffmpeg-devel/2013-December/152503.html I suppose the short-term option is to write a parser for HLS WebVTT streams…
Author
Owner

@remitamine commented on GitHub (Jul 3, 2015):

i found this also in abc7news, so i created a function that download the segments of the subtitle and convert it to normal webvtt with the real time of each statment that ffmpeg can convert into ass or srt but the problem now is in the _extract_m3u8_formats function it return an array of video formats but not always the m3u8 variant playlist contain only videos somtimes it contain also subtitles or audio parts.
i think it shouldn't return a formats list is should return a dictionary contains formats and subtitles if there is and creating a new function only to extract the urls of subtitles from the variant playlist is not a good solution.
if this changed it will break the compatibilty of the extractors that use the function but it can solved with simple changes in every extractor that uses the function.
i know that in the formats array i can found the subtitle url in m3u8_media of the first format but i think it's not the right place.

@remitamine commented on GitHub (Jul 3, 2015): i found this also in abc7news, so i created a function that download the segments of the subtitle and convert it to normal webvtt with the real time of each statment that ffmpeg can convert into ass or srt but the problem now is in the _extract_m3u8_formats function it return an array of video formats but not always the m3u8 variant playlist contain only videos somtimes it contain also subtitles or audio parts. i think it shouldn't return a formats list is should return a dictionary contains formats and subtitles if there is and creating a new function only to extract the urls of subtitles from the variant playlist is not a good solution. if this changed it will break the compatibilty of the extractors that use the function but it can solved with simple changes in every extractor that uses the function. i know that in the formats array i can found the subtitle url in m3u8_media of the first format but i think it's not the right place.
Author
Owner

@remitamine commented on GitHub (Jul 3, 2015):

as i see @fstirlitz make a pull request and he make a great work so i will put the code i made in a gist may be he can benefit from it.
m3u8 webvtt download function

@remitamine commented on GitHub (Jul 3, 2015): as i see @fstirlitz make a pull request and he make a great work so i will put the code i made in a gist may be he can benefit from it. [m3u8 webvtt download function](https://gist.github.com/remitamine/cc81773c93d89bf046e0)
Author
Owner

@remitamine commented on GitHub (Feb 10, 2016):

support for subtitle extraction(ttml) will be added in the next version.

@remitamine commented on GitHub (Feb 10, 2016): support for subtitle extraction(ttml) will be added in the next version.
Author
Owner

@AndnixSH commented on GitHub (Jan 29, 2019):

When will it be possible to download subtitle from dplay.dk?

I want to watch video in MPV+SVP4 with placed youtube-dl.exe from rg3.github.io (since the pre-built youtube-dl by SVP4 did not work correctly with dplay) to watch 30fps videos in 60fps

@AndnixSH commented on GitHub (Jan 29, 2019): When will it be possible to download subtitle from dplay.dk? I want to watch video in MPV+SVP4 with placed youtube-dl.exe from rg3.github.io (since the pre-built youtube-dl by SVP4 did not work correctly with dplay) to watch 30fps videos in 60fps
Author
Owner

@ngdio commented on GitHub (Feb 14, 2019):

@AndnixSH you should open a seperate issue for that

@ngdio commented on GitHub (Feb 14, 2019): @AndnixSH you should open a seperate issue for that
Author
Owner

@ghost commented on GitHub (Dec 3, 2019):

I might have same issue with dplay.dk that subs could not be found
This is 4 years old issue. When is it going to be fixed?

@ghost commented on GitHub (Dec 3, 2019): I might have same issue with dplay.dk that subs could not be found This is 4 years old issue. When is it going to be fixed?
Author
Owner

@ghost commented on GitHub (Feb 16, 2020):

Anyone?

@ghost commented on GitHub (Feb 16, 2020): Anyone?
Author
Owner

@xybydy commented on GitHub (Mar 27, 2021):

wow 5 years and it's still open

@xybydy commented on GitHub (Mar 27, 2021): wow 5 years and it's still open
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#5029
No description provided.