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

How do I stop youtube's auto captions showing tags in the dowloaded version? #22350

Closed
jmitz5 opened this issue Sep 10, 2019 · 1 comment
Closed

Comments

@jmitz5
Copy link

@jmitz5 jmitz5 commented Sep 10, 2019

Checklist

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

When I try to embed youtube's auto-captions into my downloads, the formatting of the subtitles shows in vlc. They show up as HTML tags (I tried to write an example, but it isn't visible ater I post the comment).

Some encode the time, some encode other things. These tags take up most of the subtitles and make them impossible to read them. What's even weirder is that if I don't embed the subtitles (and let vlc load them externally) they work absolutely fine.

Is there anything I can do to reformat the subtitles before they are embedded?

PS: I found a solution that works occasionally; Using the tag:

--convert-subs srt

After being converted and embedded, the subtitles play fine. The problem is that this only works when youtube-dl decides to give the videos a .mkv extension instead of a .webm extension (since webm only takes Webvtt subtitles). Most of the time youtube-dl uses webm. Since the subtitles already started in a Webvtt format, I can't then convert them back again from srt (as far as I know). I also tried to force all videos to download as mkv's, but youtube-dl just makes it a .mkv.webm.

PPS: The reason I care is I want to have one config file that will work for both captioned videos and auto-captioned videos. If anyone knows of a way of doing conditional configuration options (like automatically embedding captions when the video has them, but leaving auto-captions unembedded when they are the only option) that would be great too.

@jmitz5 jmitz5 added the question label Sep 10, 2019
@dstftw dstftw closed this Sep 10, 2019
@dstftw dstftw added the incomplete label Sep 10, 2019
@Geremia
Copy link

@Geremia Geremia commented Jun 2, 2020

@dstftw I get this issue, too, but I'm not sure if this is a VLC bug or a youtube-dl conversion issue with the *.vtt subtitle format.

For example,

[debug] Command-line args: ['--no-warnings', '-if', 'bestvideo[height<=480]+bestaudio/best[height<=480]', '--write-sub', '--write-auto-sub', '--embed-subs', '--sub-lang', 'en', '--verbose', 'https://www.youtube.com/watch?v=Q1A5gzu2aX8']

produces a video whose subtitles appear in VLC as:
bad subtitles in VLC
--convert-subs srt does fix this video's subtitle issue, though.

But completely normally for this video:

[debug] Command-line args: ['--no-warnings', '-if', 'bestvideo[height<=480]+bestaudio/best[height<=480]', '--write-sub', '--write-auto-sub', '--embed-subs', '--sub-lang', 'en', '--verbose', 'https://www.youtube.com/watch?v=zcwRx5kuvbY']

working subtitles in VLC

Both these videos only have automatic captions.

I'm using
VLC media player 3.0.10 Vetinari (revision 3.0.10-0-g7f145afa84)
youtube-dl 2020.05.08

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.

None yet
3 participants
You can’t perform that action at this time.