Um problema de mesclar o subtítulo vtt com o vídeo usando o youtube-dl

2

Estou tentando

youtube-dl https://www.youtube.com/watch?v=0QRO3gKj3qw  --write-sub --convert-subtitles srt -v

o resultado é negativo

    [debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'https://www.youtube.com/watch?v=0QRO3gKj3qw', 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'https://r2---sn-hpa7zned.googlevideo.com/videoplayback?id=d1044ede02a3deac&itag=136&source=youtube&requiressl=yes&mv=m&ms=au&pl=19&mn=sn-hpa7zned&mm=31&initcwndbps=58750&nh=IgpwcjAxLm1pbDAyKgkxMjcuMC4wLjE&ratebypass=yes&mime=video/mp4&gir=yes&clen=10330102&lmt=1457610153524637&dur=200.916&mt=1472162919&sver=3&key=dg_yt0&signature=871A09D44DD94771EDE6E5D76843EE652268357E.5CE50080607644DD88125B0841D21F95B4C2BA01&upn=XhAQxU6qSMo&ip=41.200.192.33&ipbits=0&expire=1472185159&sparams=ip,ipbits,expire,id,itag,source,requiressl,mv,ms,pl,mn,mm,initcwndbps,nh,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: What is Google Chrome OS-0QRO3gKj3qw.f136.mp4
[download] 100% of 9.85MiB in 00:49
[debug] Invoking downloader on u'https://r2---sn-hpa7zned.googlevideo.com/videoplayback?id=d1044ede02a3deac&itag=140&source=youtube&requiressl=yes&mv=m&ms=au&pl=19&mn=sn-hpa7zned&mm=31&initcwndbps=58750&nh=IgpwcjAxLm1pbDAyKgkxMjcuMC4wLjE&ratebypass=yes&mime=audio/mp4&gir=yes&clen=3194068&lmt=1457610143781263&dur=201.061&mt=1472162919&sver=3&key=dg_yt0&signature=0DD64B9C971E69D61C6D7DD01C8884412CC05A0E.66C91FC66FAC5ECAC65901F4C3C7B60A2E5A6167&upn=XhAQxU6qSMo&ip=41.200.192.33&ipbits=0&expire=1472185159&sparams=ip,ipbits,expire,id,itag,source,requiressl,mv,ms,pl,mn,mm,initcwndbps,nh,ratebypass,mime,gir,clen,lmt,dur'
[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
    
por ibrahim dz 26.08.2016 / 00:35

1 resposta

0

1. O problema:

O problema pode ser visto na sua depuração. Você tem o último youtube-dl :

[debug] youtube-dl version 2016.08.24.1

que é ótimo, mas o seu log degug mostra que você tem ambos avconv e ffmpeg instalados:

[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 que, se ambos estiverem instalados, avconv será usado como padrão :

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

2. A solução:

O teste no meu próprio sistema indica que, se você usar ffmpeg em vez de avconv , o download e a conversão funcionarão perfeitamente, então você tem duas opções para uma solução:

  1. Adicione --prefer-ffmpeg à sua linha de comando para um comando único
  2. Adicione --prefer-ffmpeg ao arquivo ~/.config/youtube-dl.conf para um resultado mais permanente. Você pode ter que criar este arquivo inicialmente executando o comando: touch ~/.config/youtube-dl.conf

Funciona muito bem no meu sistema ...

    
por andrew.46 30.08.2016 / 11:59