youtube-dl - select quality?

Here is a place for your projects which are not officially supported by the Porteus Team. For example: your own kernel patched with extra features; desktops not included in the standard ISO like Gnome; base modules that are different than the standard ISO, etc...
Post Reply
User avatar
Rava
Contributor
Contributor
Posts: 2480
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 5.0rc1 x86-64 XFCe
Location: Forests of Germany

youtube-dl - select quality?

Post#1 by Rava » 12 Mar 2020, 08:08

According to the help info, there is no way of telling youtube-dl which audio and video quality it should download. [1]

Maybe one wants just to watch a silly clip (and later delete it) offline and one not needs the full-HD quality for that, so being able to e.g. choose 360, 480, 720 or 1080 would be a neat feature.

For now, it seems all that youtube-dl is able to do is always download the largest file / best quality.
Is there maybe a hidden parameter that would enable youtube-dl doing so?

_______________
[1] The only hit for quality is this:

Code: Select all

    --audio-quality QUALITY          Specify ffmpeg/avconv audio quality, insert
                                     a value between 0 (better) and 9 (worse)
                                     for VBR or a specific bitrate like 128K
                                     (default 5)
Cheers!
Yours Rava

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 2593
Joined: 20 Mar 2012, 03:42
Distribution: 5.0rc1-64bit all-DE+more
Location: australia
Contact:

youtube-dl - select quality?

Post#2 by ncmprhnsbl » 12 Mar 2020, 08:38

https://github.com/ytdl-org/youtube-dl/ ... -selection
example:

Code: Select all

youtube-dl -f 'bestvideo[height<=480]+bestaudio/best[height<=480]'  <presumablythelink>
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

donald
Full of knowledge
Full of knowledge
Posts: 1644
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

youtube-dl - select quality?

Post#3 by donald » 12 Mar 2020, 10:14

use youtube-dl -F first to get a list of the available video/audio formats

Example:

Code: Select all

guest@porteus:~/Test$ youtube-dl -F https://www.youtube.com/watch?v=0LyAey51CmQ
[youtube] 0LyAey51CmQ: Downloading webpage
[youtube] 0LyAey51CmQ: Downloading video info webpage
[info] Available formats for 0LyAey51CmQ:
format code  extension  resolution note
249          webm       audio only tiny   50k , opus @ 50k (48000Hz), 125.75KiB
250          webm       audio only tiny   61k , opus @ 70k (48000Hz), 154.07KiB
251          webm       audio only tiny  110k , opus @160k (48000Hz), 274.33KiB
140          m4a        audio only tiny  127k , m4a_dash container, mp4a.40.2@128k (44100Hz), 357.23KiB
160          mp4        256x144    144p   67k , avc1.4d400c, 25fps, video only, 137.66KiB
278          webm       256x144    144p   83k , webm container, vp9, 25fps, video only, 189.34KiB
133          mp4        426x240    240p  101k , avc1.4d4015, 25fps, video only, 214.12KiB
242          webm       426x240    240p  164k , vp9, 25fps, video only, 348.06KiB
134          mp4        640x360    360p  223k , avc1.4d401e, 25fps, video only, 459.23KiB
243          webm       640x360    360p  295k , vp9, 25fps, video only, 630.51KiB
135          mp4        854x480    480p  367k , avc1.4d401e, 25fps, video only, 756.40KiB
244          webm       854x480    480p  463k , vp9, 25fps, video only, 1017.00KiB
136          mp4        1280x720   720p  622k , avc1.4d401f, 25fps, video only, 1.27MiB
247          webm       1280x720   720p 1004k , vp9, 25fps, video only, 2.06MiB
18           mp4        640x360    360p  441k , avc1.42001E, mp4a.40.2@ 96k (44100Hz), 1.21MiB
22           mp4        1280x720   720p  593k , avc1.64001F, mp4a.40.2@192k (44100Hz) (best)
download whatever you want with youtube-dl -f <format code> <video address>

Quote from the page linked above:
You can merge the video and audio of two formats into a single file using -f <video-format>+<audio-format>
(requires ffmpeg or avconv installed),
for example -f bestvideo+bestaudio will download the best video-only format, the best audio-only format
and mux them together with ffmpeg/avconv.

dZ0TFR
Samurai
Samurai
Posts: 122
Joined: 07 Apr 2019, 07:16
Distribution: Porteus-4.0

youtube-dl - select quality?

Post#4 by dZ0TFR » 12 Mar 2020, 13:55

youtube-dl -f 18 gdfHyifg

where gdfHyifg last end way (sorry for my english)
Porteus-4.0-x86

User avatar
Rava
Contributor
Contributor
Posts: 2480
Joined: 11 Jan 2011, 02:46
Distribution: Porteus 5.0rc1 x86-64 XFCe
Location: Forests of Germany

youtube-dl - select quality?

Post#5 by Rava » 12 Mar 2020, 20:14

Thanks donald that explains it all. :)
Cheers!
Yours Rava

Post Reply