ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132k stars 10.01k forks source link

Get Best Video Quality Size #14631

Open parsasaei opened 6 years ago

parsasaei commented 6 years ago

How can I get the size of best video quality with mp4 format ? Is there anyway?

tobijjah commented 6 years ago

youtube-dl -F URL | grep mp4 should do it, if you are using linux. Otherwise just youtube-dl -F URL and search the list for mp4. By the way checking the man with youtube-dl --help could help. Please, close this issue by yourself if my reply answers your question.

Hrxn commented 6 years ago
rautamiekka commented 6 years ago

--format "(bestvideo+bestaudio)[ext=mp4]/best[ext=mp4]" tries best video quality with best audio, making sure it's MP4 but if that fails it takes the best existing MP4 combination instead.

If I were you I'd use --format "bestvideo+bestaudio/best instead, so it gets the best video with best audio, using FFmpeg or avconv to combine them, otherwise taking the best existing combination. Once the result is downloaded, use FFmpeg or avconv to convert to MP4. That's a story for another time and without research I can't tell what command to use.