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

Allow a custom ffmpeg path to be specified #2115

Closed
chocolateboy opened this issue Jan 7, 2014 · 9 comments
Closed

Allow a custom ffmpeg path to be specified #2115

chocolateboy opened this issue Jan 7, 2014 · 9 comments

Comments

@chocolateboy
Copy link
Contributor

@chocolateboy chocolateboy commented Jan 7, 2014

youtube-dl: 2014.01.07.5
python: 2.7.3
OS: Ubuntu 12.04

Great work on providing a way to join DASH audio and video!

I know it hasn't been announced yet, but I thought I'd report a possible issue related to it. The ffmpeg/avconv on Ubuntu 12.04 doesn't seem to mux the streams correctly:

youtube-dl -f '137+140' gBabKoHSErI

produces an .mp4 file with an audio track but no video track:

> mediainfo gBabKoHSErI.mp4

General
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 2.16 MiB
Duration                                 : 2mn 21s
Overall bit rate mode                    : Variable
Overall bit rate                         : 128 Kbps
Encoded date                             : UTC 2013-12-27 19:27:06
Tagged date                              : UTC 2013-12-27 19:27:06
Writing application                      : Lavf53.21.1

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 2mn 21s
Bit rate mode                            : Variable
Bit rate                                 : 126 Kbps
Channel count                            : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 44.1 KHz
Compression mode                         : Lossy
Stream size                              : 2.11 MiB (98%)
Encoded date                             : UTC 2013-12-27 19:27:06
Tagged date                              : UTC 2013-12-27 19:27:06

I get an error if I try to merge the streams manually with the stock ffmpeg e.g.:

> ffmpeg -version
ffmpeg version 0.8.9-4:0.8.9-0ubuntu0.12.04.1, Copyright (c) 2000-2013 the Libav developers
  built on Nov  9 2013 19:12:07 with gcc 4.6.3

> ffmpeg -y -i gBabKoHSErI.f140.m4a -i gBabKoHSErI.f137.mp4 -c copy gBabKoHSErI.mp4
Unrecognized option 'c'
Failed to set value 'copy' for option 'c'

I get the audio-only file (and no error) if I replace -c copy with -acodec copy -vcodec copy.

Both options work fine if I use a more recent version of ffmpeg:

> sffmpeg -version
ffmpeg version 2.0
built on Aug 20 2013 01:54:29 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)

> sffmpeg -y -i gBabKoHSErI.f140.m4a -i gBabKoHSErI.f137.mp4 -c copy gBabKoHSErI.mp4
Stream mapping:
  Stream #1:0 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 3379 fps=0.0 q=-1.0 Lsize=   51389kB time=00:02:21.03 bitrate=2984.9kbits/s    
video:49127kB audio:2162kB subtitle:0 global headers:0kB muxing overhead 0.195621%

An option to set the ffmpeg path would allow me to use the more recent ffmpeg automatically; it would also allow users to make their own choices re: avconv vs ffmpeg.

@JohanPy
Copy link

@JohanPy JohanPy commented Jan 8, 2014

youtube-dl: 2014.01.07.5
python: 2.7.5+
OS: Ubuntu 13.10
ffmpeg version: 0.10.9-7:0.10.9-1~saucy1

As expected, same problem on Ubuntu 13.10

jaimeMF added a commit that referenced this issue Jan 8, 2014
Affects the ffmpeg post processors, if ‘--prefer-ffmpeg’ is given and both avconv and ffmpeg are installed, it will use ffmpeg. Otherwise it will follow the old behaviour.
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jan 8, 2014

ok, I've added (on the git repo, will be available in the next version) the option --prefer-ffmpeg. If you use it and have both avconv and ffmpeg installed it will use ffmpeg (instead of avconv as it usually do).
It think we don't need the --use-ffmpeg /path/to/custom/ffmpeg option, because you can modify your PATH so that the folder that contains your custom ffmpeg is before the avconv's version path, youtube-dl would then use your custom installation.

@chocolateboy
Copy link
Contributor Author

@chocolateboy chocolateboy commented Jan 8, 2014

Working around this by modifying PATH is a terrible hack, and doesn't play at all well on Windows.

@Elite
Copy link

@Elite Elite commented Jan 9, 2014

@jaimeMF If ffmpeg is in same directory as YTDL, will it detect it? If not any ways to make it do?

@phihag
Copy link
Contributor

@phihag phihag commented Feb 17, 2015

Since youtube-dl 2015.02.16, you can use the --ffmpeg-location option to specify the path of the executable (or the directory the executable resides in). See our FAQ if you need help updating.

@phihag phihag closed this Feb 17, 2015
@chocolateboy
Copy link
Contributor Author

@chocolateboy chocolateboy commented Feb 17, 2015

Thanks!

@noxxim
Copy link

@noxxim noxxim commented Mar 10, 2015

Thanks for that helpful option. I build a new avconv binary only for yt-dl. I don't want to install backports/ppa/unstable on my Ubuntu LTS version. It works perfect now.

@redfoxofdeath
Copy link

@redfoxofdeath redfoxofdeath commented Aug 25, 2019

Any clue how to specify the path with python?

@darkuranium
Copy link

@darkuranium darkuranium commented Feb 27, 2020

@HarrySykes7890 'ffmpeg_location': ... in the configuration dictionary.

It's not documented in YoutubeDL.py for some reason, I'm guessing oversight?

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