Skip to content ⏩
Voxels.
Theme:

FFMPEG is still your friend ~ How to avoid sketchy video download sites

Published: Wednesday, March 30, 2022
windows survival guideffmpeg

You would download a car

Every once in a while, a friend will ask me for help downloading a video [...](/blog/2022-02-28). This is a follow up to the last post and covers a way to download videos without a website in the middle.

The first revision of this article is for Windows, I may update it with alternate guides on Mac and on Linux.

When you go to a website that has a video on it, the most basic implementation that it uses in just embedding the video file directly. You might even be able to right click the media and save it just like you would an image, or sleuth the URL of the file to download it. There are some downsides to this, though, and adding more performance or features (as well as trying to deny you an easy way to have the video) are reasons a website might use a more complicated video player. YouTube is the biggest example of this, and it can be annoying. YouTube does let you sort of download a video if you have Premium, or if you are the uploader, but neither of those ways are that empowering. Usually you already have the video, and in better quality, if you are the uploader. And for Premium downloads, it's not very customizable and isn't just a plain old video file. But if you can see it on your screen and regard its contents, then there must be a way, right?

Python

Python is a very popular programming language. Some would argue that in 2022, it is the most popular. Someone solved this problem with Python, and we can use their solution for free not counting the fact that we need our own computer and internet connection.

FFMPEG deals mostly exclusively with files on your computer already, so although it will be useful after the video is downloaded, it does not help get the video.

The program we will use, that is written in Python, is "yt-dlp". Like FFMPEG, it is a command line application that needs to be interacted with through special text commands. It requires that Python is installed on your computer, and fortunately this is easier than it was for FFMPEG since an installer is provider for you. Get the latest version from python.org.

While installing, I recommend and will assume that you will check the option for including the 'py' launcher and adding things to your PATH.

The Python installer

Installing Python. Note the highlighted checkbox option on the first page to 'Add Python 3.X to PATH'.

Clicking through default options for anything else is probably fine. We'll only use this for one program, but you might also be interested in learning to code a little yourself with Python, you might as well if you already have it!

yt-dlp

Open up Windows Terminal, or re-open if it was already open, and type the following:

pip install --upgrade yt-dlp
Terminal open, having installed yt-dlp
Installing yt-dlp.

I will explain this command in a moment, but you can repeat it exactly to check for or apply updates to yt-dlp in the future. YouTube sometimes breaks it so that may be necessary after it gets fixed again.

There is a wall of text but if all goes well, not too much should end up red after it finishes downloading. It'll say "Successfully installed blah...". pip comes with Python, it downloads Python things. Where did it download from? The Python Package Index, a website that lets you download many thousands of python programs (and, modules, but I won't go into that here) for free. It's all very nice. I am sure you could guess that install instructs the pip program to install. --upgrade has those two minus signs in front of it. Does that decrement the upgrade? No, that's just a tradition for options with readable names. A way to consider it is that slightly changes the install behavior. Rather than "Hey! I already have this, I will do nothing", it checks for if there is an update available. It applies it if so. The final part just names the package. If pip was a person you were asking a favor of, this is in the normal grammatical order in English. "Pip, install and maybe upgrade the yt-dlp package."

Pip from ORB
And Pip. Hi Pip.

The only step left is to start using yt-dlp. Basic operation downloads a video to the current directory. If you haven't dont any commands other than the pip one above, that will be your user folder. To download to your downloads folder, use cd Downloads. It will now download there. The download command is just yt-dlp LINK TO VIDEO, like so:

Using the terminal to download a video
Downloading a video.

And sure enough, if we open File Explorer and visit our downloads folder...

The downloaded video in File Explorer
It's here!

And that's a wrap

Hold on. Suppose I wanted a mov file of this video! How do I get that?! That is when we can turn to FFMPEG. We can pass it the downloaded video as an input (don't forget quotes if the video has spaces in the file name, which is likely), and just output a mov. The simple command would be ffmpeg -i "my youtube video.mp4" "my youtube video.mov". This sometimes takes a while. In some scenarios, you can accomplish the same at a very fast rate by adding -c copy between the video file names. This is because it skips re-encoding the video, and just moves it from one container to the other. The details are complicated.

yt-dlp has a lot of features that make it very handy when you also need something specific, like a list of videos from a playlist or just the audio. Perhaps I will cover that in a future article. 🔣