Gentoo Archives: gentoo-user

From: Dale <rdalek1967@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: youtube-dl and mpv.conf file
Date: Sat, 13 Apr 2019 08:55:54
Message-Id: e1980e12-e749-a1a5-0378-0c661aadc457@gmail.com
In Reply to: Re: [gentoo-user] Re: youtube-dl and mpv.conf file by Dale
1 Dale wrote:
2 > Nikos Chantziaras wrote:
3 >> On 13/04/2019 11:11, Dale wrote:
4 >>> Anyway, I want to set it so that the highest resolution it
5 >>> will download is 720P. [...]
6 >>>
7 >>> I stuck the following into the file, in each location I tried.
8 >>>
9 >>> ytdl-format=bestvideo[height<=?720]+bestaudio/best
10 >>>
11 >>>  From my googling, that's what is shown is several places as being
12 >>> correct.
13 >>>
14 >>> What am I missing here?  Does it look in a new place that I haven't
15 >>> found yet?  Name changed?  Something else?  Anyone have a idea on where
16 >>> this goes and/or why this isn't working?
17 >> Are you actually downloading with youtube-dl, or are you viewing them
18 >> directly with mpv? Because the mpv config file is only used by mpv,
19 >> not by youtube-dl:
20 >>
21 >> https://github.com/ytdl-org/youtube-dl/blob/master/README.md#configuration
22 >>
23 >>
24 >> Anyway, you should limit the width of the video, not the height. For
25 >> 720p, the width would be 1280. To get the highest quality encoding,
26 >> prefer VP9 (webm) instead of H.264 (mp4), but allow H.264 fallback if
27 >> a video doesn't have a VP9 encoding. Also, I use a rule to prevent
28 >> dash segments because (at least in the past) prevents video seeking
29 >> from working. I use SMPlayer as an MPV front-end, and in the advanced
30 >> settings, I use this:
31 >>
32 >> --ytdl-format
33 >> bestvideo[ext=webm][width<=?2560]+bestaudio/bestvideo[ext=mp4][protocol!=http_dash_segments][width<=?2560]+bestaudio/best
34 >>
35 >> This is to limit to 1440p though. For 720p, use a 1280 width:
36 >>
37 >> --ytdl-format
38 >> bestvideo[ext=webm][width<=?1280]+bestaudio/bestvideo[ext=mp4][protocol!=http_dash_segments][width<=?1280]+bestaudio/best
39 >>
40 >>
41 >>
42 >
43 > I'm actually downloading with youtube-dl.  I thought it odd that it
44 > would refer to a mpv file for downloading.  Still, when I searched, it
45 > is what kept popping up.  Maybe a search term confused google.  After I
46 > posted, I tried searching for other terms and found the link you
47 > reference in your post.  I then created the file here: 
48 > /etc/youtube-dl.conf  I put in the same as mentioned before but it still
49 > downloads a huge file.  I got this using exiftool:
50 >
51 > root@fireball / # exiftool
52 > /home/dale/Desktop/Documents/Food/long-path-to-video.mp4 | grep size
53 > File Size                       : 192 MB
54 > Movie Data Size                 : 200847130
55 > Image Size                      : 1920x1080
56 > root@fireball / #
57 >
58 > It still seems to ignore that I want a smaller video.  Just for clarity:
59 >
60 > root@fireball / # cat /etc/youtube-dl.conf
61 > ytdl-format=bestvideo[height<=?720]+bestaudio/best
62 > root@fireball / #
63 >
64 > I'll try your setting but I would think it would still pick something
65 > smaller than 1920x1080.  Right? 
66 >
67 > Dale
68 >
69 > :-)  :-) 
70 >
71
72
73 Just tried this as well. 
74
75
76
77 root@fireball / # cat /home/dale/.config/youtube-dl/config
78  ytdl-format=bestvideo[height<=?1280]+bestaudio/best
79 root@fireball / #
80
81
82
83 It still insists on downloading the largest file.  Like this:
84
85
86
87 root@fireball / # exiftool
88 /home/dale/Desktop/Documents/Food/long-path-to-file.mp4 | grep size
89 File Size                       : 191 MB
90 Movie Data Size                 : 1689868
91 Image Size                      : 1920x1080
92 root@fireball / #
93
94
95 I'm sure this is some silly thing I'm missing here.  Maybe a typo or
96 something??  I'm trying to copy and paste when I can since it helps
97 prevent typos. 
98
99 Thanks.
100
101 Dale
102
103 :-)  :-) 

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 Mick <michaelkintzios@×××××.com>