Open SamLevin1999 opened 4 years ago
After reading the FAQ 5-6 times i've came up with this line
-f bestvideo[height<=2160][ext=mp4]+bestaudio[ext=m4a]
now it always downloads files in .mp4 format. but i'm okay with that. It would still be great if someone could answer the question...
This can maybe be interesting? Choose best video and audio, mix webm and mp4.
youtube-dl -f bestvideo+bestaudio --merge-output-format mkv [http_link]
Or this script? https://askubuntu.com/a/965815
I tried downloading this video in 2160p [4K] format and I used
-f bestvideo[height<=2160]+bestaudio[ext=m4a]
but it ended up in being an .mkv file.Then I tried the following commands:
bestvideo[height<=2160]+bestaudio[ext=m4a]/bestaudio[ext=webm]
bestvideo[height<=2160]+bestaudio[ext=m4a]/best[ext=webm]
bestvideo[height<=2160]+bestaudio[ext=m4a]/bestvideo[height<=2160]+bestaudio[ext=webm]
but none of them worked, is it possible for youtube-dl to automatically select m4a when video file is mp4 and webm audio file for webm video ? I have read the FAQ section for format selection but still can't seem to figure it out. Is this feature available ?
The problem is with the bestvideo[height<=2160]
. As webm video has higher bitrate, it's getting selected with m4a audio. However, mp4 container doesn't support vp9 codec. So, mkv will be automatically used.
After reading the FAQ 5-6 times i've came up with this line -f bestvideo[height<=2160][ext=mp4]+bestaudio[ext=m4a]
As you are explicitly mentioning the video extension here, it will pick the h.264 (i.e avc) video. As mp4 container supports both h.264 video and aac audio codecs, it will be used.
but none of them worked, is it possible for youtube-dl to automatically select m4a when video file is mp4 and webm audio file for webm video ? I have read the FAQ section for format selection but still can't seem to figure it out. Is this feature available ?
I don't think so. However, the following can be used to achieve the same.
-f 'bestvideo[height<=2160][ext=mp4]+bestaudio[ext=m4a]/bestvideo[height<=2160][ext=webm]+bestaudio[ext=webm]'
Checklist
Question
Hi, I tried downloading this video in 2160p [4K] format and I used
-f bestvideo[height<=2160]+bestaudio[ext=m4a]
but it ended up in being an .mkv file.Available formats for video. URL : https://www.youtube.com/watch?v=1La4QzGeaaQ
Then I tried the following commands:
bestvideo[height<=2160]+bestaudio[ext=m4a]/bestaudio[ext=webm]
bestvideo[height<=2160]+bestaudio[ext=m4a]/best[ext=webm]
bestvideo[height<=2160]+bestaudio[ext=m4a]/bestvideo[height<=2160]+bestaudio[ext=webm]
but none of them worked, is it possible for youtube-dl to automatically select m4a when video file is mp4 and webm audio file for webm video ? I have read the FAQ section for format selection but still can't seem to figure it out. Is this feature available ?