Many Android devices can now support 4K VP9 and/or H.264 video decoding, but for some reasons, Google only serves 4K videos to devices running Android TV OS, as opposed to just Android, with the latter limited to 1080p videos. If for some reasons you want to watch a YouTube 4K video on a capable device, you could download it with youtube-dl script written in Python, and available for Linux, Windows, and Mac OS.
I’ve been using the script for a while to download various video or audio files from YouTube, and other website, but for the purpose of this post, I made sure to update it to the latest version:
1 2 |
sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl sudo chmod +x /usr/local/bin/youtube-dl |
If you have already installed the script, it can also be updated with:
1 |
sudo youtube-dl --update |
I’ll use one of the most popular 4K videos on YouTube as example, namely: COSTA RICA IN 4K 60fps (ULTRA HD) w/ Freefly Movi.
The first task is to list the video’s supported formats:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
<span class="crayon-v">youtube</span><span class="crayon-o">-</span><span class="crayon-e">dl </span> https://www.youtube.com/watch?v=iNJdPyoqt8U <span class="crayon-o">--</span><span class="crayon-v">list</span><span class="crayon-o">-</span><span class="crayon-v">formats [youtube] iNJdPyoqt8U: Downloading webpage [youtube] iNJdPyoqt8U: Downloading video info webpage [youtube] iNJdPyoqt8U: Extracting video information [youtube] iNJdPyoqt8U: Downloading MPD manifest [info] Available formats for iNJdPyoqt8U: format code extension resolution note 249         webm      audio only DASH audio  58k , opus @ 50k (48000Hz), 1.91MiB 250         webm      audio only DASH audio  90k , opus @ 70k (48000Hz), 2.64MiB 140         m4a       audio only DASH audio 129k , m4a_dash container, mp4a.40.2@128k (44100Hz), 4.72MiB 251         webm      audio only DASH audio 165k , opus @160k (48000Hz), 5.14MiB 171         webm      audio only DASH audio 171k , vorbis@128k (44100Hz), 5.01MiB 160         mp4       256x144   DASH video 111k , avc1.4d400c, 15fps, video only, 4.01MiB 278         webm      256x144   DASH video 113k , webm container, vp9, 30fps, video only, 3.47MiB 133         mp4       426x240   DASH video 249k , avc1.4d4015, 30fps, video only, 8.98MiB 242         webm      426x240   DASH video 275k , vp9, 30fps, video only, 7.39MiB 243         webm      640x360   DASH video 514k , vp9, 30fps, video only, 13.66MiB 134         mp4       640x360   DASH video 607k , avc1.4d401e, 30fps, video only, 14.67MiB 244         webm      854x480   DASH video 943k , vp9, 30fps, video only, 24.52MiB 135         mp4       854x480   DASH video 1111k , avc1.4d401f, 30fps, video only, 28.93MiB 247         webm      1280x720  DASH video 1828k , vp9, 30fps, video only, 49.38MiB 136         mp4       1280x720  DASH video 2220k , avc1.4d401f, 30fps, video only, 55.82MiB 248         webm      1920x1080 DASH video 3239k , vp9, 30fps, video only, 87.46MiB 137         mp4       1920x1080 DASH video 4173k , avc1.640028, 30fps, video only, 103.13MiB 271         webm      2560x1440 DASH video 10210k , vp9, 30fps, video only, 270.64MiB 264         mp4       2560x1440 DASH video 11391k , avc1.640032, 30fps, video only, 277.64MiB 266         mp4       3840x2160 DASH video 22317k , avc1.640033, 30fps, video only, 662.23MiB 138         mp4       3840x2160 DASH video 24322k , avc1.640033, 30fps, video only, 573.82MiB 313         webm      3840x2160 DASH video 31379k , vp9, 30fps, video only, 678.65MiB 17          3gp       176x144   small , mp4v.20.3, mp4a.40.2@ 24k 36          3gp       320x180   small , mp4v.20.3, mp4a.40.2 43          webm      640x360   medium , vp8.0, vorbis@128k 18          mp4       640x360   medium , avc1.42001E, mp4a.40.2@ 96k 22          mp4       1280x720  hd720 , avc1.64001F, mp4a.40.2@192k (best) </span> |
So we can see there are lots of different formats for a given video with different resolution, container formats, and bitrates. You have to find the lines you want and select the corresponding “format code” in the first column to download the video and audio. I’ll select 313 for video and let the script select the best audio format:
1 2 3 4 5 6 7 8 9 10 11 12 |
youtube-dl https://www.youtube.com/watch?v=iNJdPyoqt8U -f 313+bestaudio [youtube] iNJdPyoqt8U: Downloading webpage [youtube] iNJdPyoqt8U: Downloading video info webpage [youtube] iNJdPyoqt8U: Extracting video information [youtube] iNJdPyoqt8U: Downloading MPD manifest [download] Destination: COSTA RICA IN 4K 60fps (ULTRA HD) w_ Freefly Movi-iNJdPyoqt8U.f313.webm [download] 100% of 678.65MiB in 04:03 [download] Destination: COSTA RICA IN 4K 60fps (ULTRA HD) w_ Freefly Movi-iNJdPyoqt8U.f171.webm [download] 100% of 5.01MiB in 00:01 [ffmpeg] Merging formats into "COSTA RICA IN 4K 60fps (ULTRA HD) w_ Freefly Movi-iNJdPyoqt8U.webm" Deleting original file COSTA RICA IN 4K 60fps (ULTRA HD) w_ Freefly Movi-iNJdPyoqt8U.f313.webm (pass -k to keep) Deleting original file COSTA RICA IN 4K 60fps (ULTRA HD) w_ Freefly Movi-iNJdPyoqt8U.f171.webm (pass -k to keep) |
The “+” sign is used to merge video and audio. If you don’t add an option for audio, only the video without audio will be downloaded. You can also run “youtube-dl URL” without options, and it should download the video with both “best audio and video”, but you don’t have full control over the exact format of the video.
Youtube-hd script has many others options, include support for YouTube playlist downloads so it’s a very useful script.

Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress