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

Merge fails after downloading a YT video (libavformat) #6997

Closed
davidpfahler opened this issue Sep 27, 2015 · 4 comments
Closed

Merge fails after downloading a YT video (libavformat) #6997

davidpfahler opened this issue Sep 27, 2015 · 4 comments

Comments

@davidpfahler
Copy link

@davidpfahler davidpfahler commented Sep 27, 2015

Hi and thanks for this great OS Software. Some time ago, youtube-dl started printing an error after downloading simple youtube videos. Here is my console in- and output:

$ youtube-dl https://www.youtube.com/watch?v=bV9L5Ht9LgY
[youtube] bV9L5Ht9LgY: Downloading webpage
[youtube] bV9L5Ht9LgY: Downloading video info webpage
[youtube] bV9L5Ht9LgY: Extracting video information
[youtube] bV9L5Ht9LgY: Downloading DASH manifest
[youtube] bV9L5Ht9LgY: Downloading DASH manifest
[download] Destination: Download Youtube Playlist with Youtube-dl-bV9L5Ht9LgY.f137.mp4
[download] 100% of 40.25MiB in 00:09
[download] Destination: Download Youtube Playlist with Youtube-dl-bV9L5Ht9LgY.f141.m4a
[download] 100% of 10.37MiB in 00:02
[ffmpeg] Merging formats into "Download Youtube Playlist with Youtube-dl-bV9L5Ht9LgY.mp4"
ERROR:   Expected in: /usr/local/lib/libavformat.dylib

Please note that the mp4 and m4a file at the is working fine. I don't even know why it wants to merge the format, or why it converts to audio for that matter.

The output is the same if I sudo the command. This might also help:

$ ls -l /usr/local/lib/libavformat.dylib 
lrwxr-xr-x  1 djpfahler  admin  42 Sep 21 19:46 /usr/local/lib/libavformat.dylib -> ../Cellar/ffmpeg/2.8/lib/libavformat.dylib

$ ls -l /usr/local/Cellar/ffmpeg/2.8/lib/libavformat.dylib 
lrwxr-xr-x  1 djpfahler  admin  27 Sep 21 19:46 /usr/local/Cellar/ffmpeg/2.8/lib/libavformat.dylib -> libavformat.56.40.101.dylib

$ ls -l /usr/local/Cellar/ffmpeg/2.8/lib/libavformat.56.40.101.dylib
-rwxrwxr-x  1 djpfahler  admin  1610556 Sep 21 19:46 /usr/local/Cellar/ffmpeg/2.8/lib/libavformat.56.40.101.dylib

Thanks.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Sep 27, 2015

Run youtube-dl https://www.youtube.com/watch?v=bV9L5Ht9LgY --verbose and post its output, then run the command printed in the line ffmpeg command line: (should be something like ffmpeg -y -i 'file:Download Youtube Playlist with Youtube-dl-bV9L5Ht9LgY.f137.mp4' -i 'file:Download Youtube Playlist with Youtube-dl-bV9L5Ht9LgY.f141.m4a' -c copy -map 0:v:0 -map 1:a:0 'file:Download Youtube Playlist with Youtube-dl-bV9L5Ht9LgY.temp.mp4') from the same directory and post its output.

Please note that the mp4 and m4a file at the is working fine. I don't even know why it wants to merge the format, or why it converts to audio for that matter.

It's required because YouTube only provides the high quality version splitted in two separate files (audio and video) and youtube-dl has to download them and merge them to a single file with ffmpeg/avconv.

@davidpfahler
Copy link
Author

@davidpfahler davidpfahler commented Sep 29, 2015

Thanks!

So the codecs h264 and aac are not on whitelist. I don't know how to fix this. I installed ffmpeg via brew with (almost?) all the --with flags. I would very much appreciate any help.

$ ffmpeg --help
ffmpeg version 2.8 Copyright (c) 2000-2015 the FFmpeg developers
  built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Hyper fast Audio and Video encoder
