20

I have youtube-dl version 2015.07.04. While downloading a video, I see this message:

Your copy of avconv is outdated and unable to properly mux separate video and audio files, youtube-dl will download single file media. Update avconv to version 10-0 or newer to fix this.

Apparently, the drawback of an outdated avconv is that youtube-dl won't be able to download bestvideo and bestaudio separately and mux them together into a single file giving the best overall quality available.

How can I find my currently installed avconv's version number? How can I get a newer version than what is provided by libav-tools 6:9.18-0ubuntu0.14.04.1?

Is there a ppa available for 14.04 with avconv version 10.0 or higher?

DK Bose
  • 41,240
  • 22
  • 121
  • 214
  • are you sure that is really happening? I saw the same error and yet it still merges the two separate files and even asks if I would like to keep them sepatate. – mchid Jul 07 '15 at 11:12
  • I'm sorry but I can't answer that. The only message I see is what I posted and then the video proceeds to download. I've never seen an offer to keep audio and video separate. For now, I'm suppressing the message by using `-f best`. – DK Bose Jul 07 '15 at 11:25
  • have you tried using `-F` first to see what "best" is and then using `-f` to select the best quality explicitly? – mchid Jul 07 '15 at 12:02
  • also, it's not hard to build avconv from source https://github.com/libav/libav – mchid Jul 07 '15 at 12:04
  • I used to use -F followed by -f initially, but then didn't use -f so as to get the "best" quality (by default). As for building from source, I'll pass on that; I once built audacity and geany from source but the process stresses my old laptop. – DK Bose Jul 07 '15 at 12:52
  • 1
    no, First use `youtube-dl -F` followed by the URL. This should list all the available codecs and available versions of quality and format. One of these will be listed as "best" use `-f` followed by the number of the one listed as best just like you would normally use `-f best` like so... `youtube-dl -f` followed by the number and followed by the url. For example: first run `youtube-dl -F http://example.com` and say 13 is listed as "best", then run: `youtube-dl -f 13 http://example.com` – mchid Jul 08 '15 at 04:09
  • 1
    also, when you are building from source (at least when using `make`) you can usually limit the number of threads the process will consume during compilation by using `make j1` (to limit to one thread for example) so that it doesn't hog resources and will only occupy one processor core. It will probably take a lot longer to compile but you can let it run in the background (just in case you ever build anything from source in the future) it's been a while and I don't remember how heavy it is because 15.04 has real ffmpeg now anyhow. – mchid Jul 08 '15 at 04:29
  • I think I've made progress. I ran `sudo add-apt-repository ppa:mc3man/trusty-media`, `sudo apt-get update`, `sudo apt-get dist-upgrade`, installed `ffmpeg` and then used `youtube-dl --prefer-ffmpeg` instead of plain `youtube-dl`. Now, no error and I see that two separate files are downloaded and then the formats are merged. Thanks for your interest :) – DK Bose Jul 09 '15 at 14:07

4 Answers4

13

ppa can be found here

sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install ffmpeg

The following command will add an alias to your bashrc file so your user can execute youtube-dl and bash will execute youtube-dl --prefer-ffmpeg automatically to eliminate unnecessary typing in the future:

echo "alias youtube-dl='youtube-dl --prefer-ffmpeg'" | tee -a ~/.bashrc; . ~/.bashrc

You can also add extra flags to the command by editing your ~/.bashrc file with your favorite text editor like gedit, vim, or nano; just keep in mind that you do not need to and should not use sudo to edit this file as it should be under your current user profile and needs to maintain your user permissions, not that of sudo or root. Just add extra flags within the quoted command for youtube-dl. Also, after editing ~/.bashrc you will need to source the file or open a new terminal to use the new alias. Source the file by running the following command:

. ~/.bashrc

To view the currently installed version of libav-tools, run the following command:

dpkg -l | grep libav

Also, to view what is available from apt-get, run the following command:

apt-cache show libav-tools | grep Version:

All available versions will be listed. The newest version will be installed by default when you run sudo apt-get upgrade or 'dist-upgrade or you can just sudo apt-get install it and it will install the newest available version unless otherwise specified.

To do a search for related packages, use apt-cache search like so:

apt-cache search libav

To narrow the search, you can use grep to only print results containing a keyword like so:

apt-cache search libav | grep libav
mchid
  • 42,315
  • 7
  • 94
  • 147
  • At least on Debian Testing at this time (with ffmpeg 2.8), merely running `youtube-dl --prefer-ffmpeg …` was sufficient. I suggest trying that before digging into unstable/beta repositories. – Adam Katz Oct 04 '15 at 21:37
  • @AdamKatz yes, I'm sure debian testing has the real ffmpeg, however, Ubuntu Trusty (14.04) ships with avconv and when you run an ffmpeg command by default, it calls on avconv sort of like an alias because ffmpeg was dropped and ffmpeg was not made available again until 15.04 (ubuntu vivid). So, using Ubuntu 15.04 or newer and recent versions of debian (I believe jessie as well) you would not need to add the ppa as the real ffmpeg is available. – mchid Oct 07 '15 at 06:43
  • I use the [deb-multimedia](http://www.deb-multimedia.org/) third-party repo, though Debian Testing ("Stretch," the stable release that will follow Jessie) has ffmpeg 2.7.2. From Debian's package tracking system, it looks like [ffmpeg was dropped in Debian 7 (Wheezy) but will return in Debian 9 (Stretch)](https://tracker.debian.org/pkg/ffmpeg). I haven't looked up whether the next Ubuntu will also return the true ffmpeg. – Adam Katz Oct 07 '15 at 15:36
8

Avconv-11 is still available for Ubuntu Trusty in the heyarje ppa:

sudo add-apt-repository ppa:heyarje/libav-11 && sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libav-tools
Jaime M.
  • 380
  • 4
  • 13
3

http://www.tecmint.com/record-ubuntu-desktop-screen-using-avconv/

sudo apt-get install yasm
$ git clone git://git.libav.org/libav.git
$ cd libav
$ ./configure
$ make
$ sudo make install
3
  1. Install FFMpeg

    sudo apt-get install ffmpeg
    
  2. Use this

    youtube-dl -x --audio-format mp3 --prefer-ffmpeg <video URL>
    

Work in youtube-dl 2015.11.19

hg8
  • 13,410
  • 12
  • 71
  • 103
  • when I tried to install ffmpeg using your command I got: __E: Package 'ffmpeg' has no installation candidate__ – Menachem Dec 14 '15 at 21:08