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

Youtube subtitles fail to convert to .srt, results in empty file. #15896

Closed
5 of 9 tasks
stephen304 opened this issue Mar 17, 2018 · 12 comments
Closed
5 of 9 tasks

Youtube subtitles fail to convert to .srt, results in empty file. #15896

stephen304 opened this issue Mar 17, 2018 · 12 comments
Labels

Comments

@stephen304
Copy link

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.03.14. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2018.03.14

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

stephen@Jupiter ~/Documents/Archive/YouTube (git)-[master] % youtube-dl --config-location youtube-dl.conf
[debug] System config: []                                                                 
[debug] User config: []
[debug] Custom config: ['-i', '-o', '%(uploader)s (%(uploader_id)s)/%(upload_date)s - %(title)s - (%(duration)ss) [%(resolution)s].%(ext)s', '--download-archive', 'archive.txt', '-a', 'channels.txt', '--recode-video', 'mkv', '--postprocessor-args', '-c copy', '--write-sub', '--all-subs', '--convert-subs', 'srt', '-v']
[debug] Command-line args: ['--config-location', 'youtube-dl.conf']
[debug] Batch file urls: ['https://www.youtube.com/channel/UCuCkxoKLYO_EQ2GeFtbM_bw']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.03.14
[debug] Python version 3.6.4 (CPython) - Linux-4.15.8-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 3.4.2, ffprobe 3.4.2, rtmpdump 2.4
[debug] Proxy map: {}
[youtube:channel] UCuCkxoKLYO_EQ2GeFtbM_bw: Downloading channel page
[youtube:playlist] UUuCkxoKLYO_EQ2GeFtbM_bw: Downloading webpage
[download] Downloading playlist: Uploads from Half as Interesting
[youtube:playlist] playlist Uploads from Half as Interesting: Downloading 29 videos
[download] Downloading video 1 of 29
[youtube] _UjAxuSuLIc: Downloading webpage
[youtube] _UjAxuSuLIc: Downloading video info webpage
[youtube] _UjAxuSuLIc: Extracting video information
[debug] Default format spec: bestvideo+bestaudio/best
[info] Writing video subtitles to: Half as Interesting (UCuCkxoKLYO_EQ2GeFtbM_bw)/20180315 - How 29,000 Lost Rubber Ducks Helped Map the World's Oceans - (300s) [1920x1080].en.vtt
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[debug] Invoking downloader on 'https://r3---sn-ab5l6n67.googlevideo.com/videoplayback?aitags=133%2C134%2C135%2C136%2C137%2C160%2C242%2C243%2C244%2C247%2C248%2C278&c=WEB&id=o-AF5J5YXwqxWJS7M0GKDHrKJ5pAiEiHNY9U8jWZLz_A7F&fvip=3&requiressl=yes&ip=50.236.201.198&signature=C7D9F9C0CA6888908950766B4523CC512B554201.631DD7C1DC71E796485DFBCE89EA8E02CF88DC4A&gir=yes&dur=299.874&source=youtube&lmt=1521129756013136&key=yt6&expire=1521329505&clen=55549456&ipbits=0&pl=24&mime=video%2Fmp4&mv=u&mt=1521307345&ms=au%2Conr&itag=137&ei=AFGtWtuPOc-38wSO5KSAAw&pcm2=no&sparams=aitags%2Cclen%2Cdur%2Cei%2Cgir%2Cid%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpcm2%2Cpl%2Crequiressl%2Csource%2Cexpire&keepalive=yes&mn=sn-ab5l6n67%2Csn-p5qlsndd&mm=31%2C26&ratebypass=yes'
[download] Destination: Half as Interesting (UCuCkxoKLYO_EQ2GeFtbM_bw)/20180315 - How 29,000 Lost Rubber Ducks Helped Map the World's Oceans - (300s) [1920x1080].f137.mp4
[download] 100% of 52.98MiB in 00:02
[debug] Invoking downloader on 'https://r3---sn-ab5l6n67.googlevideo.com/videoplayback?c=WEB&id=o-AF5J5YXwqxWJS7M0GKDHrKJ5pAiEiHNY9U8jWZLz_A7F&fvip=3&requiressl=yes&ip=50.236.201.198&signature=DA2C3EC663FB8EF135DADE7FF10603FEDFE14831.68E0A680B9AD9F067CFA1CEF796AA9767FEAA82B&gir=yes&dur=299.901&source=youtube&lmt=1521130401323841&key=yt6&expire=1521329505&clen=5531695&ipbits=0&pl=24&mime=audio%2Fwebm&mv=u&mt=1521307345&ms=au%2Conr&itag=251&ei=AFGtWtuPOc-38wSO5KSAAw&pcm2=no&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpcm2%2Cpl%2Crequiressl%2Csource%2Cexpire&keepalive=yes&mn=sn-ab5l6n67%2Csn-p5qlsndd&mm=31%2C26&ratebypass=yes'
[download] Destination: Half as Interesting (UCuCkxoKLYO_EQ2GeFtbM_bw)/20180315 - How 29,000 Lost Rubber Ducks Helped Map the World's Oceans - (300s) [1920x1080].f251.webm
[download] 100% of 5.28MiB in 00:00
[ffmpeg] Merging formats into "Half as Interesting (UCuCkxoKLYO_EQ2GeFtbM_bw)/20180315 - How 29,000 Lost Rubber Ducks Helped Map the World's Oceans - (300s) [1920x1080].mkv"
[debug] ffmpeg command line: ffmpeg -y -i 'file:Half as Interesting (UCuCkxoKLYO_EQ2GeFtbM_bw)/20180315 - How 29,000 Lost Rubber Ducks Helped Map the World'"'"'s Oceans - (300s) [1920x1080].f137.mp4' -i 'file:Half as Interesting (UCuCkxoKLYO_EQ2GeFtbM_bw)/20180315 - How 29,000 Lost Rubber Ducks Helped Map the World'"'"'s Oceans - (300s) [1920x1080].f251.webm' -c copy -map 0:v:0 -map 1:a:0 -c copy 'file:Half as Interesting (UCuCkxoKLYO_EQ2GeFtbM_bw)/20180315 - How 29,000 Lost Rubber Ducks Helped Map the World'"'"'s Oceans - (300s) [1920x1080].temp.mkv'
Deleting original file Half as Interesting (UCuCkxoKLYO_EQ2GeFtbM_bw)/20180315 - How 29,000 Lost Rubber Ducks Helped Map the World's Oceans - (300s) [1920x1080].f137.mp4 (pass -k to keep)
Deleting original file Half as Interesting (UCuCkxoKLYO_EQ2GeFtbM_bw)/20180315 - How 29,000 Lost Rubber Ducks Helped Map the World's Oceans - (300s) [1920x1080].f251.webm (pass -k to keep)
[ffmpeg] Not converting video file Half as Interesting (UCuCkxoKLYO_EQ2GeFtbM_bw)/20180315 - How 29,000 Lost Rubber Ducks Helped Map the World's Oceans - (300s) [1920x1080].mkv - already is in target format mkv
[ffmpeg] Converting subtitles
[debug] ffmpeg command line: ffmpeg -y -i 'file:Half as Interesting (UCuCkxoKLYO_EQ2GeFtbM_bw)/20180315 - How 29,000 Lost Rubber Ducks Helped Map the World'"'"'s Oceans - (300s) [1920x1080].en.vtt' -f srt -c copy 'file:Half as Interesting (UCuCkxoKLYO_EQ2GeFtbM_bw)/20180315 - How 29,000 Lost Rubber Ducks Helped Map the World'"'"'s Oceans - (300s) [1920x1080].en.srt'
ERROR:     Last message repeated 1 times
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 2035, in post_process
    files_to_delete, info = pp.run(info)
  File "/usr/lib/python3.6/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 605, in run
    self.run_ffmpeg(old_file, new_file, ['-f', new_format])
  File "/usr/lib/python3.6/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 208, in run_ffmpeg
    self.run_ffmpeg_multiple_files([path], out_path, opts)
  File "/usr/lib/python3.6/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 204, in run_ffmpeg_multiple_files
    raise FFmpegPostProcessorError(msg)
youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError:     Last message repeated 1 times

[download] Downloading video 2 of 29
[youtube] f5Y3cf3MFIw: Downloading webpage
[youtube] f5Y3cf3MFIw: Downloading video info webpage
[youtube] f5Y3cf3MFIw: Extracting video information
[debug] Default format spec: bestvideo+bestaudio/best
[info] Writing video subtitles to: Half as Interesting (UCuCkxoKLYO_EQ2GeFtbM_bw)/20180308 - Why It's Illegal to be Named Brfxxccxxmnpcccclllmmnprxvclmnckssqlbb11116 - (293s) [1920x1080].en.vtt
^C
ERROR: Interrupted by user

...
<end of log>

Description of your issue, suggested solution and other information

I am attempting to archive youtube channels with best quality to .mkv with all subtitles embedded as srt, but the subtitles fail to convert to srt prior to embedding. The log above is only different from my actual config in that I commented out --embed-subs so that it would keep the files for inspection. The .vtt downloaded looks perfectly fine (top of file below), but the .srt in the downloaded folder is a completely empty file.

WEBVTT
Kind: captions
Language: en

00:00:00.620 --> 00:00:02.960
This video was made possible by Skillshare.

00:00:02.960 --> 00:00:08.980
By being one of the first 1,000 people to
sign up at skl.sh/hai8, you will get 2 months