$ youtube-dl https://www.youtube.com/watch?v=tPEE9ZwTmy0 --verbose
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'https://www.youtube.com/watch?v=tPEE9ZwTmy0', u'--verbose']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.09.22
[debug] Python version 2.7.10 - Darwin-14.5.0-x86_64-i386-64bit
[debug] exe versions: avconv N-35603-ga1c676c, ffmpeg 2.8, ffprobe 2.8, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] tPEE9ZwTmy0: Downloading webpage
[youtube] tPEE9ZwTmy0: Downloading video info webpage
[youtube] tPEE9ZwTmy0: Extracting video information
[youtube] tPEE9ZwTmy0: Downloading DASH manifest
[youtube] tPEE9ZwTmy0: Downloading DASH manifest
[debug] Invoking downloader on 'https://r6---sn-a0jpm-a0ml.googlevideo.com/videoplayback?id=b4f104f59c139b2d&itag=135&source=youtube&requiressl=yes&pl=24&mm=31&mn=sn-a0jpm-a0ml&ms=au&mv=u&ratebypass=yes&mime=video/mp4&gir=yes&clen=90546&lmt=1411010340810744&dur=0.900&signature=7FDEE0F039A7CDF1D513A426789DDB9D992EE881.65D2653C93C963DFBE7E7D6AD225428B840EAE36&mt=1443530242&upn=o5Em1HCn3Ok&key=dg_yt0&sver=3&fexp=9406175,9408710,9409069,9412514,9412773,9415365,9415485,9416023,9416126,9416575,9416729,9417368,9417707,9418153,9418394,9418448,9418777,9418997,9419445,9420348,9420993,9421013,9421133,9421544&ip=94.242.213.176&ipbits=0&expire=1443552102&sparams=ip,ipbits,expire,id,itag,source,requiressl,pl,mm,mn,ms,mv,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: Shortest Video on Youtube-tPEE9ZwTmy0.f135.mp4
[download] 100% of 88.42KiB in 00:04
[debug] Invoking downloader on 'https://r6---sn-a0jpm-a0ml.googlevideo.com/videoplayback?id=b4f104f59c139b2d&itag=141&source=youtube&requiressl=yes&pl=24&mm=31&mn=sn-a0jpm-a0ml&ms=au&mv=u&ratebypass=yes&mime=audio/mp4&gir=yes&clen=32557&lmt=1411010335827378&dur=0.998&signature=28220A324256C0D70D72AE4E1BA1C96FC3CEF901.175DA8DDF9CAE51C2CB86112AFB3A0256020CBBF&mt=1443530242&upn=o5Em1HCn3Ok&key=dg_yt0&sver=3&fexp=9406175,9408710,9409069,9412514,9412773,9415365,9415485,9416023,9416126,9416575,9416729,9417368,9417707,9418153,9418394,9418448,9418777,9418997,9419445,9420348,9420993,9421013,9421133,9421544&ip=94.242.213.176&ipbits=0&expire=1443552102&sparams=ip,ipbits,expire,id,itag,source,requiressl,pl,mm,mn,ms,mv,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: Shortest Video on Youtube-tPEE9ZwTmy0.f141.m4a
[download] 100% of 31.79KiB in 00:00
[ffmpeg] Merging formats into "Shortest Video on Youtube-tPEE9ZwTmy0.mp4"
[debug] ffmpeg command line: avconv -y -i 'file:Shortest Video on Youtube-tPEE9ZwTmy0.f135.mp4' -i 'file:Shortest Video on Youtube-tPEE9ZwTmy0.f141.m4a' -c copy -map 0:v:0 -map 1:a:0 'file:Shortest Video on Youtube-tPEE9ZwTmy0.temp.mp4'
ERROR:   Expected in: /usr/local/lib/libavformat.dylib
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1704, in post_process
    files_to_delete, info = pp.run(info)
  File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 406, in run
    self.run_ffmpeg_multiple_files(info['__files_to_merge'], temp_filename, args)
  File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 154, in run_ffmpeg_multiple_files
    raise FFmpegPostProcessorError(msg)
FFmpegPostProcessorError
avconv -y -i 'file:Shortest Video on Youtube-tPEE9ZwTmy0.f135.mp4' -i 'file:Shortest Video on Youtube-tPEE9ZwTmy0.f141.m4a' -c copy -map 0:v:0 -map 1:a:0 'file:Shortest Video on Youtube-tPEE9ZwTmy0.temp.mp4'
avconv version N-35603-ga1c676c, Copyright (c) 2000-2011 the FFmpeg developers
  built on Dec  9 2011 16:18:43 with llvm_gcc 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
  configuration: --enable-libmp3lame --enable-shared --disable-mmx --arch=x86_64
  WARNING: library configuration mismatch
  avutil      configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
  avcodec     configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
  avformat    configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
  avdevice    configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
  avfilter    configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
  swscale     configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
  libavutil    51. 31. 0 / 54. 31.100
  libavcodec   53. 42. 0 / 56. 60.100
  libavformat  53. 24. 0 / 56. 40.101
  libavdevice  53.  4. 0 / 56.  4.100
  libavfilter   2. 52. 0 /  5. 40.101
  libswscale    2.  1. 0 /  3.  1.101
[NULL @ 0x7fd1ba803c00] Codec (h264) not on whitelist
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fd1ba00da00] Failed to open codec in av_find_stream_info
[NULL @ 0x7fd1ba803c00] Codec (h264) not on whitelist
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:Shortest Video on Youtube-tPEE9ZwTmy0.f135.mp4':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6avc1mp41
    creation_time   : 2014-09-18 03:18:59
  Duration: 00:00:00.90, start: 0.000000, bitrate: 804 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), none, 854x470, 793 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc (default)
    Metadata:
      creation_time   : 2014-09-18 03:18:59
      handler_name    : VideoHandler
[NULL @ 0x7fd1ba83bc00] Codec (aac) not on whitelist
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fd1ba833600] Failed to open codec in av_find_stream_info
[NULL @ 0x7fd1ba83bc00] Codec (aac) not on whitelist
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'file:Shortest Video on Youtube-tPEE9ZwTmy0.f141.m4a':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6mp41
    creation_time   : 2014-09-18 03:18:55
  Duration: 00:00:01.00, start: 0.000000, bitrate: 260 kb/s
    Stream #1:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, 2 channels, 253 kb/s (default)
    Metadata:
      creation_time   : 2014-09-18 03:18:55
      handler_name    : SoundHandler
Stream map '0:v:0' matches no streams.
dyld: lazy symbol binding failed: Symbol not found: _av_close_input_file
  Referenced from: /usr/local/bin/avconv
  Expected in: /usr/local/lib/libavformat.dylib

dyld: Symbol not found: _av_close_input_file
  Referenced from: /usr/local/bin/avconv
  Expected in: /usr/local/lib/libavformat.dylib

Trace/BPT trap: 5

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Sep 29, 2015

You probably need to rebuild/reinstall libav. If you prefer to use you have to use the --prefer-ffmpeg option or remove libav (brew rm libav) if you don't need it for anything else.

@davidpfahler
Copy link
Author

@davidpfahler davidpfahler commented Oct 22, 2015

@jaimeMF Thank you! --prefer-ffmpeg did the trick.

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
2 participants
You can’t perform that action at this time.