Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to limit youtube-dl quality #4241

Closed
treaki opened this issue Mar 16, 2017 · 15 comments
Closed

how to limit youtube-dl quality #4241

treaki opened this issue Mar 16, 2017 · 15 comments

Comments

@treaki
Copy link

treaki commented Mar 16, 2017

my screen and my cpu only supports only 720p, so its a pain in the ass if mpv is trying to scale down a video with higher resolution. Unfortunately you also have removed the frame drop setting (capital D).

So:

How can i limit mpv to use youtube-dl formats with a maximum of 720p?

How can i get back the frame drop setting?

thanks in advance

System information:
Package: mpv
Version: 1:0.22.0-dmo1~bpo8+1
more: http://paste.debian.net/hidden/681f0bd8/

@CounterPillow
Copy link
Contributor

CounterPillow commented Mar 16, 2017

Put this in your mpv.conf:

ytdl-format=bestvideo[height<=?720]+bestaudio/best

Version: 1:0.22.0-dmo1~bpo8+1

Please update.

mpv will drop frames by default in order to keep in sync with the audio.

@wiiaboo
Copy link
Member

wiiaboo commented Mar 16, 2017

--ytdl-format="format-string"

@ghost
Copy link

ghost commented Sep 4, 2017

This is a slightly more advanced way: It picks the best format it can find (up to but not above 1080p), chooses 30fps or lower (since 60fps just leads to dropped frames and stutter on my computer), and lastly it also ignores the stupid VP9 codec.

ytdl-format=bestvideo[height<=?1080][fps<=?30][vcodec!=?vp9]+bestaudio/best

If you want to limit it to 720p30 or lower, use this instead:

ytdl-format=bestvideo[height<=?720][fps<=?30][vcodec!=?vp9]+bestaudio/best

No matter what you do, I highly recommend using one of these lines in your mpv.conf. Otherwise it always picks the highest-quality version, which may mean 4K @ 60 fps = hell for your CPU to decode, and a total waste of bandwidth!

@Justsoos
Copy link

Justsoos commented Feb 16, 2018

@wiiaboo --ytdl-format="format-string"

now the EXACT option of youtube-dl formats are numbers, like

249          webm       audio only DASH audio   60k , opus @ 50k, 43.25MiB
250          webm       audio only DASH audio   76k , opus @ 70k, 57.71MiB
171          webm       audio only DASH audio   93k , vorbis@128k, 69.77MiB
140          m4a        audio only DASH audio  134k , m4a_dash container, mp4a.40.2@128k, 107.52MiB
251          webm       audio only DASH audio  160k , opus @160k, 121.60MiB
160          mp4        256x144    144p   74k , avc1.4d400c, 30fps, video only, 23.26MiB
278          webm       256x144    144p  128k , webm container, vp9, 30fps, video only, 77.67MiB
133          mp4        426x240    240p  131k , avc1.4d4015, 30fps, video only, 38.89MiB
242          webm       426x240    240p  224k , vp9, 30fps, video only, 95.82MiB

how to drive mpv to play with the number option? for instance, if I want to download 171 audio and 133 video, I could run
youtube-dl -f 171+133 URL
but I tried a few ways in mpv, do not know how to set the right options. and the help page does not give extra info.

@Justsoos
Copy link

Justsoos commented Feb 16, 2018

resolved, run like:
mpv --ytdl-format=171+133 URL
#2619 (comment)

@adrien2050
Copy link

adrien2050 commented May 3, 2020

How can I get Youtube-dl to default to 144p? So far when I've tried this line:

ytdl-format=bestvideo[height>=?144p][fps<=?30][vcodec!=?vp9]+bestaudio/best

it defaults to 360p which wasnt what i wanted. I am on data and i rather use 144p when playing youtube videos. I know the videos I've been trying have an 144p option because it works in the browser and also can be seen when i go through youtube-dl with the -F option.

@kevmitch
Copy link
Member

kevmitch commented May 3, 2020

