How Did I Upscale Star Trek: DS9 Footage to 4K?


Note: I have made a better version of this tutorial, which you can see here.

Hello everyone, sorry for the long wait. I had promised a tutorial on how I upscaled SD video from Star Trek: Deep Space Nine. I also promised to get you some more upscaled DS9 footage. You'll get both if you just keep on reading.

But before I begin I want to just thank everyone for the great response to my 'DS9 Remastering Using Machine Learning' proof of concept. I read a lot of enthusiastic comments and this mini-project was even featured on TrekMovie.com and io9.com. Whenever my stuff gets mentioned on the big news sites that I read myself, I get a big kick from it.

More Upscaled DS9 Footage

Over the past few weeks, I have gotten a lot of great feedback from a lot of people. Not everyone could see the improvements my machine learning method was able to produce for example. Looking back, I could see why:
  • YouTube did a number on the compression of some videos. On the 4K intro the 1080p resolution was much better than on the other videos, which had a max resolution of 1080p.
  • The frame-by-frame and the side-by-side video didn't really show off the changes as well as other formats could have. They showed that the image was crisper, but didn't convey the improvement in details as well as it could have.
  • The full 5 min video 1080p, that I had to host somewhere else, didn't come out as 1080p either. I hadn't noticed that in my rush to get news of this project out the door.
With these lessons learned and some improvements in my upscaling program (AI Gigapixel), I think I've made a much better trailer this time around. Hopefully, this can show everyone the promise machine learning has for upscaling old TV shows like DS9. So without further ado:



Note: I handled YouTube's compression algorithm much better this time around, but it still downgrades it slightly. You can download the source file here if you want to see it in its original glory.

EDIT: Here's an image slider with which you can compare a before-after scene yourself.

How To Upscale Video Yourself

Now on to the tutorial part of this post. To extract, convert and upscale footage I used the following tools:
So go ahead and download those programs. Keep in mind that extracting an entire episode requires quite a bit of free space on your hard drive. The episode I exported needs 29 GB for the original frames. If you upscale to 1080p this will add another 72 GB. If you upscale to 4K you will need around 180 GB for the full episode.

This is all for Windows, by the way, I don't know how it would work on Mac or Linux.

Step 1. Export The Frames Of The Source Video

You will use FFmpeg to extract the individual frames of the source video. This is the tutorial I used,  which tells you about more options.

Click to enlarge

I will tell you how to export the entire episode below:
  1. Get your source video and put it in a folder you can easily work from.
  2. Put ffmpeg.exe in the folder you also put your source video into.
  3. Open up command prompt (cmd)
  4. In cmd, navigate to the work folder. Do this by typing in: cd C:\Users\\Desktop\Work. The part after cd depends on where your work folder is of course.
Now you will give FFmpeg the command to export the frames. Type in:
ffmpeg -i sacrificeofangels.mkv soa%04d.png -hide_banner
 What does this all mean?
  1. sacrificeofangels.mkv is the source file in my case. Change it to the name and extension of your source video file.
  2. soa%04d tells FFmpeg how to name the frames (soa0001.png, soa0002, etc.). Soa is an abbreviation of the episode title, which helped me keep multiple video's worths of extracted frames organized.
  3. .png is the extension of the exported file. PNG is bigger than JPG, but JPG creates extra artifacts that the uspcaling program can't handle very well. So the lossless PNG format is preferred.
  4. -hide_banner hides FFmpeg compilation information. Personal preference.
When you press enter on the filled in command, FFmpeg will get to work. This will take some time. Do something else in the meantime. Watch some Star Trek on Netflix, for example :)

Step 3. Upscale The Frames To 1080p/4K

You will use AI Gigapixel to upscale the frames from the SD original. There's a lot of things you can with Gigapixel, but I will focus on the settings that I used to upscale my DS9 footage. The program is very simple to use, so I suggest you just try out all the different settings on some photos to see what the effects of everything are. The program has been refined a lot over the past months, so all official tutorials are out-of-date. Trial-and-error is the quickest way to get a hang of this software.

Once you've installed the program, open it up. Drag one of the exported frames to middle of the program's window. You will then be shown something that looks like the screenshot below.

Click to enlarge

Below I will explain what all settings mean:
  1. You can base the upscale's resolution by scale, width or height. I chose height, because...
  2. I want to make the upscaled image have the height of 4K footage, so I input 2160 pixels. Full HD has a height of 1080 pixels.
  3. Suppress Noise and Remove Blur can improve the quality of the end result. This really depends on the project. Just try out everything to see what gives the best result for your project. I chose Low and Low, as it gave just a bit of smoothing/noise removal without going overboard.
  4. In my workflow I saved to a Custom Folder. This allows you to export your upscaled images to a different folder (I have one for original frames and upscaled frames). Ignore Prefix and Suffix.
  5. For video it's best to output in JPG format. It is smaller and results in a fast upscale process. Since the original is PNG, you will need to choose Convert File Format: Yes. The few artifacts created by the JPG format at Maximum Quality won't be noticed when you later convert the frames to a video. Keep Color Profile to Yes, as it's faster.
Click Start to upscale the image. Upscale the original image until you are happy with the results.

Once you have a working setup, you can start upscaling footage. Select a few hundred frames when first getting your footing with this whole workflow and drag and drop them in the window. Upscaling an entire episode can take a long time, so start small.

How many frames you can upscale in one go depends on your PC's specs. It can be 1000s, 10000s, etc. You'll just have to find out for yourself.

Step 4. Exporting The Audio Of The Video

With Audacity you will rip the audio from the source file.

  • Open up the video file in Audacity.
  • Once it's loaded, go to the File > Export Audio.
  • The file type you save it as depends on the program you use to create a video from all the individual frames. For my project, I used VirtualDub, which can't take all audio types. In this case, I use WAV 16-bit PCM.
  • Save it and you're done.

Note: the source file for the DS9 video that I used had 5.1 surround sound. Basically, there are multiple audio layers. I have not yet figured out how to get the sound as surround sound into a format that VirtualDub can work with. Saving it as WAV16-bit PCM will collapse this into a mono format. It's okay for test purposes, but not for a final product. Let me know if you know how to get 5.1 surround into VirtualDub.


Step 5. Combining The Frames And Audio Into A Video

Everything will be brought together in VirtualDub.

Click to enlarge


  1. Go to the Video menu. You will find Frame Rate and Compression there. Open up Compression.
  2. Get the x264 encoder. If you don't have it, download it here. Click on Configure.
  3. Here you can determine the quality. I found the settings as displayed the most appropriate.
  4. Go to the Frame Rate menu. Set the frame rate in the two fields to the frame rate of the source video. For DS9 this was 29.970628 (a common frame rate). Click OK
  5. Go to the Audio menu. We need to make sure Interleaving is set up correctly. Click OK.
  6. In the Interleaving menu, set everything as displayed above. Click OK.
  7. Make sure Sync to Audio is on in the Options menu.
Now everything is set up, you can go to File > Save as AVI. Save the file and let it render. You can uncheck Show Input Video, Show Input Video and set the processing thread priority to a higher priority to make the video export faster (at the cost of having fewer resources available for other programs).

This is how I did it. No doubt there are alternatives/improvements to the above workflow. If you have knowledge about these kinds of programs, please leave your suggestions in the comments below.

The Future Of Upscaling Old Footage

This blog post marks the end of this small side-project. While I would love to release full episodes, this is just not legally possible. The videos I made were a proof of concept for CBS, but also other companies, to look into machine learning and neural networks to help remaster old shows where traditional remasters are either too expensive or impossible due to lost originals.

While entire episodes might be out of the question, now that I've shared my workflow with the rest of the world it should be easier for others to try these methods out on clips and segments themselves. Go out and try it out yourself on DS9s battles of the Dominion War. Or go and see what this could do with Babylon 5 or other great shows that are still stuck in the SD era.





Comments

Byronotron said…
Wow. That video is absolutely incredible. Jaw dropping work. It rivals the WWLB footage. Standing ovation, this video is so much better than all of the others and shows that this is absolutely doable. I think it's time for the fans to take this into our own hands.
Chris Dale said…
Brilliant work, and thank you so much for publishing this! It's inspired me to upscale a few SD clips and the results have been similarly encouraging - but may I ask what software you use to convert the AVI to the MP4 that you then put on YouTube? I normally use Handbrake but it doesn't seem to produce a 4K result...
AlfredQack said…
This comment has been removed by the author.
Tom_7 said…
Where do you choose in Virtualdub the folder containing the upscaled pictures ?
Stefan said…
This comment has been removed by the author.
Stefan said…
Thank you very much for showing this Proof of Concept. I have tried to dublicate your method and I have come up with the following:

