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

mp4 recode broken #1027

Closed
EricBelanger opened this issue Jul 11, 2013 · 14 comments
Closed

mp4 recode broken #1027

EricBelanger opened this issue Jul 11, 2013 · 14 comments

Comments

@EricBelanger
Copy link

@EricBelanger EricBelanger commented Jul 11, 2013

Recoding the video to mp4 using ffmpeg doesn't work:

$ youtube-dl --recode-video=mp4 http://www.youtube.com/watch?v=iiFWoXQPOJc
[youtube] Setting language
[youtube] iiFWoXQPOJc: Downloading video webpage
[youtube] iiFWoXQPOJc: Downloading video info webpage
[youtube] iiFWoXQPOJc: Extracting video information
[download] Destination: Work Done by Isothermic Process-iiFWoXQPOJc.flv
[download] 100.0% of 21.94MiB at 864.23KiB/s ETA 00:00
[ffmpeg] Converting video from flv to mp4, Destination: Work Done by Isothermic Process-iiFWoXQPOJc.mp4
ERROR: The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 20, 2013

This is working for me, could you post the output of youtube-dl -v and ffmpeg -version

@EricBelanger
Copy link
Author

@EricBelanger EricBelanger commented Jul 20, 2013

My guess is that I'm using a newer ffmpeg. Anyway here's the info:

$ ffmpeg -version
ffmpeg version 1.2.1
built on May 10 2013 16:31:05 with gcc 4.8.0 (GCC) 20130502 (prerelease)
configuration: --prefix=/usr --disable-debug --disable-static --enable-avresample --enable-dxva2 --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-postproc --enable-runtime-cpudetect --enable-shared --enable-vdpau --enable-version3 --enable-x11grab
libavutil 52. 18.100 / 52. 18.100
libavcodec 54. 92.100 / 54. 92.100
libavformat 54. 63.104 / 54. 63.104
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 42.103 / 3. 42.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100

$ youtube-dl -v --recode-video=mp4 http://www.youtube.com/watch?v=iiFWoXQPOJc
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '--recode-video=mp4', 'http://www.youtube.com/watch?v=iiFWoXQPOJc']
[debug] youtube-dl version 2013.07.19
[debug] Python version 3.3.2 - Linux-3.10.1-1-ARCH-x86_64-with-arch
[debug] Proxy map: {}
[youtube] Setting language
[youtube] iiFWoXQPOJc: Downloading video webpage
[youtube] iiFWoXQPOJc: Downloading video info webpage
[youtube] iiFWoXQPOJc: Extracting video information
[download] Destination: Work Done by Isothermic Process-iiFWoXQPOJc.flv
[download] 100.0% of 21.94MiB at 611.91KiB/s ETA 00:00
[ffmpeg] Converting video from flv to mp4, Destination: Work Done by Isothermic Process-iiFWoXQPOJc.mp4
ERROR: The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 20, 2013

The problem is with libfaac, which can only be build if the nonfree option is included. Adding -strict -2 may solve the problem but I haven't managed to get it to work.

@EricBelanger
Copy link
Author

@EricBelanger EricBelanger commented Nov 2, 2013

It seems like youtube-dl autodownloads as mp4 now:

$ youtube-dl --recode-video=mp4 http://www.youtube.com/watch?v=iiFWoXQPOJc
[youtube] Setting language
[youtube] iiFWoXQPOJc: Downloading video webpage
[youtube] iiFWoXQPOJc: Downloading video info webpage
[youtube] iiFWoXQPOJc: Extracting video information
[download] Destination: Work Done by Isothermic Process-iiFWoXQPOJc.mp4
[download] 100% of 14.56MiB in 00:19
[ffmpeg] Not converting video file Work Done by Isothermic Process-iiFWoXQPOJc.mp4 - already is in target format mp4

So I guess this can be closed.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Nov 3, 2013

