Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: youtube-dl and mpv.conf file
Date: Sat, 13 Apr 2019 11:45:12
Message-Id: 1611742.3FjLGkbj8R@dell_xps
In Reply to: Re: [gentoo-user] Re: youtube-dl and mpv.conf file by Dale
1 On Saturday, 13 April 2019 09:55:45 BST Dale wrote:
2
3 > root@fireball / # cat /home/dale/.config/youtube-dl/config
4 > ytdl-format=bestvideo[height<=?1280]+bestaudio/best
5 > root@fireball / #
6 >
7 >
8 >
9 > It still insists on downloading the largest file.
10
11 It is doing this because you're asking it to download a video of [height<=?
12 1280], and also download potentially separately an audio file - then mux them
13 into one container file. A *height* of <=1280 means a resolution of more than
14 1080p. So, no wonder it wants to download a much larger video file. In
15 addition, the question mark is used to download videos up to 1280 or videos
16 where the height is not known. Therefore it could potentially download a
17 bigger file if its height is somehow not declared in its web metadata.
18
19 As I understand it, to only download a single file containing both video and
20 audio and restrict its video size to height<=720, you should define it thus:
21
22 --format 'best[height<=720]'
23
24 For example, this URL is provided by Google in many different formats and
25 containers:
26
27 $ youtube-dl -F 'https://www.youtube.com/watch?v=7TavVZMewpY'
28 [youtube] 7TavVZMewpY: Downloading webpage
29 [youtube] 7TavVZMewpY: Downloading video info webpage
30 [info] Available formats for 7TavVZMewpY:
31 format code extension resolution note
32 249 webm audio only DASH audio 53k , opus @ 50k, 647.78KiB
33 250 webm audio only DASH audio 71k , opus @ 70k, 855.53KiB
34 171 webm audio only DASH audio 127k , vorbis@128k, 1.55MiB
35 140 m4a audio only DASH audio 130k , m4a_dash container, mp4a.40.2@128k,
36 1.68MiB
37 251 webm audio only DASH audio 141k , opus @160k, 1.65MiB
38 394 mp4 256x138 144p 91k , av01.0.05M.08, 24fps, video only, 947.02KiB
39 278 webm 256x138 144p 110k , webm container, vp9, 24fps, video only,
40 1.19MiB
41 160 mp4 256x138 144p 110k , avc1.4d400c, 24fps, video only, 834.76KiB
42 395 mp4 426x230 240p 202k , av01.0.05M.08, 24fps, video only, 1.69MiB
43 242 webm 426x230 240p 232k , vp9, 24fps, video only, 1.81MiB
44 133 mp4 426x230 240p 282k , avc1.4d4015, 24fps, video only, 1.91MiB
45 396 mp4 640x346 360p 359k , av01.0.05M.08, 24fps, video only, 3.01MiB
46 243 webm 640x346 360p 402k , vp9, 24fps, video only, 3.07MiB
47 134 mp4 640x346 360p 499k , avc1.4d401e, 24fps, video only, 3.53MiB
48 397 mp4 854x460 480p 647k , av01.0.05M.08, 24fps, video only, 5.37MiB
49 244 webm 854x460 480p 760k , vp9, 24fps, video only, 4.97MiB
50 135 mp4 854x460 480p 837k , avc1.4d401e, 24fps, video only, 5.36MiB
51 247 webm 1280x690 720p 1343k , vp9, 24fps, video only, 8.89MiB
52 136 mp4 1280x690 720p 1429k , avc1.4d401f, 24fps, video only, 8.26MiB
53 248 webm 1920x1036 1080p 2529k , vp9, 24fps, video only, 22.53MiB
54 137 mp4 1920x1036 1080p 4331k , avc1.640028, 24fps, video only, 26.69MiB
55 43 webm 640x360 medium , vp8.0, vorbis@128k, 10.60MiB
56 18 mp4 640x344 medium 610k , avc1.42001E, mp4a.40.2@ 96k (44100Hz),
57 7.91MiB
58 22 mp4 1280x690 hd720 766k , avc1.64001F, mp4a.40.2@192k (44100Hz)
59 (best)
60
61 If you use:
62
63 youtube-dl --format 'best[height<=720]' 'https://www.youtube.com/watch?
64 v=7TavVZMewpY'
65
66 only a single file will be downloaded containing both video and audio. In
67 this case the video is 690 pixels high, which is <=720.
68
69 You can add:
70
71 --format 'best[height<=720]'
72
73 in your config file to not have to enter it every time you download a file.
74
75 --
76 Regards,
77 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
[gentoo-user] Re: youtube-dl and mpv.conf file Nikos Chantziaras <realnc@×××××.com>
Re: [gentoo-user] Re: youtube-dl and mpv.conf file Walter Dnes <waltdnes@××××××××.org>