News for hackers. Stuff that matters.
Re:YouTube-dl fork with additional features and fixes by jmondi on Monday September 11, 2023 @06:43PM (#37474690)
yt-dlp has been awesome, but one thing I [admittedly havent tried to solve and] don't like about it is that it seems to default to unusual container types when downloading.

When using yt-dlp, I get a .webm file, and when asking for audio only using `-x`, I get an .opus file. Is there any reason for this?

Re:YouTube-dl fork with additional features and fixes by ericol on Monday September 11, 2023 @06:49PM (#37474746)
That is because by default yt-dlp tries to download the best / better format available and (I take it the context of your downloads are YT) these are the best ones available.

You can customize which format to download by doing first:

yt-dlp -F <url>

Check what numbers are there, and then download the formats you want.

You can customize both the video format & rate, and same for sound, by using

yt-dlp #+# <url>

Where the first hash is the id of the video stream, and the 2nd hash is the id of the audio id.

Take into account that you'd probably need also ffmpeg available on the command line for this; that if you "mix" containers (Say, a webm video and an m4u audio stream) you-ll end up with an .mkv container; and finally, that all of the downloaded streams are themselves containers (.m4u, mp4 & webm).

Re:YouTube-dl fork with additional features and fixes by thaumasiotes on Monday September 11, 2023 @06:54PM (#37474796)
> Take into account that [...] if you "mix" containers [...] you'll end up with an .mkv container

He's complaining about getting an .mkv in the first place, so this seems unlikely to solve his problem.

Re:YouTube-dl fork with additional features and fixes by ericol on Monday September 11, 2023 @06:57PM (#37474822)
He can solve it if he tells yt-dlp to download a mix of .mp4 and .m4u
Re:YouTube-dl fork with additional features and fixes by mdaniel on Monday September 11, 2023 @06:53PM (#37474783)
to the best of my knowledge, that's because your system does not have ffmpeg for subsequent transcoding of the site's format into what you would consider "your" format: https://github.com/yt-dlp/yt-dlp/blob/2023.07.06/README.md#s... (they also allow you to specify the path, if you don't have it in your $PATH, via --ffmpeg-location <https://github.com/yt-dlp/yt-dlp/blob/2023.07.06/README.md?p...>)
Re:YouTube-dl fork with additional features and fixes by thaumasiotes on Monday September 11, 2023 @06:52PM (#37474779)
A .webm file is an .mkv file. You can rename to .mkv without any ramifications.

My guess would be that yt-dlp is giving you whatever file format it finds, with no editorializing. The default is just to go with "best quality" available. So "Is there a reason for this?" is likely a better question for whoever maintains the site(s) you're downloading from.

Re:YouTube-dl fork with additional features and fixes by dylan604 on Monday September 11, 2023 @06:48PM (#37474733)
i can imagine it's a bit of grandstanding for open formats vs the encumbered formats that are more popular.
Re:YouTube-dl fork with additional features and fixes by hnarn on Monday September 11, 2023 @06:51PM (#37474766)
No. It’s simply going for the highest quality available.
Re:YouTube-dl fork with additional features and fixes by dylan604 on Monday September 11, 2023 @07:32PM (#37475092)
i'll accept that. so the grandstanding is with Googs/YT in only providing the higher quality in those formats. there's no compelling reason other than pushing the other formats and trying to throw shade on the others. they are already using h.264, so just up the quality and not force a totally different codec.