There is no secret that I am a huge MacGyver fan – the original one, not so much the current reboot one. Richard Dean Anderson apparently has a knack for joining TV shows that shoot in different formats during their airing. Much like Stargate SG-1, MacGyver’s first season was shoot on 16mm and then later moved to 35mm, there is a rumour that the edit was done directly to film, and most of the B-roll footage is 3rd party and in most cases in really bad quality (not bad like JAG’s tho). About a year ago Paramount graced us with a BluRay release of MacGyver’s first season but the others don’t seem to be happening. Well, a good thing is, that AI has progressed so much, upscaling video in 2020 (yes only a few days to go) does not necessarily mean bad quality with a bucketload of video artefacts.
This has been made every easier by the good folks over at Topaz. Their A.I. Gigapixel upscales and cleanups your images. And well with a bit of ingenuity it cal also with video. Below is a short tutorial on how I upscale those glorious MacGyver episodes so I can watch them on my TV.
Here is a list of what you will need:
- Topaz A.I. Gigapixel
- A decent PC (Graphics card)
- Loads of disk space (about 100GB to work with)
1. Preparing your workspace:
First, of your set up a few folders I like to do two of them, one is for the video file and the extracted images (you will see in a bit) and the other is for your export. That is basically it.
2. Exporting video frames from the source video:
Now since Topaz A.I. Gigapixel is made for images in mind, we first have to export all the frames from our MacGyver episode to PNG files. You could use JPG files if you wanted to but even at full quality jpg files can produce certain artefacts so I would recommend sticking with PNG’s.
First of extract the FFmpeg and put the ffmpeg.exe file inside the folder where your source video is located. Now open your cmd and navigate to the folder with ffmpeg.exe and videos source file. And use the following command:
ffmpeg -i example.avi example%04d.png -hide_banner
What does this command mean?
- example.avi is the source file for this example command. Change it accordingly to match your source video and extension.
- example%04d tells FFmpeg how to name the frames (example0001.png, example0002, example0003 and so on).
- .png is the extension of the exported frames. As stated above I suggest using PNG’s due to the better quality export. Mind you they do take a bit more space than JPG’s would.
- -hide_banner hides FFmpeg compilation information. Use this or don’t doesn’t really matter.
You will see something like this:
Once it’s finished you will find yourself with a folder that will include a huge amount of image files.
Now open up your Topaz A.I. Gigapixel and import a single frame to see how it looks like. In my case, I decided to upscale my DVD of MacGyver’s 1st episode of season two.
To my big surprise and I imagine yours this is the automatic result (even due to the fact that the above image is web-optimized you can still see the plain difference in quality). I only set the wanted height of my new video (1080) and the output folder. Now since MacGyver was shot in 4:3 that means that my exported frames will be 1440×1080 in size – before you get your panties in a bunch even the official BluRay used this resolution.
Now comes the hard part, for your Graphics card that is. Make sure you have the latest drivers so your CUDA or CLI cores can be used to their maximum. Upscaling takes time. There is no way to speed it up other than getting a new PC. Just be patient it will get there.
3. Exporting the audio from the source video file:
After the process is done you also need to extract the audio of your source video file. You can’t really enjoy a show without audio right? Again we turn to the mighty FFmpeg with the following command:
ffmpeg -i example.avi -vn -acodec copy audio.wav
4. Combining everything together:
Yet again, FFmpeg is here to help. First of copy it to the location where you exported your upscaled frames you will also need your exported audio file in this folder as well.
ffmpeg -r 23.970628 -f image2 -s 1440x1080 -i example%04d.png -i audio.wav -vcodec libx264 -crf 20 -pix_fmt yuv420p -acodec copy final_video.mp4
All you have to do now is wait for FFmpeg to finish and you will have a nice upscaled video of your favourite old TV show, without having to wait for over 40 years for a proper release form the studio.
Disclaimer: This post is not meant to encourage any sort of piracy. I own all of the MacGyver DVD’s and season 1 on BluRay that were mentioned in this post.