No, we have a problem with youtube not serving all the itags (#1578), so now the best quality available is a mp4 file. But the problem is still there, you'll get the same ffmpeg error if you try to recode to mp4 a flv video.

@DavidS
Copy link

@DavidS DavidS commented Sep 6, 2015

This is still happening:

david@zion:/net/Multimedia/Movies/yt$ youtube-dl --recode-video=mp4 https://www.youtube.com/watch?v=DDDD --verbose
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--recode-video=mp4', u'https://www.youtube.com/watch?v=DDDD', u'--verbose']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.06.04.1
[debug] Python version 2.7.10 - Linux-4.1.0-1-amd64-x86_64-with-debian-stretch-sid
[debug] exe versions: avconv 11.4-6, avprobe 11.4-6, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] DDDD: Downloading webpage
[youtube] DDDD: Extracting video information
[youtube] DDDD: Downloading DASH manifest
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[download] DDDD.mkv has already been downloaded and merged
[ffmpeg] Converting video from mkv to mp4, Destination: DDDD.mp4
[debug] ffmpeg command line: avconv -y -i 'DDDD.mkv' 'DDDD.mp4'
ERROR: Add '-strict experimental' if you want to use it.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1548, in post_process
    files_to_delete, info = pp.run(info)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/postprocessor/ffmpeg.py", line 302, in run
    self.run_ffmpeg(path, outpath, [])
  File "/usr/lib/python2.7/dist-packages/youtube_dl/postprocessor/ffmpeg.py", line 152, 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 148, in run_ffmpeg_multiple_files
    raise FFmpegPostProcessorError(msg)
FFmpegPostProcessorError

david@zion:/net/Multimedia/Movies/yt$ 

This is a pretty current Debian testing:

david@zion:~$ avconv -version
avconv version 11.4-6:11.4-2, Copyright (c) 2000-2014 the Libav developers
  built on Jun  3 2015 22:51:42 with gcc 4.9.2 (Debian 4.9.2-19)
avconv 11.4-6:11.4-2
libavutil     54.  3. 0 / 54.  3. 0
libavcodec    56.  1. 0 / 56.  1. 0
libavformat   56.  1. 0 / 56.  1. 0
libavdevice   55.  0. 0 / 55.  0. 0
libavfilter    5.  0. 0 /  5.  0. 0
libavresample  2.  1. 0 /  2.  1. 0
libswscale     3.  0. 0 /  3.  0. 0
david@zion:~$ youtube-dl --version
2015.06.04.1
david@zion:~$ 

running the recoding step manually with avconv -y -i 'DDDD.mkv' -strict experimental 'DDDD.mp4' worked.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Sep 6, 2015

@DavidS I guess the following command works:

youtube-dl --recode-video=mp4 https://www.youtube.com/watch?v=DDDD --verbose --postprocessor-args "-strict experimental"
@dashed
Copy link

@dashed dashed commented Sep 16, 2015

@yan12125 thanks. The following: --postprocessor-args "-strict experimental" fixed my issue:

ERROR: audio conversion failed: Or use the non experimental encoder 'libfaac'.
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Sep 16, 2015

Closing as the problem is solved with the newly added flag --postprocessor-args. Feel free to open a new issue if the problem is still when the flag mentioned above is used.

@yan12125 yan12125 closed this Sep 16, 2015
@dashed
Copy link

@dashed dashed commented Sep 16, 2015

I wasn't sure how to resolve the error at first.

Perhaps, youtube-dl should suggest resolving using --postprocessor-args flagg?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Apr 15, 2016

experimental indicates that the feature should not be enabled by default. By the way, in the latest ffmpeg, aac encoder is no longer marked as experimental. [1] You may want to upgrade ffmpeg.

[1] http://ffmpeg.org/index.html#aac_encoder_stable

@faxotherapy
Copy link

@faxotherapy faxotherapy commented Oct 17, 2016

For unknown reasons to me, I now get the following error:

ERROR: audio conversion failed: Or use the non experimental encoder 'libfaac'.

I had no problem in the past. How can I circumvent this? If I use mp3, it works, but I would rather use either m4a or aac, but none of the last two work.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 18, 2016

@faxotherapy Upgrade your ffmpeg or use the command in #1027 (comment)

@chibicode
Copy link

@chibicode chibicode commented Dec 5, 2016

I used homebrew to install ffmpeg, so this worked for me:

# Reinstall ffmpeg with faac support
brew reinstall ffmpeg --with-faac

# Convert using --prefer-ffmpeg
youtube-dl -x ... --audio-format m4a --prefer-ffmpeg
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
7 participants
You can’t perform that action at this time.