Closed jmitz5 closed 5 years ago
@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:
--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']
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
Checklist
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.