Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for HLS WebVTT subtitles #6106

Open
yadayada opened this issue Jun 27, 2015 · 9 comments
Open

Add support for HLS WebVTT subtitles #6106

yadayada opened this issue Jun 27, 2015 · 9 comments
Labels

Comments

@yadayada
Copy link

@yadayada yadayada commented 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.

@yadayada
Copy link
Author

@yadayada yadayada commented 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

@dstftw dstftw added the subtitles label Jun 27, 2015
@fstirlitz
Copy link
Contributor

@fstirlitz fstirlitz commented 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…

@remitamine
Copy link
Collaborator

@remitamine remitamine commented 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
Copy link
Collaborator

@remitamine remitamine commented 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
Copy link
Collaborator

@remitamine remitamine commented Feb 11, 2016

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

@remitamine remitamine closed this Feb 11, 2016
remitamine added a commit that referenced this issue Mar 30, 2016
previously extraction has been delegated to crackle to extract more info
and subtitles #6106 but some of the episodes can't be extracted using
crackle #8995.
@remitamine remitamine reopened this Mar 30, 2016
@dstftw dstftw changed the title ComCarCoff subtitle support Add support for HLS WebVTT subtitles Jan 27, 2018
@ytdl-org ytdl-org deleted a comment from Sopor Feb 10, 2018
@Nekmo Nekmo mentioned this issue Jun 6, 2018
5 of 5 tasks complete
@AndnixSH
Copy link

@AndnixSH AndnixSH commented 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

@ngdio
Copy link

@ngdio ngdio commented Feb 14, 2019

@AndnixSH you should open a seperate issue for that

@remitamine remitamine mentioned this issue Nov 7, 2019
5 of 5 tasks complete
@ghost ghost mentioned this issue Dec 3, 2019
5 of 9 tasks complete
@ghost
Copy link

@ghost ghost commented 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
Copy link

@ghost ghost commented Feb 16, 2020

Anyone?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

6 participants
You can’t perform that action at this time.