Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed youtube-dl in my 14.04.

I can download video by following command,

$ youtube-dl [youtube-link]

But I want to know how to select available pixel quality of youtube video(i.e 1080p, 720p, 480p, etc).

In software description they said it's possible(shown in image below), but how to do..


share|improve this question
The description above is obsolete. From the man page: "youtube-dl now defaults to downloading the highest available quality as reported by YouTube, which will be 1080p or 720p in some cases." – Jos Jun 21 '14 at 10:08
Note that YouTube has employed some sort of protection that prevents downloading tools from downloading (or even seeing) the 1080p version, but you can still download all other resolutions up to and including 720p. – thomasrutter Oct 1 '14 at 3:19
up vote 105 down vote accepted

To download a video, you type the URL after the command like so:

youtube-dl ""

To select the video quality, first use the -F option to list the available formats, here’s an example,

youtube-dl -F ""

Here’s the output:

[youtube] Setting language
[youtube] P9pzm5b6FFY: Downloading webpage
[youtube] P9pzm5b6FFY: Downloading video info webpage
[youtube] P9pzm5b6FFY: Extracting video information
[info] Available formats for P9pzm5b6FFY:
format code extension resolution  note 
140         m4a       audio only  DASH audio , audio@128k (worst)
160         mp4       144p        DASH video , video only
133         mp4       240p        DASH video , video only
134         mp4       360p        DASH video , video only
135         mp4       480p        DASH video , video only
136         mp4       720p        DASH video , video only
17          3gp       176x144     
36          3gp       320x240     
5           flv       400x240     
43          webm      640x360     
18          mp4       640x360     
22          mp4       1280x720    (best)

The best quality is 22 so use -f 22 instead of -F to download the MP4 video with 1280x720 resolution like this:

youtube-dl -f 22 ""

Or optionally use the following flags to automatically download the best audio and video tracks available:

youtube-dl -f bestvideo+bestaudio ""

If you encounter an error during the muxing process, instead try the following:

youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4 ""

That command will ensure you download the highest quality mp4 video and m4a audio from the video and merge them back into a single mp4 (using ffmpeg in my case).


share|improve this answer
Make sure that you do not choose DASH. That will be unplayable! – prakharsingh95 Sep 13 '14 at 4:21
@prakharsingh95 the DASH audio only can be converted to standard wave or mp3 format using gnac or similar software. – mchid Sep 17 '14 at 12:09
I meant DASH Video. I tried to download 4K, but that's all in DASH format (DASH allows youtube to preserve bandwidth). It's radically different it will mostly be unplayable. – prakharsingh95 Sep 24 '14 at 19:41
@prakharsingh95 Yeah if anything you might be able to view the mp4 using VLC as VLC allows you to sync the video with a separate file for audio. I haven't tried it though. Have you tried converting the mp4 file from the DASH download to avi format? I think they are similar. – mchid Sep 25 '14 at 5:05
Yes. Dash is of course playable, but you need to mux the streams with something like avconv. Too slow for 4K. – prakharsingh95 Sep 29 '14 at 8:39

You can download 1080p using youtube-dl, but you need to do a little extra work. Usually it will only download 720p as its max even if you can see 1080p on

Run with -F to see available formats:

youtube-dl -F\?v\=-pxRXP3w-sQ

171         webm      audio only  DASH audio  115k , audio@128k (44100Hz), 2.59MiB (worst)
140         m4a       audio only  DASH audio  129k , audio@128k (44100Hz), 3.02MiB
141         m4a       audio only  DASH audio  255k , audio@256k (44100Hz), 5.99MiB
160         mp4       256x144     DASH video  111k , 12fps, video only, 2.56MiB
247         webm      1280x720    DASH video 1807k , 1fps, video only, 23.48MiB
136         mp4       1280x720    DASH video 2236k , 24fps, video only, 27.73MiB
248         webm      1920x1080   DASH video 3993k , 1fps, video only, 42.04MiB
137         mp4       1920x1080   DASH video 4141k , 24fps, video only, 60.28MiB
43          webm      640x360
18          mp4       640x360
22          mp4       1280x720    (best)

notice that youtube-dl has labeled the last option 1280x720 as the 'best' quality and that's what it will download by default, but that the line starting with 137 is actually higher quality 1920x1080. Youtube has separated the video and audio streams for the lines labeled DASH so we also need to pick the highest quality audio which in this case is the line starting with 141. Then we run youtube-dl again this time specifying the audio and video:

youtube-dl -f 137+141\?v\=-pxRXP3w-sQ

and it will download the 1080p video and auto-merge it with the highest-quality audio. It should also auto-deleted the separate downloaded parts. This method is a little extra work, but will get you the best results.

share|improve this answer
thank you very much, didn't know about 137+141 – whitesiroi May 5 '15 at 14:48
Your example and others present easy choices for the audio - that is, for high quality, choose the one with highest bitrate value. I recently however found myself faced with a choice between DASH audio , opus @160k or DASH audio 126k , audio@128k (44100Hz), 1.79MiB or DASH audio 127k , m4a_dash container, aac @128k (44100Hz), 1.94MiB. I had to choose but am uncertain about quality, or perhaps compatibility. – user643722 Jun 10 '15 at 12:13
The best thing about youtube-dl is that it is multi-platform. This solution doesn't just work on Linux, but also on Mac and Windows. Thank you! – Antony Jun 2 at 23:19

A bash wrapper script that prompts for the format, which includes all available renditions, including audio-only, video-only, etc:

youtube-dl -F "$*"
read -p "Please enter the desired quality # " FORMAT
youtube-dl -f $FORMAT "$*"
share|improve this answer

By default, youtube-dl will pick the best quality.

share|improve this answer
Yes, as per the readme You also have option(s) to select intended format, see here:… – AjayKumarBasuthkar Jan 26 at 17:18

protected by Community Nov 4 '15 at 13:29

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.