Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
how to have best quality, but mp4, not mkv? #12299
Comments
|
See the first example in https://github.com/rg3/youtube-dl/blob/master/README.md#format-selection-examples |
|
@yan12125 : In this example I'll have best m4a audio (usually 128k), but i want to dl OPUS (which, I believe is better), convert it to m4a using ffmpeg and merge with mp4 video |
|
Sorry I misread your question. Currently it's impossible with command line only because merge ( |
|
@yan12125 may be it's possible in two or more batch passes? |
|
I don't think there's a simple way because |
|
Here's a workaround: merge it into mkv and convert to mp4.
|
|
@yan12125 having this: |
|
Ah, on Windows you need double quotes instead of single quotes. |
|
@yan12125 ok, that worked, but I'm having the same audio bitrate that I tried to avoid ~128k used this command: youtube-dl -v lL7vgDRZxfo -f "bestvideo[ext=mp4]+bestaudio[acodec=opus]" --recode-video mp4 --audio-quality 256k --postprocessor-args "-vcodec copy" |
|
For lL7vgDRZxfo, Youtube does not provide a format higher than ~130k. FYI: --audio-quality is an option for --extract-audio. It does not make sense to specify higher bitrates than the original. |
|
@yan12125 it has 251 webm 153k opus@160k |
YouTube seldom gives correct numbers in those fields.
Got it. This should work:
|
|
Looks like I have better audio spectrum now (16-20 khz is not killed anymore). Thank you very much, @yan12125 ! |
|
Glad that works. As existing options suffice and they're not super complicated, I'll close this. |

Hello! Please help me with this:
I want to download YT playlist with best quality video and audio (OPUS should be better than default 128k m4a commonly used with 1080p video),
and merge it to mp4 container instead of mkv. What command should I use
to dl both streams, convert audio and merge?