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

Using m4a for audio-extract doesn't work (with ffmpeg) #16672

Closed
NightMachinary opened this issue Jun 7, 2018 · 7 comments
Closed

Using m4a for audio-extract doesn't work (with ffmpeg) #16672

NightMachinary opened this issue Jun 7, 2018 · 7 comments
Labels

Comments

@NightMachinary
Copy link

@NightMachinary NightMachinary commented Jun 7, 2018

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.06.04. 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.06.04

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

Description of your issue, suggested solution and other information

[ffmpeg] Destination: Melanie Martinez - milk and cookies (ONE HOUR LOOP)-3oJxBhD94_s.m4a
ERROR: audio conversion failed: [aac @ 0x682100] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.

On another machine:

y --audio-format m4a -x https://www.youtube.com/watch\?v\=tPEE9ZwTmy0       2 ↵  6502  02:56:13
[youtube] tPEE9ZwTmy0: Downloading webpage
[youtube] tPEE9ZwTmy0: Downloading video info webpage
[download] Destination: Shortest Video on Youtube-tPEE9ZwTmy0.webm
[download] 100% of 17.50KiB in 00:01
[ffmpeg] Destination: Shortest Video on Youtube-tPEE9ZwTmy0.m4a
ERROR: audio conversion failed: Or use the non experimental encoder 'libfaac'.

Perhaps youtube-dl is forgetting to pass '-strict -2' ? Or its position is wrong?

@NightMachinary NightMachinary changed the title Using m4a for audio-extract doesn't work ffmpeg Using m4a for audio-extract doesn't work (with ffmpeg) Jun 7, 2018
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 8, 2018

Most likely outdated ffmpeg.

@dstftw dstftw closed this Jun 8, 2018
@dstftw dstftw added the incomplete label Jun 8, 2018
@NightMachinary
Copy link
Author

@NightMachinary NightMachinary commented Jun 10, 2018

@dstftw

ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-gpl --enable-chromaprint --enable-ffplay --enable-frei0r --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopus --enable-librtmp --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg --enable-libzmq --enable-opencl --enable-videotoolbox --enable-openssl --enable-lzma --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/2.3.0/include/openjpeg-2.3 --enable-nonfree
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
@NightMachinary
Copy link
Author

@NightMachinary NightMachinary commented Jun 10, 2018

@dstftw And converting to m4a works fine outside youtube-dl:

ffmpeg -i Papercut\ \(Official\ Video\)\ -\ Linkin\ Park.mp3 paper.m4a
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-gpl --enable-chromaprint --enable-ffplay --enable-frei0r --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopus --enable-librtmp --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg --enable-libzmq --enable-opencl --enable-videotoolbox --enable-openssl --enable-lzma --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/2.3.0/include/openjpeg-2.3 --enable-nonfree
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Input #0, mp3, from 'Papercut (Official Video) - Linkin Park.mp3':
  Metadata:
    encoder         : Lavf57.7.2
  Duration: 00:03:12.79, start: 0.034042, bitrate: 264 kb/s
    Stream #0:0: Audio: mp3, 48000 Hz, stereo, fltp, 264 kb/s
    Metadata:
      encoder         : Lavc57.25
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (mp3float) -> aac (native))
Press [q] to stop, [?] for help
Output #0, ipod, to 'paper.m4a':
  Metadata:
    encoder         : Lavf58.12.100
    Stream #0:0: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.18.100 aac
size=    3050kB time=00:03:12.76 bitrate= 129.6kbits/s speed=68.7x
video:0kB audio:3014kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.198234%
[aac @ 0x7ff4bc80a400] Qavg: 670.390
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 10, 2018

So what? Post complete verbose log of youtube-dl.

@NightMachinary
Copy link
Author

@NightMachinary NightMachinary commented Jun 11, 2018

@dstftw

