How to select video quality from youtube-dl?

A J

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..

ss

mchid

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

youtube-dl 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

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

youtube-dl -F 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

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 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

Or optionally use the following flags to automatically download the best audio and video tracks that are available as a single file:

youtube-dl -f best 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

If you encounter any error during the muxing process or an issue with the video quality selection, you can use one of the following commands:

youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

or as Gabriel Staples pointed out here, the following command will typically select the actual best single file video quality resolution instead of video quality bit-rate:

youtube-dl -f best 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

These commands will ensure you download the highest quality mp4 video and m4a audio from the video as a single file or will merge them back into a single mp4 (using ffmpeg in my case). If ffmpeg or avconv is not available, youtube-dl should fall back to the single file -f best option instead of the default.

Click here for more detailed information and some different examples.

Also, click to see this related answer by Gabriel Staples.


Source: www.webupd8.org/2014/02/video-downloader-youtube-dl-gets.html

Source: github.com/rg3/youtube-dl

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Download the lowest quality video with youtube-dl

From Dev

How to open youtube video with youtube-dl

From Dev

How does youtube determine default video quality

From Dev

How does youtube determine default video quality

From Dev

How to get best quality audio using youtube-dl?

From Dev

youtube-dl - download video from YouTube with subtitles - Tutorial

From Dev

youtube-dl DASH video and audio in highest quality without human intervention

From Dev

How can I download the video description of a YouTube video without downloading the video with youtube-dl?

From Dev

download only audio from youtube video using youtube-dl in python script

From Dev

How to get video tags from youtube video?

From Dev

Retrieve what video resolutions(quality) a youtube video with youtube api?

From Dev

Do not append video id youtube-dl

From Dev

youtube-dl preserve slashes in video title

From Dev

Set jw player youtube video playback quality

From Dev

Loading Youtube iFrame API video at a lower quality

From Dev

Set jw player youtube video playback quality

From Dev

Youtube-DL: Is there an output wildcard for which site the video is being downloaded from?

From Dev

How can I list video resolutions in youtube-dl while using it as a python module?

From Dev

How to download multiple video playlist by youtube-dl and avoid repeated recheck?

From Dev

How to download video format 1 or format 2 using youtube-dl?

From Dev

How do I download with youtube-dl to get video title as filename?

From Dev

How to download video ads from Youtube?

From Dev

how to render video from youtube iframe into canvas?

From Dev

youtube-dl : Downloading a youtube user's complete video collection

From Java

How do I get a YouTube video thumbnail from the YouTube API?

From Dev

How to get Youtube video in embed form from Youtube thumbnail

From Dev

How can I download part of a playlist from YouTube with 'youtube-dl'?

From Dev

How can I download part of a playlist from YouTube with 'youtube-dl'?

From Dev

How to Get Video IDs from Youtube video feeds?

Related Related

  1. 1

    Download the lowest quality video with youtube-dl

  2. 2

    How to open youtube video with youtube-dl

  3. 3

    How does youtube determine default video quality

  4. 4

    How does youtube determine default video quality

  5. 5

    How to get best quality audio using youtube-dl?

  6. 6

    youtube-dl - download video from YouTube with subtitles - Tutorial

  7. 7

    youtube-dl DASH video and audio in highest quality without human intervention

  8. 8

    How can I download the video description of a YouTube video without downloading the video with youtube-dl?

  9. 9

    download only audio from youtube video using youtube-dl in python script

  10. 10

    How to get video tags from youtube video?

  11. 11

    Retrieve what video resolutions(quality) a youtube video with youtube api?

  12. 12

    Do not append video id youtube-dl

  13. 13

    youtube-dl preserve slashes in video title

  14. 14

    Set jw player youtube video playback quality

  15. 15

    Loading Youtube iFrame API video at a lower quality

  16. 16

    Set jw player youtube video playback quality

  17. 17

    Youtube-DL: Is there an output wildcard for which site the video is being downloaded from?

  18. 18

    How can I list video resolutions in youtube-dl while using it as a python module?

  19. 19

    How to download multiple video playlist by youtube-dl and avoid repeated recheck?

  20. 20

    How to download video format 1 or format 2 using youtube-dl?

  21. 21

    How do I download with youtube-dl to get video title as filename?

  22. 22

    How to download video ads from Youtube?

  23. 23

    how to render video from youtube iframe into canvas?

  24. 24

    youtube-dl : Downloading a youtube user's complete video collection

  25. 25

    How do I get a YouTube video thumbnail from the YouTube API?

  26. 26

    How to get Youtube video in embed form from Youtube thumbnail

  27. 27

    How can I download part of a playlist from YouTube with 'youtube-dl'?

  28. 28

    How can I download part of a playlist from YouTube with 'youtube-dl'?

  29. 29

    How to Get Video IDs from Youtube video feeds?

HotTag

Archive