Youtube 4K Video Downloads

This is a general guide for downloading video from youtube, but I’ll include some specifics for 4K video.

First thing you’ll need is youtube-dl. This is a command line utility. It’s actually python based, but there’s an all-inclusive windows exe file that you will be using. Note that this exe file is actually a self-executing archive that contains all the python runtimes and scripts, and because of this it tends to freak out windows defender. It will very likely continually prompt you to send the file for analysis. Do it or not. Up to you. This executable is all you need for mp4 downloads up to 1080p. For different format muxing and for 4k downloads, you’ll need a copy of ffmpeg as well. I just grabbed a static 64bit build. You can extract the ffmpeg.exe binary and put it in to the same folder as youtube-dl.exe.

For your basic usage, just run youtube-dl [youtube url] and it will automatically grab the best single (audio+video) file for you in mp4 format. This will be anything up to 1080p.

Laziness is the mother of invention, apparently, so I created a quick batch file to grab a list of URLs. I discovered afterwards that youtube-dl has a batch download function, but I had problems with it, so I reverted back to using my batch file:

Because I am cunning, I named the file ‘get.bat’ (put it in the same folder as the youtube-dl binary) and stuck the below line in to it.

@For /F "tokens=1" %%A in (get.txt) do youtube-dl -o "%%(title)s.%%(ext)s" %%A

Then, create a file called ‘get.txt’ (same folder as get.bat) and put your youtube URLs, one per line:

https://www.youtube.com/watch?v=dQw4w9WgXcQ
https://www.youtube.com/watch?v=kfVsfOSbJY0

Then simply run get.bat and you’ll soon have a bunch of mp4s.

Rename the batch file and text file as you wish, just remember to edit the batch file so it knows the new name of the text filename you chose.

4K Downloads

Any video on youtube that has a res higher than 1080p is a video stream only. The audio stream is separate and requires muxing in to a single file. Fortunately youtube-dl can do this for you, but it requires the presence of ffmpeg.exe, so if you haven’t grabbed it yet, go get it.

Make sure the youtube video you want to download in 4K actually has a 4K stream. On the youtube video page, if you go to settings-quality on the vid, 2160p should be listed. I’ve come across at least one supposed 4K video that wasn’t.

If you need a specific video and audio codec, you can see what is available on the video by running:

youtube-dl -F [video url]

You can use the format bestvideo+bestaudio and let youtube-dl figure it out for you, but I’ve had problems with that as it usually selects the Opus audio stream, which my TV doesn’t like, so I manually select vorbis. I could use bestvideo+171 which would work for me in most cases, but my TV is finicky, and I know it likes the webm format (VP9), so my preferred formats are 313+171, which all of the 4K vids I have downloaded so far have had, and they work brilliantly.

So create a ‘get4k.bat’ file, and add the line:

@For /F "tokens=1" %%A in (get.txt) do youtube-dl -o "%%(title)s.%%(ext)s" --format 313+171 --merge-output-format mkv %%A

This uses the same ‘get.txt’ as the previous batch, but change it up as you like. Also change the format parameter to your preferred streams.

Note that I have specified the output format to be mkv. If you change this to mp4, youtube-dl doesn’t like it. It might have something to do with the specific formats and the container type, but it will throw a header write error. If you change the output format back to mkv, it will merge the already downloaded formats into the mkv file (so you don’t have to worry about downloading that huge video stream again).

Youtube-dl can be used for other video sites, not just youtube. Check the docs for info.

DSL users need not try this. :joy:

did you find any decent 4k content?

Are you playing directly though your 4k TV, or going via a media streamer?

Yes, just search youtube for “4k video” - there’s tons of stuff. One of the more amazing ones is the Costa Rica in 4k, but way too many snakes for my liking :frowning:

I tried casting the 4k video using windows 10 built in casting, but it couldn’t handle the video file formats.

Although the (Samsung) TV picks up Plex, it didn’t like streaming the 4K videos from it. I tested via USB which worked fine for most files, but I had to adjust the download format to what the TV liked - I think the primary problem was the audio stream, which defaulted to Opus on a lot of the videos.

Ultimately I downloaded Samsung Smartview, and cast the 4k videos via that. It works like a charm, also considering my TV is connected via wireless. The Windows version just does basic casting. The android version on my phone is a full on remote as well. You can supposedly actually watch what’s on the TV via Smartview as well, but I haven’t figured that out yet (or I’ve just misunderstood their crappy marketspeak).

I’m considering getting the Roku 4 which handles 4k … problem is I can’t connect to an AV amp if i stream directly to the TV :frowning:

You will need a receiver that has HDMI HDCP 2.2 ports in order to view 4k content via it. You would hook up the roku to the receiver. You will need a minimum 25mbps internet connection though.