RTX 2080 (non TI) @ 2000MHz + AI Gigapixel = 1 upscaled frame per second
--> 25fps x 60sek (in a minute) x 45minutes per episode = 67500 frames
67500 frames = 67500sek rendering time = 18.75 - ca. 19 hours of rendering per episode.

My PC consumed ca. 500Watts constantly while rendering - equals 9.5kWh per Episode (in Germany , where I live thats's ca. 2.6€ (@0.28€/kWh)

26 Episodes x 7 Seasons = 182 episodes (x 2.6€) = ca. 500€ of costs of electricity alone :(

This has not factured in the cost of buying AI Gigapixel (currently running as a trial).

I find the idea of an updated DS9 or VOY awesome - hopefully some time in the future the process will not be so tedious, time and energy consuming ;)

Best wishes from Germany and thank you for showing what is possible.

Update 1: I am currently trying to render parts of an episode in 4k - I can open 20.000 frames at a time in AI Gigapixel (i5 7500k, 16GB RAM, RTX2080 (8GB Video Memory)) without a problem. My taskmanager tells me that video memory is not used above 4.8GB at a time, while system memory is used up to 6.3gb (total). I am using AI Gigapixel v. 4.03

The total render time for a double episode (90min) would be 6 days :( and the resulting video file would be 2.2TB (uncompressed) - this is not something that you'd want to do on the whole library - hopefully somebody at CBS sees the potential and greenlights a remaster.
Pyrometheous said…
You can use MKVToolNix GUI to directly take the surround sound source and put it into your final video render. It would mean that you'd have to wait until you've rendered a full episode at 1080p/4k, but you wouldn't be compromising the audio in any way, it would just be the original audio track.

Thank you for sharing this information, I'm eager to try it out myself. I was thinking about doing just the intro of DS9 to start with, just to get my toes in the water, but I'm excited to see how much I can potentially do with this.

I have a question about AI Gigapixel though, if you buy the license, how long is it good for?
AlfredQack said…
Its a lifetime licence. The support warranted me lifetime updates also.
Stefan said…
Thank you for the tip with MKVtoolNix - I have successfully extracted the audio (and subs) with it and will try to add it back to the rendered video.

I would also export the frames using VirtualDub but do it uncompressed - the resulting video AVI will be humongous but I want the final file to be x265 HEVC and I want to use Handbrake x265 NVenc (GPU encoding) which will speed up the render considerably.

BTW: humongous meaning that a double episode would be 2.3TB large ;)
Pyrometheous said…
I wrote a script to export the frames to PNG using ffmpeg, I had that run while I was asleep last night and woke up to them being completed. I'm gonna try the trial of AIgiga tonight to check it out. Do you know if they have a command line tool at all? I'd love to write a script that just automatically unpacks the frames, upscales the frames, join the frames back into a video, mux the audio from the original file, then finally encode it with x265.

I'm pretty sure the other tools all have command line utilities, so I suppose the worst case scenario is having to upscale each frame in 1000ish frame chunks. A bit tedious, but I can't imagine AIgiga doesn't offer a command line utility. I'll have to do more research tonight. I'm stupid amounts of excited about this. Especially if I can turn this into a single click action that can up convert my older shows one episode at a time while I'm at work.
Pyrometheous said…
So I've got it installed, did my first 1000 frames, had a little bit of a "wobble" effect on one scene, but overall I'm satisfied with the result, something like that would likely go away after x265 compression. But after doing some research with AI Gigapixel, it really appears that there are no command line tools for it. Selecting 1000 images (Let alone 10k, which is my current batch test) takes long enough as it is. At this rate, it looks like 1 week (because of sleep and work) is the turnaround time for a single episode (which I gather to be about 65k frames).
AlfredQack said…
How do you upscale a frame per second? I only get 32 Frames per minute with a RadeonVII.

Upscaling to FHD, no 4k.
Pyrometheous said…
The script I use to render the frames together uses FFMPEG, similar to OP's script to extract the frames. You can set the framerate to whatever you want, but I took the framerate from the source file so that it matches. I also use the "-crf 0" option to render it as lossless (I plan to use handbrake to compress it via x265 later).

The variables "FFMPEG" and "outputdir", should be changed to reflect your configuration more accurately. "outputdir" needs to be the location of your upscaled frames, in my case, I've chosen to use PNG files, if you're using JPG files as OP advises, then you'll need to change that in the script to match. The "filename" should be set to whatever the prefix of your upscaled frames is.

This is a batch script, being used in Windows, however if you're on Mac OS or Linux, you could use a bash script instead, it should be somewhat similar, though you'll want to look up the command line options for the appropriate OS you're using, and change your variables as needed.

Script:
@ECHO off
set filename=Star.Trek.DS9-s05e01.Apocalypse.Rising
set FFMPEG="G:\Recordings\2019\05 (May)\05.06.2019\DS9 1080p Remaster\ffmpeg-20190506-fec4212-win64-static\ffmpeg-20190506-fec4212-win64-static\bin\ffmpeg.exe"
set outputdir=G:\Recordings\2019\05 (May)\05.06.2019\DS9 1080p Remaster\HD Frames\
cd "%outputdir%"
%filename%_HD.mpg
%FFMPEG% -i %filename%.%%09d.png -r 23.976 -c:v libx264 -preset ultrafast -crf 0 %filename%_HD.mkv
pause
Stefan said…
I have successfully upscaled a home video from my childhood (from a PAL DVD source). My 7500k +16GB Ram + 2080 (non-TI) have rendered the video ( ca. 90min, 120,000 frames) in 5.5 days (to 4K). I was able to open 60,000 frames in AI Gigapixel in one go - it took ca. 1.5 hours just to open but than my pc does the rest of the work alone unsupervised.
Stefan said…
Update:
1. makemkv - rip home video dvd to mkv
2. ffmpeg -i homevideo.mkv homevideoframe%06d.png -hide_banner
3. AI Gigapixel (could open 60,000 frames easily) - 2x or 4x medium high
4. VirtualDub (uncompressed) to an external hdd --> 2.2 TB avi (!)
5. Rip Audio from original mkv with "mkvtoolnix" (just unselect video file and start multiplex)
6. handbrake - open 2.2tb avi (no preview and the time to finish was wrong): x265 NvEnc @ 24quality (slow) - render time determined by hdd speed (5fps) = 100MB/s
7. mkvtoolnix - multiplex audio (and subs if available) + video
8. you're done - everything is in sync.

Result: My home video was upscaled x4 (4K) and the resulting 90min video file incl. audio (uncompressed) was ca. 6GB - no compression artefacts.

My old home video was only shot in stereo (audio) but I think that other audio sources should be transferable without any hickups.

Best wishes
Pyrometheous said…
Okay, I've finally got all of my frames upscaled to 1080p. However when I did everything, my audio was out of sync, and I discovered that when I merged my frames with FFMPEG I was missing 2minutes worth of video in contrast to the original file. Also, it looks like that lossless AVI turned out to be 70GB in size. I noticed that the framerate was variable too, I'm not certain, but I'm curious if that had something to do with the loss in 2min of video. Anyway, here's my batch file script for the final render. The FFMPEG options will change, and my video file variables need to be cleaned up a little, but outside of that this works as a 1 click solution to merge the HD PNG files into a video with the original chapters, audio, and subtitles, effectively this does everything but extract the frames from the video and tell AI Gigapixel to upscale the frames (because apparently there isn't a command line tool for it yet).

Hopefully this is helpful for some of you. You'll need FFMPEG, HandBrakeCLI, and MKVToolNix installed/available on the computer you're running this on. It's also a batch file script, so you'll need to be running it on a Windows OS.



@ECHO off
::Declare Apps
set FFMPEG="G:\Recordings\2019\05 (May)\05.06.2019\DS9 1080p Remaster\ffmpeg-20190506-fec4212-win64-static\ffmpeg-20190506-fec4212-win64-static\bin\ffmpeg.exe"
Set HandBrake="G:\Recordings\2019\05 (May)\05.06.2019\DS9 1080p Remaster\HandBrakeCLI-1.2.2-win-x86_64\HandBrakeCLI.exe"
Set MKVmerge="C:\Program Files\MKVToolNix\mkvmerge.exe"

::Declare Video Files
set filename=Star.Trek.DS9-s05e01.Apocalypse.Rising
set outputdir=G:\Recordings\2019\05 (May)\05.06.2019\DS9 1080p Remaster\HD Frames\
Set InVideo="G:\Recordings\2019\05 (May)\05.06.2019\DS9 1080p Remaster\HD Frames\Star.Trek.DS9-s05e01.Apocalypse.Rising_HD.mkv"
Set OutputVideo="G:\Recordings\2019\05 (May)\05.06.2019\DS9 1080p Remaster\Star.Trek.DS9-s05e01.Apocalypse.Rising_HD.mkv"
Set OutputVideoFile="G:\Recordings\2019\05 (May)\05.06.2019\DS9 1080p Remaster\Star.Trek.DS9.S05E01.Apocalypse.Rising.mkv"
Set HDInput="G:\Recordings\2019\05 (May)\05.06.2019\DS9 1080p Remaster\Star.Trek.DS9-s05e01.Apocalypse.Rising_HD.mkv"
Set SDInput="G:\Recordings\2019\05 (May)\05.06.2019\DS9 1080p Remaster\Star.Trek.DS9-s05e01.Apocalypse.Rising.mkv"

::Do Stuff
cd "%outputdir%"
%FFMPEG% -i %filename%.%%09d.png -r 23.976 -c:v libx264 -preset ultrafast -crf 0 %filename%_HD.mkv
%HandBrake% -i %InVideo% -e x265 -r 23.976 -w 1620 -l 1080 -q 20 --cfr -f av_mkv -o %OutputVideo%
%MKVmerge% -o %OutputVideoFile% %HDInput% -D %SDInput%
pause
Pyrometheous said…
I've redone the merging of the frames and I'm still about 2min short, so I've decided to re-extract the frames. I'm hoping that maybe the first time around I didn't get all of the original frames from the video. So hopefully I'll actually have an HD episode of DS9 by the end of the day.
Pyrometheous said…
I discovered that my issue is related to the original frames extraction having an error

https://imgur.com/BsSr3kU

By chance is anyone familiar with this particular error. The best I have found is that the video file is malformed, I'm not entirely sure what that means though.

Back in research mode, at least I have a direction to move in.
Pyrometheous said…
Update:
It looks like my original file was "malformed" (whatever that means), but I'm working on using a different episode as my next attempt, now that I know to look for an error, I can/will.

I've also updated my scripts to make the process smoother. So here are my steps:

1) Create a batch file in the location of your original standard definition video
paste the following into the batch file, save, and run the batch file:

@ECHO off
set filename=Star.Trek.DS9-s05e02.The.Ship
set FFMPEG="G:\Recordings\2019\05 (May)\05.06.2019\DS9 1080p Remaster\ffmpeg-20190506-fec4212-win64-static\ffmpeg-20190506-fec4212-win64-static\bin\ffmpeg.exe"
set WorkingDir=%~dp0
set OutDir=%WorkingDir%frames\
if not exist "%OutDir%" mkdir "%OutDir%"
set video="%WorkingDir%%filename%.mkv"
set output="%OutDir%%filename%.%%06d.png"
%FFMPEG% -i %video% %output%
pause

2) Use AI Gigapixel to upscale all of the exported frames to HD

