oleksis / youtube-dl-gui

A cross platform front-end GUI of the popular youtube-dl written in wxPython.
https://oleksis.github.io/youtube-dl-gui/
The Unlicense
1.68k stars 108 forks source link

Selection formats, resolutions and codecs #144

Open oleksis opened 1 year ago

oleksis commented 1 year ago

Formats available (no only YouTube)

From werid:

Isn't the main problem with the format list that you cannot choose two formats to merge via that list?

it's only useful for people who might want a pre-combined format or audio only format.

if i check the boxes of mp4 [480p] (Dash video) and mp4 [1080p] (Dash video), they show up in the drop downdown list next to the add button, but it downloads only that video only format, i can't tell yt-dlg to combine with an audio format. i have to keep it at default to get video+audio, and use the cli backend arguments to specify any -f or -S to nudge the default into a specific format(s) direction.

i think if you want to improve this part of yt-dlg, you should make it a bit more abstract. if people want to choose specific formats, they can do that via the manual arguments.

people care about resolution, codec, container - although they often don't know they care about codec and container, and often confuse the two.

imagine a format selection screen where you get choices between the common codec/containers, and then choose your desired resolution.

[ ] I only want the selected resolution, skip downloading if not available

[ ] best available resolution
[ ] 4320p
[ ] 3072p
[ ] 2160p
[ ] 1440p
[ ] 1080p
[ ] 720p
[ ] 480p
[ ] 360p
[ ] 144p

Video with audio  # default to sensible audio choices, i.e. mp4 = m4a, anything else opus
[ ] mp4  (h264)   # show a hint that this is what most people think of when they want mp4 
[ ] webm (vp9)
[ ] webm (av1)
[ ] mkv  (vp9)
[ ] mkv  (av1)
[ ] mkv  (ios premium)
[ ] mp4  (h264 ios premium) # this will use --recode mp4, but make sure it forces downloads opus audio)

Audio only    
[ ] m4a
[ ] opus
[ ] mp3  # Maybe include quality options like the ones below, but pick a default of vbr or 320 ... ?
    [ ] variable bit rate
    [ ] 320 constant bit rate
    [ ] 128 constant bit rate
[ ] wav
[ ] flac

if user chooses 2160p and mp4 (h264), then maybe alert user that this might take a while because it has to re-encode.

omething i'm unsure of is whether or not to let user choose to skip or fall back to vp9 is av1 is unavailable ... there are also videos where vp9 is unavailable on youtube

something i've not thought about is non-youtube sites, as they tend to default to mp4 (h264)

could separate youtube settings and generic video settings ... this is just an example anyways ... but i could probably come up with something that works if you're interested

i think i would also start checking whether or not ffmpeg is available and tell the user that it is needed for most operations and video download will be limited to a maximum of 720p on youtube and may cause other sites to fail completely. do a popup on start and give users a few buttons ala "show me how to install ffmpeg" and open browser to your ffmpeg installation guide. another button could be "i know what i'm doing, don't show this again", and maybe a third button which will skip the message for now but show again later...

if they keep going into the format selection screen without ffmpeg, then most of the options are useless, so don't let them choose much. either show them a different selection with the limited choices you now have, or show a message that this screen is disabled due to missing ffmpeg.

oleksis commented 1 year ago

Use case:

User: 4K would be best. Failing that, 1080p. My videos are in 4k which is why I need it...

Presets:

ok, think i've got a good setting for you.

click the cogwheel and choose options, then go to the Extra tab, and paste the following into the CLI Backend command line options field:

-f "bv[height>1080][width>1920][vcodec^=vp9][ext=webm]+ba[ext=webm]/bv[ext=mp4][vcodec^=avc]+ba[ext=m4a]/b[ext=mp4]/b" --recode mp4

if you need both horizontal and vertical videos, do test it and provide examples if they don't come out in the right resolutions/formats ...