database64128 / youtube-dl-wpf

A simple GUI wrapper for youtube-dl and yt-dlp.
GNU General Public License v3.0
876 stars 68 forks source link

Downloading MP3 doesn't work properly it actually downloads the video as WEBM #102

Closed shekelboi closed 2 years ago

shekelboi commented 2 years ago

For me, if I want to download a video as mp3, I need to manually add --extract-audio --audio-format mp3, otherwise it downloads it as WEBM, even though I use mp3 as the container.

It would be also a really useful feature to save custom presets (and then you could choose them from the formats).

database64128 commented 2 years ago

Assuming you are downloading from YouTube, if you click list formats, you'll see that the provided audio codecs do not include mp3. That's why you need extra arguments to do a conversion from other audio codecs to mp3.

I'm curious why you want mp3 audio. In the format drop-down list, you can see there are 2 audio-only presets for YouTube: Opus audio (251) and AAC audio (140). Opus is a FOSS audio codec. It's the best and most efficient audio format supported by YouTube. Most devices can already play opus audio. If your device can't play Opus, you can choose AAC, which uses the m4a container.

If you really really have to convert the audio stream to mp3, select Auto for container and format, and add extra arguments. This use case will not be explicitly supported by the GUI.

shekelboi commented 2 years ago

Sorry for my belated response, since most of my songs are already stored as MP3 and along with WAV, these formats are the most widely supported and I agree, nowadays playing opus or m4a is not an issue in general but when you want to use the music somewhere else, for example inside a game, suddenly support for the format starts to matter. I acknowledge and respect your decision to exclude explicit MP3 support in the GUI but I think custom presets for CLI could be a very handy feature.

database64128 commented 2 years ago

I'm thinking about making the following changes:

  1. Handle custom containers exactly the same way as download path history: Used custom containers will be displayed in the container drop-down list above built-in ones, and can be deleted with the ❌ button.
  2. Put a ➕ button beside the format selection combo box. Clicking ➕ opens a dialog that allows you to add a new custom format with the following properties: display name, format argument (optional), container argument (optional), supported backend types, extra arguments (optional). For example, you can define a custom format with the name mp3 and extra arguments --extract-audio --audio-format mp3.

What do you think? Do these address your use case?

shekelboi commented 2 years ago

Both of these options sound great, not sure if you wanna choose one from the two or go with both but if you want to choose only of the options, I would definitely go for the second one as it leaves more room for customization.

database64128 commented 2 years ago

Implemented in 67097ea660559b6ab34960dbc66a25ae84cabe80.

database64128 commented 2 years ago

v1.11.0 has been released.