y --audio-format m4a -x https://www.youtube.com/watch\?v\=tPEE9ZwTmy0 -v                ✔  6844  01:27:29
[debug] System config: []
[debug] User config: ['--download-archive', '~/.config/youtube-dl/archive']
[debug] Custom config: []
[debug] Command-line args: ['--audio-format', 'm4a', '-x', 'https://www.youtube.com/watch?v=tPEE9ZwTmy0', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.06.11
[debug] Python version 3.6.4 (CPython) - Darwin-17.4.0-x86_64-i386-64bit
[debug] exe versions: avconv 12.3, avprobe 12.3, ffmpeg 4.0, ffprobe 4.0, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] tPEE9ZwTmy0: Downloading webpage
[youtube] tPEE9ZwTmy0: Downloading video info webpage
[debug] Invoking downloader on 'https://r6---sn-vgqs7nes.googlevideo.com/videoplayback?gir=yes&key=yt6&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&expire=1528772255&mv=m&source=youtube&c=WEB&ms=au%2Conr&keepalive=yes&ei=P-IeW4uaAoq8D9CdmvgE&lmt=1518538389740758&ip=198.143.181.104&pl=20&dur=0.943&mn=sn-vgqs7nes%2Csn-tt1e7n7e&mm=31%2C26&id=o-AAApDJ0SQR_2FqMq_Svs0jKo1yot53Itnpaw2KhD5m-_&signature=DFDC9B923572896FE8F14EF2E2461B4727D4469F.2640AC0C41EFEF61705CC06D2965D9BC8E5D4DD8&mt=1528750512&requiressl=yes&clen=17915&fvip=6&itag=171&initcwndbps=6178750&mime=audio%2Fwebm&ipbits=0&ratebypass=yes'
[download] Destination: Shortest Video on Youtube-tPEE9ZwTmy0.webm
[download] 100% of 17.50KiB in 00:01
[debug] avconv command line: avprobe -show_streams 'file:Shortest Video on Youtube-tPEE9ZwTmy0.webm'
[ffmpeg] Destination: Shortest Video on Youtube-tPEE9ZwTmy0.m4a
[debug] ffmpeg command line: avconv -y -i 'file:Shortest Video on Youtube-tPEE9ZwTmy0.webm' -vn -acodec aac -q:a 5 -bsf:a aac_adtstoasc 'file:Shortest Video on Youtube-tPEE9ZwTmy0.m4a'
ERROR: audio conversion failed: Or use the non experimental encoder 'libfaac'.
Traceback (most recent call last):
  File "/Users/evar/anaconda/lib/python3.6/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 234, in run_ffmpeg
    FFmpegPostProcessor.run_ffmpeg(self, path, out_path, opts)
  File "/Users/evar/anaconda/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 "/Users/evar/anaconda/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: Or use the non experimental encoder 'libfaac'.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/evar/anaconda/lib/python3.6/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 305, in run
    self.run_ffmpeg(path, new_path, acodec, more_opts)
  File "/Users/evar/anaconda/lib/python3.6/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 236, in run_ffmpeg
    raise AudioConversionError(err.msg)
youtube_dl.postprocessor.common.AudioConversionError: Or use the non experimental encoder 'libfaac'.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/evar/anaconda/lib/python3.6/site-packages/youtube_dl/YoutubeDL.py", line 2047, in post_process
    files_to_delete, info = pp.run(info)
  File "/Users/evar/anaconda/lib/python3.6/site-packages/youtube_dl/postprocessor/ffmpeg.py", line 308, in run
    'audio conversion failed: ' + e.msg)
youtube_dl.utils.PostProcessingError: audio conversion failed: Or use the non experimental encoder 'libfaac'.
 y --audio-format m4a -x https://www.youtube.com/watch\?v\=tPEE9ZwTmy0 -v --prefer-ffmpeg
[debug] System config: []
[debug] User config: ['--download-archive', '~/.config/youtube-dl/archive']
[debug] Custom config: []
[debug] Command-line args: ['--audio-format', 'm4a', '-x', 'https://www.youtube.com/watch?v=tPEE9ZwTmy0', '-v', '--prefer-ffmpeg']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.06.11
[debug] Python version 3.6.4 (CPython) - Darwin-17.4.0-x86_64-i386-64bit
[debug] exe versions: avconv 12.3, avprobe 12.3, ffmpeg 4.0, ffprobe 4.0, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] tPEE9ZwTmy0: Downloading webpage
[youtube] tPEE9ZwTmy0: Downloading video info webpage
[debug] Invoking downloader on 'https://r6---sn-vgqs7nes.googlevideo.com/videoplayback?mime=audio%2Fwebm&ipbits=0&initcwndbps=6178750&expire=1528772296&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&gir=yes&c=WEB&key=yt6&mn=sn-vgqs7nes%2Csn-tt1e7n7e&mm=31%2C26&ms=au%2Conr&ei=aOIeW9WxHMTADeTwv6AK&mv=m&pl=20&mt=1528750593&clen=17915&signature=3AF3855CF7332467D430B28CF994ABB612B97E1A.64D7149A88DEF6803B2D78DE9D94671F6519A3E5&keepalive=yes&ip=198.143.181.104&requiressl=yes&itag=171&lmt=1518538389740758&fvip=6&id=o-AGJ4O1U43ijlfofBAhwNt7lybLqpqvSo1-XAZCF3QHQT&dur=0.943&source=youtube&ratebypass=yes'
[download] Shortest Video on Youtube-tPEE9ZwTmy0.webm has already been downloaded
[download] 100% of 17.50KiB
[debug] ffmpeg command line: ffprobe -show_streams 'file:Shortest Video on Youtube-tPEE9ZwTmy0.webm'
[ffmpeg] Destination: Shortest Video on Youtube-tPEE9ZwTmy0.m4a
[debug] ffmpeg command line: ffmpeg -y -i 'file:Shortest Video on Youtube-tPEE9ZwTmy0.webm' -vn -acodec aac -q:a 5 -bsf:a aac_adtstoasc 'file:Shortest Video on Youtube-tPEE9ZwTmy0.m4a'
Deleting original file Shortest Video on Youtube-tPEE9ZwTmy0.webm (pass -k to keep)

Adding --perfer-ffmpeg solved the problem, but this still seems like a bug?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 11, 2018

No. As I've already said: outdated avconv/avconv bug.

@NightMachinary
Copy link
Author

@NightMachinary NightMachinary commented Jun 14, 2018

@dstftw I am using the latest libav available from Homebrew:

avconv -v                                       1 ↵  6783  01:16:41
avconv version 12.3, Copyright (c) 2000-2018 the Libav developers
  built on Feb 13 2018 11:17:07 with Apple LLVM version 9.0.0 (clang-900.0.39.2)

What version will solve this problem, exactly? 🙄

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.