Hacker News new | ask | show | jobs
by IronWolve 1604 days ago
I'm using yt-dlp, and a very small change really made me go "cool" is Color numbers..

I just wish for functions I could pick mid 720p'ish as a setting that includes audio+video, and not have to pick the audio and video formats. Theres a worst and a best option, but I'd want a middle quality to save space.

2 comments

You can totally do that! See the section on Format Selection[0].

From my reading of it, doing this would work for what you want:

  -f 'bv*[height<=720]+ba/b[height<=720]'
[0] https://github.com/yt-dlp/yt-dlp#format-selection
Alias that to

  -f 720ish
and we’re getting somewhere
Maybe you are looking for

  -S res:720
https://github.com/yt-dlp/yt-dlp#sorting-formats
Also want to save it in .mp4 format, trying it saves it formats in .webm
You can do that with the arguments

    (bestvideo[height=720]/bestvideo)+bestaudio/best
bestvideo[height=720] = download the best 720p resolution

/bestvideo = otherwise download the best available (540p, 480p etc)

This has a few issues, I think. For example, using bestvideo prevents you from downloading formats that contain both video and audio, it only downloads video-only formats.

> otherwise download the best available

This will potentially download much higher than 720, if 720 is not available. Probably better to go lower for OP's usecase.

See my sibling comment for a better format selector.