Colourising B&W footage with DeOldify

If you’ve been following the channel lately, or had one of the videos I’vae uploaded recently recommended to you, you’ll know that over the past couple of weeks – I’ve uploaded a lot of colourised black and white footage – and in this video, I want to show you just how I did it.

First things first, you’ll need a video that you want to convert – so find something on your favourite video platform: YouTube, Dailymotion, Twitch, Vimeo, or wherever else your source black and white footage is hosted.
In this example, I’m going to use YouTube because we’re all here and have access to it.

Part 1: Colourising your footage

Visit bit.ly/deoldifyvideos, and this will load what’s called a Jupyter Notebook.
What I’d recommend if you have a Google account is to Save to Drive at the top – so what this will do is store your video in a folder on your Google Drive.

It is possible to skip this step, but I’ve found it to be more reliable if it’s saved to your Drive; so it can actually save the changes to your cloud storage: whereas if you run the process from this URL to start with, it may give you an error message that files couldn’t be saved.

We’ll get to that later.

Scroll down to the bottom of the page, and where it says ‘Source URL’, paste the link of the video you want to convert.
Different sites work differently, and in my experience – when using YouTube, it’s best not to use the shortened URL but the full youtube.com link.

Now select the Runtime menu at the top and select Run All (the keyboard shortcut for this is Ctrl + F9)

While that’s running, I’ll use this time to explain what a Jupyter Notebook is. It’s a virtual environment which allows you to safely run code from within your browser in different ‘cells’
Each cell will execute different commands and snippets of code in sequence from your browser and use the computing power of a virtual computer on a server somewhere else in the world: this is called an instance.

You’ll see that the first command it runs downloads a resource from Github.
If you wanted, you could even click that link and install this software on your own computer, but this will require a lot of computing power from your own machine. I won’t go into that in this video – and don’t recommend it unless you have a powerful graphics card that can keep up with it.

Once it starts running, you’ll be able to see the output of what’s happening, and the cell that’s currently running will be represented by a spinning circle around the Play button.

The steps before the ‘Instructions’ section will install the prerequisites needed onto your instance to be able to perform the task of colourisation: it’ll download the required python libraries, and the training data for the machine learning to run from, and finally the colouriser itself.

The ‘Colorize!!’ section is the one we’ll spend most of our time, once run – we can largely ignore the section above once it’s complete.
I’d recommend keeping the render_factor at 21, and for the sake of consistency – leave the watermark enabled.

This doesn’t mean that it’s going to plaster the logo of this software onto your video; it will simply put a small palette icon at the bottom left to indicate that this colourisation was performed by an AI.
With machine learning and AI being so indistinguishable from reality, this gives the viewer an indicator that a computer had a hand in this process.

Once running, you’ll see a green and grey progress bar – depending on the length and quality of your video, this may take some time.
It will sit for a long time on 100%, but don’t worry – it is still working, and will eventually notify you that the process has complete.

Click the folder icon on the left hand side of your browser, and navigate to the Deoldify folder, then video, and result.

You should then see a file called video.mp4 – right click this, and select Download.
Again, this will take some time and will be represented by a circular, orange progress bar: once done, it’ll give you a file download dialogue box, where you can save your video to where you’d like to store it.

Part 2: Re-encoding to 4K.

Note that your video.mp4 file that you’ve downloaded will save at the same frame rate and resolution as the original source footage: with a combination of it being old, low quality footage and YouTube’s compression, this will colourise your footage, but it’ll be as equally low quality as the original.

If we truly want to bring the footage into the 21st century, we want it to be 60 frames per second, in at least 4K.
For this, I use a free command line tool called FFMPEG, and these are the parameters I used, I’ll also put this in the description, just replace the in.mp4 and out.avi filenames with your in/out filenames.
I’ve saved it to a .bat file in the folder with all my videos, so I can write a list of all the videos to convert, and just run this batch file so it processes them all sequentially, one after another.

During early experiments, I noticed that though the resolution was technically 4K, there were patches of colour in certain areas that still made it look low quality.
I applied a generic .cube file as a lookup table to help with basic colour grading, and using the same LUT file with all the different videos gives a certain consistency to the files I upload, despite them being from varying eras and image qualities.

You may also like...