3) Create a batch file in the location of your original standard definition video
paste the following into the batch file:

@ECHO off
::Declare Apps
::Replace the Values of these with the locations of the specified executables
::Must be surrounded in quotation marks
set FFMPEG="G:\Recordings\2019\05 (May)\05.06.2019\DS9 1080p Remaster\ffmpeg-20190506-fec4212-win64-static\ffmpeg-20190506-fec4212-win64-static\bin\ffmpeg.exe"
Set HandBrake="G:\Recordings\2019\05 (May)\05.06.2019\DS9 1080p Remaster\HandBrakeCLI-1.2.2-win-x86_64\HandBrakeCLI.exe"
Set MKVmerge="C:\Program Files\MKVToolNix\mkvmerge.exe"

::Declare Video Files
::Directory where HD PNG files are (keep the leading quotation mark)
set HDFrameDirectory="H:\HD Upscaler\frames_HD\
::The Prefix of your PNG files before the numbers start
set filename=Star.Trek.DS9-s05e02.The.Ship
::Where you'd like the your temporary files to live (keep the leading quotation mark)
set TempDir="H:\HD Upscaler\temp\
::The Name of the original file without the extension
set OriginalFileName=Star.Trek.DS9-s05e02.The.Ship

::Variables Based on above inputs
set WorkingDir=%~dp0
set HDFrames=%HDFrameDirectory%%filename%.%%06d.png
set LosslessHD=%TempDir%LosslessHD.mkv
set 265HD=%TempDir%265HD.mkv
set SourceFile=%WorkingDir%%OriginalFileName%.mkv
set FinalFile=%WorkingDir%%OriginalFileName%_HD.mkv