00:00:08.980 --> 00:00:12.060
of Skillshare for 99 cents.

00:00:12.060 --> 00:00:17.660
In January 1992, the Evergreen Ever Laurel
set sail from the United Kingdom and headed

00:00:17.660 --> 00:00:18.700
due east.
stephen@Jupiter ..Interesting (UCuCkxoKLYO_EQ2GeFtbM_bw) (git)-[master] % file 20180315\ -\ How\ 29,000\ Lost\ Rubber\ Ducks\ Helped\ Map\ the\ World\'s\ Oceans\ -\ \(300s\)\ \[1920x1080\].en.srt           
20180315 - How 29,000 Lost Rubber Ducks Helped Map the World's Oceans - (300s) [1920x1080].en.srt: empty

My config file is as follows: (perhaps I have conflicting options that cause issues? I'm unsure...)

-i
-o "%(uploader)s (%(uploader_id)s)/%(upload_date)s - %(title)s - (%(duration)ss) [%(resolution)s].%(ext)s"

# Archive Settings
--download-archive archive.txt
-a channels.txt

# Uniform Format
#--prefer-ffmpeg
--recode-video mkv
# Don't reencode video / waste cpu
--postprocessor-args "-c copy"

# Get All Subs to SRT
--write-sub
--all-subs
--convert-subs srt
#--embed-subs

# Debug
-v
@dstftw
Copy link
Collaborator

dstftw commented Mar 17, 2018

Remove --postprocessor-args "-c copy".

@dstftw dstftw closed this as completed Mar 17, 2018
@dstftw dstftw added the invalid label Mar 17, 2018
@stephen304
Copy link
Author

@dstftw If I remove that, then it re-encodes the video unnecessarily instead of just remuxing. Is there another way to have it not re-encode the video?

@dstftw
Copy link
Collaborator

dstftw commented Mar 17, 2018

Not using --recode-video obviously.

@stephen304
Copy link
Author

Then how do I get it remuxed into mkv? I'm very confused...

@dstftw
Copy link
Collaborator

dstftw commented Mar 17, 2018

--merge-output-format for separate media.

@stephen304
Copy link
Author

That only takes effect if a merge is required. I need all of the media to be remuxed to mkv even if there is no merge. That's why I was using recode-video.

@dstftw
Copy link
Collaborator

dstftw commented Mar 17, 2018

No way to do that for a single file media.

@stephen304
Copy link
Author

stephen304 commented Mar 17, 2018

Can I open a feature request to add that feature? I want to archive large amounts of youtube for historical purposes, but my OCD won't let me start unless I can be sure it will all be uniform.

@dstftw
Copy link
Collaborator

dstftw commented Mar 17, 2018

There is already such feature request.

@stephen304
Copy link
Author

Would you mind sharing a link to it? I'm not sure which issue you are referencing.

@dstftw
Copy link
Collaborator

dstftw commented Mar 17, 2018

#6996, #14744.

@stephen304
Copy link
Author

Thanks! You've been very helpful!

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

No branches or pull requests

2 participants