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

... #5169

Closed
ghost opened this issue Oct 7, 2022 · 14 comments
Closed

... #5169

ghost opened this issue Oct 7, 2022 · 14 comments
Labels
question Question

Comments

@ghost
Copy link

ghost commented Oct 7, 2022

...

@ghost ghost added the question Question label Oct 7, 2022
@pukkandan
Copy link
Member

pukkandan commented Oct 7, 2022

This question smells like https://xyproblem.info. I can answer your question, but I suspect it actually wont help you unless you ask what u really want

-f best -S res:720,tbr~2000

@pukkandan
Copy link
Member

pukkandan commented Oct 7, 2022

gotcha.

to refuse to download a video without audio stream

This gave me the impression you wanted only pre-merged formats. Hence why I gave best in my solution

or the closest bitrate to 2000 kbps

Just to clarify, you want the bitrate closest to 2000k, not necessarily less than, correct? So 2400k would be preferred over 1000k. Then, use:

-f bv+wa[abr>=64] -S res:720,tbr~2000

@pukkandan
Copy link
Member

btw, if you are only concerned with youtube, you don't need any of this complexity. Youtube always provides abr=128k and height<=720

@pukkandan
Copy link
Member

Why doesn't -S require the less than or equal for the resolution?

Filtering formats (-f) and sorting formats (-S) uses different syntax. Your problem was easiest to solve using a combination of both - it would get complicated with just -f

@gamer191 gamer191 reopened this Oct 8, 2022
@gamer191
Copy link
Collaborator

gamer191 commented Oct 8, 2022

ERROR: Requested format is not available. Use --list-formats for a list of available formats

Can you please send the output of yt-dlp URL --list-formats

@gamer191 gamer191 added the incomplete Further information is needed label Oct 8, 2022
@pukkandan
Copy link
Member

There is no format matching your conditions. Specifically, yt-dlp doesn't know the bitrate of the audio formats. So it cant tell if they are >64k

@pukkandan
Copy link
Member

If you also want to allow formats with unknown info, use the ? operator

@gamer191 gamer191 removed the incomplete Further information is needed label Oct 8, 2022
@gamer191
Copy link
Collaborator

gamer191 commented Oct 8, 2022

ID         EXT RESOLUTION FPS │   FILESIZE   TBR PROTO │ VCODEC        VBR ACODEC    ABR
────────────────────────────────────────────────────────────────────────────────────────
240p       mp4 240p           │                  https │ unknown           unknown
hls-386    mp4 426x240     30 │ ~ 30.17MiB  387k m3u8  │ avc1.640015  387k mp4a.40.2  0k
480p       mp4 480p           │                  https │ unknown           unknown
hls-816-0  mp4 854x480     30 │ ~ 63.65MiB  816k m3u8  │ avc1.64001f  816k mp4a.40.2  0k
hls-816-1  mp4 854x480     30 │ ~ 63.65MiB  816k m3u8  │ avc1.64001f  816k mp4a.40.2  0k
720p       mp4 720p           │                  https │ unknown           unknown
hls-1605-0 mp4 1280x720    30 │ ~125.25MiB 1606k m3u8  │ avc1.640020 1606k mp4a.40.2  0k
hls-1605-1 mp4 1280x720    30 │ ~125.25MiB 1606k m3u8  │ avc1.640020 1606k mp4a.40.2  0k

How can formats have an ABR of 0k? That looks like a bug to me 🤷‍♂️

@pukkandan
Copy link
Member

Previously, you explicitly said you do not want to download anything if there is no matching audio...

If it can't get the worst audio above 64k, I want to get the best audio. Would that be like this?

-f bv+wa[abr>=64]/ba -S res:720,tbr~2000

Almost. That still does not account for pre-merged formats

-f (bv+(wa[abr>=64]/ba))/b -S res:720,tbr~2000

Should cover everything

but then it's easier to give:

-S res:720,vbr~2000,+abr:64

which accomplishes nearly the same thing

I strongly recommend you go through the docs I linked above

@pukkandan
Copy link
Member

pukkandan commented Oct 10, 2022

can be reopend if there is further questions

@gamer191
Copy link
Collaborator

I don't want to download videos without an audio stream

According to my understanding of the documentation, -f (bv+(wa[abr>=64]/ba))/b -S res:720,tbr~2000 shouldn't download anything if there is either no video or no audio.
But by my understanding, the default option (bv*+ba/b) also shouldn't download anything if there is either no video or no audio, and yt-dlp definitely works on Spotify podcasts, so now I'm confused

@gamer191 gamer191 reopened this Oct 11, 2022
@gamer191 gamer191 self-assigned this Oct 11, 2022
@pukkandan
Copy link
Member

and yt-dlp definitely works on Spotify podcasts, so now I'm confused

There's some special handling for this case


Why'd u re-open?

@gamer191
Copy link
Collaborator

gamer191 commented Oct 11, 2022

There's some special handling for this case

Oh, okay

Why'd u re-open?

I thought that my question related to OP's question enough that I could just reuse this issue. I'll open a new issue next time

@gamer191 gamer191 removed their assignment Oct 11, 2022
@ghost ghost changed the title Help modifying format options ... Jan 2, 2023
@pukkandan
Copy link
Member

Don't remove your post

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

No branches or pull requests

2 participants