A problem merge subtitle vtt with video using youtube-dl

I am trying

youtube-dl --write-sub --convert-subtitles srt -v

the result is negative

 [debug] System config: []
[debug] User config: []
[debug] Command-line args: [u' u'--write-sub', u'--convert-subtitles', u'srt', u'-v']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.08.24.1
[debug] Python version 2.7.12 - Linux-4.4.0-36-generic-x86_64-with-Ubuntu-16.04-xenial
[debug] exe versions: avconv v12_dev0-3134-g6755eb5, avprobe v12_dev0-3134-g6755eb5, ffmpeg 3.1.2-1, ffprobe 3.1.2-1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] 0QRO3gKj3qw: Downloading webpage
[youtube] 0QRO3gKj3qw: Downloading video info webpage
[youtube] 0QRO3gKj3qw: Extracting video information
[youtube] 0QRO3gKj3qw: Downloading MPD manifest
[info] Writing video subtitles to: What is Google Chrome OS-0QRO3gKj3qw.en.vtt
[debug] Invoking downloader on u'
[download] Destination: What is Google Chrome OS-0QRO3gKj3qw.f136.mp4
[download] 100% of 9.85MiB in 00:49
[debug] Invoking downloader on u'
[download] Destination: What is Google Chrome OS-0QRO3gKj3qw.f140.m4a
[download] 100% of 3.05MiB in 00:18
[ffmpeg] Merging formats into "What is Google Chrome OS-0QRO3gKj3qw.mp4"
[debug] ffmpeg command line: avconv -y -i 'file:What is Google Chrome OS-0QRO3gKj3qw.f136.mp4' -i 'file:What is Google Chrome OS-0QRO3gKj3qw.f140.m4a' -c copy -map 0:v:0 -map 1:a:0 'file:What is Google Chrome OS-0QRO3gKj3qw.temp.mp4'
Deleting original file What is Google Chrome OS-0QRO3gKj3qw.f136.mp4 (pass -k to keep)
Deleting original file What is Google Chrome OS-0QRO3gKj3qw.f140.m4a (pass -k to keep)
[ffmpeg] Converting subtitles
[debug] ffmpeg command line: avconv -y -i 'file:What is Google Chrome OS-0QRO3gKj3qw.en.vtt' -f srt 'file:What is Google Chrome OS-0QRO3gKj3qw.en.srt'
ERROR: file:What is Google Chrome OS-0QRO3gKj3qw.en.vtt: Invalid data found when processing input
Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1832, in post_process files_to_delete, info = pp.run(info) File "/usr/lib/python2.7/dist-packages/youtube_dl/postprocessor/ffmpeg.py", line 572, in run self.run_ffmpeg(old_file, new_file, ['-f', new_format]) File "/usr/lib/python2.7/dist-packages/youtube_dl/postprocessor/ffmpeg.py", line 172, in run_ffmpeg self.run_ffmpeg_multiple_files([path], out_path, opts) File "/usr/lib/python2.7/dist-packages/youtube_dl/postprocessor/ffmpeg.py", line 168, in run_ffmpeg_multiple_files raise FFmpegPostProcessorError(msg)
FFmpegPostProcessorError
3

1 Answer

1. The Problem:

The problem can be seen in your debug. You have the latest youtube-dl:

[debug] youtube-dl version 2016.08.24.1

which is great but your degug log shows that you have both avconv and ffmpeg installed:

[debug] exe versions: avconv v12_dev0-3134-g6755eb5, avprobe v12_dev0-3134-g6755eb5,
ffmpeg 3.1.2-1, ffprobe 3.1.2-1, rtmpdump 2.4

Note that if both are installed then avconv will be used as default:

--prefer-avconv Prefer avconv over ffmpeg for running the postprocessors (default)
--prefer-ffmpeg Prefer ffmpeg over avconv for running the postprocessors

2. The Solution:

Testing on my own system indicates that if you use ffmpeg rather than avconv your download and conversion works flawlessly, so you have 2 choices for a solution:

  1. Add --prefer-ffmpeg to your command line for a one-off command
  2. Add --prefer-ffmpeg to the file ~/.config/youtube-dl.conf for a more permanent result. You may have to create this file initially by running the command: touch ~/.config/youtube-dl.conf

Works very nicely on my system...

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like