question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cant get compatible bestvideo+bestaudio for mp4

See original GitHub issue

Checklist

  • I’m asking a question
  • I’ve looked through the README and FAQ for similar questions
  • I’ve searched the bugtracker for similar questions including closed ones

Question

Problem: Can’t Get mp4 format with bestvideo+bestaudio Once i try doing youtube-dl.exe --merge-output-format mp4 URL it will download the MP4 format but with bad video quality I expect the command to download the bestaudio and video format but i cant get it working…

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dirkfcommented, Aug 19, 2021

… What’s wrong with this one, though ? It gets both the best MP4 vid and the best M4A audio (FFmpeg/avconv required), and otherwise the best MP4 combination (which in this case is anything but best, but that’s YT’s fault, not ytdl’s):

youtube-dl -v -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]" "4ukOvwQmJvE"

Yes, apart from “Windows” vs ‘POSIX’ shell quotes. your -f is an alternative way of asking for the selection specified by '(bestvideo+bestaudio/best)[ext!^=web]' in the command that I almost simultaneously posted.

In the first command you were asking to combine two video formats, and the list of alternative formats did not include any that were available. Had one been, you would then have got a message like ERROR: Both formats 399 and 399 are video-only, you must specify "-f video+audio".

Something like this (305/266/304/264/137/bestvideo[ext=mp4])+bestaudio[ext=m4a] would work if one were desperate to get one of the 5 listed formats when available, but the other formulations are simpler and more robust against site changes.

0reactions
rautamiekkacommented, Aug 19, 2021

Shame ytdl can’t skip non-existent formats even when setting priorities with the slash, so commands like this won’t work cuz 305 is the 1st between the parentheses and doesn’t exist for 4ukOvwQmJvE:

youtube-dl -v -f "bestvideo[ext=mp4]+(305/266/304/264/137)" "4ukOvwQmJvE"

What’s wrong with this one, though ? It gets both the best MP4 vid and the best M4A audio (FFmpeg/avconv required), and otherwise the best MP4 combination (which in this case is anything but best, but that’s YT’s fault, not ytdl’s):

youtube-dl -v -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]" "4ukOvwQmJvE"
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to download the best video along with the ... - Ask Ubuntu
Here you download the best video and audio seperately and then merge into a, in this case mp4 file. You can change the...
Read more >
How to Fix Audio Codec Not Supported Error?
Due to various reasons, you may receive a video audio codec not supported error. The top reason is the inability of the player...
Read more >
What ffmpeg command line produces video more compatible ...
Command line used to encode MP3 audio into MP4 files. "C:/server/ffmpeg/bin/ffmpeg.exe" -y -i Z:/server/websites/ps/public_www/media ...
Read more >
PowerPoint cannot insert a video from the selected file
Video : We recommend that you use .mp4 files encoded with H.264 video (also known as MPEG-4 AVC) and AAC audio. This is...
Read more >
If an audio or video file doesn't play on Mac - Apple Support
Some apps prefer specific formats, but QuickTime movie files (.mov), most MPEG files (.mp4, .m4v, .m4a, .mp3, .mpg), some AVI and WAV files,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found