@adrien2030 open a new issue with the "question template" and follow the template with logs sample, etc. We need all that info in order to help you.

@bitraid
Copy link

bitraid commented May 3, 2020

@adrien2030 Your parameter is incorrect (you can try it with youtube-dl - it won't download 144p). You are asking to get the best video with height greater or equal to 144p, which, of course, isn't 144p. Also, you shouldn't include the "p" when defining the height.
Use something like this instead:
--ytdl-format="bestvideo[height=?144][fps<=?30][vcodec!=?vp9]+bestaudio/best"

@balexandre
Copy link

balexandre commented Jul 3, 2020

what am I doing wrong?

running on Windows 10 2004

mpv 0.32.0-563-gdc24a437fb Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
 built on Sun Jun 21 22:18:57 +08 2020
FFmpeg library versions:
   libavutil       56.55.100
   libavcodec      58.93.100
   libavformat     58.47.100
   libswscale      5.8.100
   libavfilter     7.86.100
   libswresample   3.8.100
FFmpeg version: git-2020-06-21-842bc312a
C:\Users\balex> mpv --ytdl-format="bestvideo[height<=720]+bestaudio/best" "https://f1vod.formula1.com/f1vodprod/562/784/1586723709448/Stirling_Moss_Quotes_F1TV-478404165169-master.m3u8?e=1593811098&a=DK&h=f55ac8a21ff5e635b54ae232ea474c05"
     Video --vid=1 (h264 768x432 25.000fps) (1541 kbps)
     Video --vid=2 (h264 512x288 25.000fps) (374 kbps)
     Video --vid=3 (h264 512x288 25.000fps) (715 kbps)
     Video --vid=4 (h264 768x432 25.000fps) (1084 kbps)
     Video --vid=5 (h264 1024x576 25.000fps) (2468 kbps)
     Video --vid=6 (h264 1280x720 25.000fps) (4401 kbps)
 (+) Video --vid=7 (h264 1920x1080 25.000fps) (7681 kbps)
     Audio --aid=1 (aac 2ch 44100Hz) (1541 kbps)
     Audio --aid=2 (aac 2ch 44100Hz) (374 kbps)
     Audio --aid=3 (aac 2ch 44100Hz) (715 kbps)
     Audio --aid=4 (aac 2ch 44100Hz) (1084 kbps)
     Audio --aid=5 (aac 2ch 44100Hz) (2468 kbps)
     Audio --aid=6 (aac 2ch 44100Hz) (4401 kbps)
 (+) Audio --aid=7 (aac 2ch 44100Hz) (7681 kbps)
AO: [wasapi] 48000Hz stereo 2ch float
VO: [gpu] 1920x1080 yuv420p
AV: 00:00:05 / 00:02:26 (4%) A-V: -0.007 Cache: 52s/45MB

Exiting... (Quit)

it selected 1080p when I just want max of 720p 😒

@CounterPillow
Copy link
Contributor

@balexandre playing back a M3U8 stream does not at all involve youtube-dl. You can switch video tracks by cycling them with the appropriate hotkey.

@balexandre
Copy link

@CounterPillow my bad then ... I thought it was simple, but I wasn't getting what I wanted ... would be convenient to also have an option for this kind'a files 😊 maybe in the future...

@garoto
Copy link
Contributor

garoto commented Jul 4, 2020

--hls-bitrate=<no|min|max|<rate>>

Additionally, if the option is a number, the stream with the highest rate equal or below the option value
is selected.

@rmmh
Copy link

rmmh commented Oct 13, 2020

Instead of bestvideo[height<=720]+bestaudio/best, try bestvideo[height<=720]+bestaudio/best[height<=720].

@arjun2004
Copy link

Put this in your mpv.conf:
where is the mpv.conf in windows?

@garoto
Copy link
Contributor

garoto commented Mar 10, 2022

where is the mpv.conf in windows?

https://mpv.io/manual/master/#files-on-windows

Create an empty file and name it mpv.conf following the manual guidelines above. Edit it as necessary with mpv options in the form of option=value, one per line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests