3 ms·
> Half of what you want is easy How can you download something in opus using youtube-dl? I mean downloading it in opus, not telling youtube-dl to download it i
by est31 7y ago
> Half of what you want is easy
How can you download something in opus using youtube-dl? I mean downloading it in opus, not telling youtube-dl to download it in some other format and then convert it to opus. I've tried it on some of the videos and before reencoding, the audio was in vorbis which is a great format and at high bitrates not very distinguishable from opus, but still opus is better.
- gknoy 7y agoDownload options _might_ work, but depends on what formats are available: --prefer-free-formats Prefer free video formats unless a specific one is requested If opus is provided, you could probably download it this way, but I think your best bet is the post-processing method (which of course isn't perfect): -x, --extract-audio Convert video files to audio-only files (requires ffmpeg or avconv and ffprobe or avprobe) --audio-format FORMAT Specify audio format: "best", "aac", "flac", "mp3", "m4a", "opus", "vorbis", or "wav"; "best" by default; No effect without -x
- ihuman 7y agoYoutube-dl allows you to list all the formats you can download, and then choose exactly which audio and video formats to download and merge. https://github.com/ytdl-org/youtube-dl/blob/master/README.md#format-selection https://github.com/ytdl-org/youtube-dl/blob/master/README.md...
- est31 7y agoInteresting, for some reason it thinks that vorbis @128k has better quality than opus @160k. Youtube online player has the 160k version. Thanks!
- FabHK 7y agoFor opus, try youtube-dl -f 251 <url> However, as I don't use opus, I don't know how prevalent it is. (Use `youtube-dl -F <url>` to see all available formats.) EDIT to add: the above downloads only the audio, FWIW.
- lozf 7y agoUsing youtube-dl -f 251 $url Will download the ~160kbps opus audio if available, but it comes in a webm container, so I'll use something like ffmpeg -i "$file" -vn -acodec copy basename -s .webm "$file".ogg to repack it (without re-encoding) in to an ogg container for playback on Android. Many talks and lectures etc. could withstand the lossy transcoding to an even lower bitrate than Youtube offers (-f 249 = ~50kbps) but space isn't that much of a concern.