::Create Temp Directory if it does not already exist
if not exist %TempDir%" mkdir %TempDir%"

::Do Stuff
cd "%HDFrameDirectory%"
%FFMPEG% -i %%HDFrames% -r 23.976 -c:v libx264 -preset ultrafast -crf 0 %LosslessHD%
%HandBrake% -i %LosslessHD% -e x265 -r 23.976 -w 1620 -l 1080 -q 20 --cfr -f av_mkv -o %265HD%
%MKVmerge% -o %FinalFile% %265HD% -D %SourceFile%
pause

4) Update the directories as specified in the commented out areas. I highly recommend using Notepad++ or another editor that will highlight or change the color of the text to reflect batch scripting language.

5) Run the new batch file

6) Enjoy your new HD video!

Note:
For these 2 scripts to work, you will need the following applications available on your computer:
1) FFMPEG
2) HandBrake CLI
3) mkvmerge (included with MKVToolNix
4) Of course you'll also need AI Gigapixel to perform the actual upscaling.

I hope this helps some folks out!
Stefan said…
I get your error (ffmpeg) too but every frame was exported. It seems the error occurs at the end of the video. --> No harm done - I have no sync issues.

Thanks for your batch files, I might give them a try!
Pyrometheous said…
Yeah, no worries, I think I've given up on this project for now, it's been driving me crazy and I'm at my whit's end. Anyway, for the final batch file (to replace the second one on this list, I refined it a lot and it works a lot better if you have an NVIDIA graphics card, cuts the render time by HOURS! If you're not running the appropriate graphics card you can comment out that line with "::" and remove the leadinging "::" from the CPU line.

Same as before, you just need to update the values of the first 7 variables, and the script does everything else for you.


@ECHO off
::Declare Apps
::Replace the Values of these with the locations of the specified executables
::Must be surrounded in quotation marks
set FFMPEG="G:\Recordings\2019\05 (May)\05.06.2019\DS9 1080p Remaster\ffmpeg-20190506-fec4212-win64-static\ffmpeg-20190506-fec4212-win64-static\bin\ffmpeg.exe"
Set HandBrake="G:\Recordings\2019\05 (May)\05.06.2019\DS9 1080p Remaster\HandBrakeCLI-1.2.2-win-x86_64\HandBrakeCLI.exe"
Set MKVmerge="C:\Program Files\MKVToolNix\mkvmerge.exe"

::Declare Video Files
::Directory where HD PNG files are (keep the leading quotation mark)
set HDFrameDirectory="G:\Recordings\2019\05 (May)\05.06.2019\DS9 1080p Remaster\HD Frames\
::The Prefix of your PNG files before the numbers start
set filename=Star.Trek.DS9-s05e01.Apocalypse.Rising
::Where you'd like the your temporary files to live (keep the leading quotation mark)
set TempDir="H:\HD Upscaler\Season 05 Episode 01\temp\
::The Name of the original file without the extension
set OriginalFileName=Star.Trek.DS9-s05e01.Apocalypse.Rising

::Variables Based on above inputs
set WorkingDir=%~dp0
set HDFrames=%HDFrameDirectory%%filename%.%%06d.png"
set LosslessHD=%TempDir%LosslessHD.mkv"
set Video265HD=%TempDir%265HD.mkv"
set SourceFile="%WorkingDir%%OriginalFileName%.mkv"
set FinalFile="%WorkingDir%%OriginalFileName%_HD.mkv"

::Create Temp Directory if it does not already exist
if not exist %TempDir%" mkdir %TempDir%"

::Merg Frames with FFMPEG
%FFMPEG% -i %HDFrames% -r 23.982 -c:v libx264 -preset ultrafast -crf 0 %LosslessHD%

::CPU Encode
::%HandBrake% -i %LosslessHD% -e x265 -r 23.976 -w 1620 -l 1080 -q 20 --cfr -f av_mkv -o %Video265HD%
::Nvidia GPU Encode
%HandBrake% -i %LosslessHD% -e nvenc_h265 -r 23.982 -q 20 --cfr -f av_mkv -o %Video265HD%
%MKVmerge% -o %FinalFile% %Video265HD% -D %SourceFile%
pause
Unknown said…
Instead of using Virtualdub you could use Blender to render out the frames and then use mkvtoolnix or Handbrake to merge it into the original file, that way you dont get gigantic .avi files
frosti8 said…
Unknown,
You meant to use Blender to export an episode into frames?

And use mkvtoolnix / handbreak to compress them to MP4?
Unknown said…
No, you can use Blender to render the frames into a video directly. You can set Blender to export a ffmpeg video and set framerate and bitrate. Recently I've also worked with mkvmerge for substituting video and audio tracks.