How to Upscale Star Trek: Deep Space Nine

I’ve written quite a few articles about Deep Area 9 and my efforts to enhance and upscale it over the previous 16 months, however that is the long-promised tutorial — the reason of methods to do what I’ve achieved, in additional element than I’ve shared it earlier than. If you happen to’ve been ready for the step-by-step rationalization, that is what you’ve been ready for.


Why I Don’t Use Phrases Like HD, UHD, or 4K

The rationale I don’t name this model of DS9 “DS9 4K” and even “DS9 HD” is as a result of this isn’t HD-quality footage and nothing I’ve realized prior to now 16 months can change that. Upscaling can solely enhance element that already exists until you employ an strategy that seeks to generate new element — and I haven’t. Native DVD frames of Deep Area 9 are 720×480. That’s 37.5 % as many pixels as a body of 720p (1280×720) and four.1 % as many pixels as a body of 4K content material. Anybody who guarantees you a “4K” model of Deep Area 9 has smuggled movie out of the studio and bought some critical VFX chops or is speaking up a decision high quality they will’t really ship.

Moreover, Deep Area 9’s seasons are of extremely variable high quality. Seasons 1 & 2 are a lot worse than the remainder of the present. Whereas these might be improved, they nonetheless start from a a lot decrease baseline and profit much less.

A few of Deep Area 9’s early particular results, particularly exterior station pictures and the credit, are in very poor situation on the DVD. The shot of Jake Sisko fishing on the holodeck in Emissary was achieved with a inexperienced display screen whose element transferred very poorly. I can solely assume that whoever created the Season 1 & 2 DVDs actually hated DS9’s pre-Dominion storyline as a result of that holodeck background made it to disc with all of the readability of a mid-70s Playboy shoot.

I’m prepared to tolerate these acknowledged flaws within the DS9 Upscale Venture as a result of no one I do know of has had higher luck repairing them. Improved coloration grading would undoubtedly assist, however Seasons 1 & 2 look extra like VHS tapes than DVD. Let me present you what I imply. I’m going to make use of a web based device to create simple comparability pictures — sadly, I can’t embed its output in-page. “Resized” photos are from the unique DVD, blown as much as 2560×1920 to match in opposition to upscaled pictures. Resized pictures have been put by AviSynth to extract progressive frames however have not been processed with QTGMC.

Upscaled station vs. resized station: This shot reveals how marginal among the enhancements are, because of issues with the underlying footage. There’s not sufficient element to upscale within the first place.

Upscaled runabout vs. resized runabout: The upscale does nothing to hurt the picture, but it surely doesn’t precisely assist a lot, both. Once more, that is the results of the bottom footage, not the upscaler. The development is even smaller right here.

Season 1 – 3 Credits versus Season 6 credits (resized): This shot isn’t between an upscaled model and a resized picture. This shot reveals two resized pictures from the credit — one from Season 2 and one from Season 6, and it illustrates simply how a lot the Deep Area 9 DVD high quality improved over time. The resized DVD Season 6 credit look higher than the upscaled Season 2 credit within the shot under.

Season 1-3 Credits versus Season 6 credits (upscaled): This can be a comparability between the upscaled model of the identical shot. The standard bounce just isn’t small.

This can be a screenshot of the slider comparability above. To truly *use* the slider, you’ll need to click the link — however that is the distinction between upscaling the S2 credit and upscaling the S6 credit with the very same process. Click on to enlarge.

However whereas the DS9 Upscale Venture doesn’t characterize what Deep Area 9 would appear to be in native 720p, 1080p, or 4K, it represents the best total picture high quality I’ve achieved in 16 months of labor. It’s far forward of any real-time technique of enchancment that I’m presently conscious of. Reaching this stage of high quality requires the unique DVDs and the identical outcomes are unlikely to be achieved if different sources are used. As I’ve mentioned beforehand, my work just isn’t an excuse or justification for pirating Deep Area 9.

As a result of this can be a tutorial, we’ll spend much less time discussing the general undertaking and extra time on the nuts and bolts of how one can carry out this work your self. From the start, I’ve promised that after I found out a dependable sufficient technique of performing this job to really feel as if I may advocate it, I might accomplish that. Whereas this technique just isn’t completely good — in case you zoom in, you’ll see Topaz creates some refined blue traces across the emblem that don’t exist by default — however the low-visibility error (particularly at an Eight-foot watch distance on a TV) is much outweighed by the diploma of enchancment.

This information explains methods to create the highest-quality model of Deep Area 9 I presently know methods to create with out requiring any frame-by-frame or scene-by-scene enhancing. This can be a one-stop “greatest match” line, but it surely’s a good best-fit line in case you’ve obtained the horsepower for it. As a result of not everybody does, I’ll be publishing further tutorials with recommendation on methods to create a still-improved model of the present with out requiring the identical quantity of GPU and CPU horsepower sooner or later.

The one piece of paid software program this job depends on is Topaz Video Enhance AI. After I’ve in contrast TVEAI prior to now to options like DVDFab, TVEAI continues to come back out effectively forward.

Be suggested that TVEAI continues to be a piece in progress. I might not advocate it as a paid product if I didn’t consider it succesful, however succesful and ideal should not the identical factor. The product is younger and the sphere is quickly advancing.

What You’ll Want ()

  • A minimum of a quad-core CPU of moderately present make and mannequin
  • The Deep Area 9 boxed DVD set
  • A DVD-ROM drive
  • ~350GB of storage for intermediate processing per episode (Defined in additional element under)
  • A fairly new GPU
  • ~8GB of RAM

The hardware necessities are imprecise as a result of they characterize extra of a gentle flooring than a tough cutoff. A Ryzen 7 4800U cell processor is able to operating the AviSynth script I’ll advocate in three hours, 45 minutes, and upscales one body of video each 1.08 seconds or so on its built-in GPU. An RTX 2080 in Topaz VEAI runs extra like zero.four seconds per body. That’s roughly 19.5 hours of upscaling per episode for the 4800U and 7-Eight hours for an RTX 2080.

There are a number of the explanation why I like to recommend outputting your video as a collection of PNG recordsdata slightly than video. First, it lets you cease and restart the encode. If you happen to can afford to depart your system encoding in a single day however want it through the day, you need to use it to do that work within the off-hours, with no need to fret about shedding a video file that was solely half full.

The second purpose we use PNG recordsdata is that Topaz’s JPG output generally has visible errors that meaningfully have an effect on ultimate video high quality. Storing a complete episode of DS9 in PNG recordsdata can require as much as 280GB of storage and double that if you wish to do a two-parter in a single go. An SSD just isn’t required, however I strongly advocate one.

Lastly, TVEAI generally fails to protect audio correctly, requiring you to patch it in manually regardless.

350GB is definitely a bit extra storage than it is best to want for simply the PNGs for an episode. 350GB needs to be sufficient for the VOB recordsdata, PNG recordsdata, AviSynth .h264 or .h265 intermediate recordsdata and the ultimate output with out requiring you to delete something partway by the method to free house.

This tutorial is not going to work correctly in case you try it utilizing previously-created MKV recordsdata or pirated recordsdata. The method is tuned to work precisely as written.

What You’ll Want (Software program)

The one paid utility on this record is Topaz Video Improve AI, which is accessible for a free trial.

DVD Decrypter

Set up DVD Decrypter and select the area that corresponds to the disc set you’ve bought.

Navigate to the “Mode” menu and click on on “IFO.” This could offer you a display screen just like the under:

Choose whichever episode you wish to work on. DVD Decrypter will create a brand new listing for every DVD, however you’ll have to manually title the subdirectories if you’d like them to mirror the title of the episode in every. PGC 1 is the primary episode on the disc, PGC 2 is the second, and many others. You’ll be able to select to deal with all the DVD in a single contiguous file, however the subsequent step is considerably less complicated in case you separate recordsdata right here.

It sometimes takes 7-10 minutes for DVD Decrypter to do its work. When you’ve completed with DVD Decrypter, you may shut it. Closing the app generally leads it to throw an error (a minimum of, it does by myself machine). You’ll be able to kill it from Process Supervisor with out hurt if this happens.

Output: VOB recordsdata, copied to your laborious drive in a listing and a subdirectory group of your alternative.


DVD Decrypter created a file in your native laborious drive at “C:DS9S1D1” or “DS9S4D3” relying on which disc you began with. Navigate to the episode you wish to work with and also you’ll discover a pair of recordsdata with names like “VTS_02_1.vob.” Launch DGIndex and navigate to “Open”, underneath “File.” Select each VOB recordsdata from the suitable listing and cargo them so as:

When completed, hit “Okay,” re-open the “File” menu, and select “Save Venture.” DGIndex will scan by your video file and full its work. The tip results of this will probably be a .D2V file.

Observe: StaxRip generally likes to edit D2V recordsdata. In situations the place a Deep Area 9 episode has a really excessive share of movie (upwards of 95 %), StaxRip will resolve that the right body fee on your enter video is meant to be 23.976fps, not 29.97fps. Because of this, operating the script I like to recommend in opposition to an episode like “Emissary” will produce ~19fps video.

To keep away from this downside, right-click on the D2V file you simply created and select “Properties.” Choose “Learn-only” and hit “OK.” StaxRip will yell at you about this downside while you load the file, but it surely received’t fail. When you’ve set your undertaking file to Learn-only, we’re achieved with DGIndex.

Output: One .D2V file, to be saved in the identical location because the .VOB recordsdata from the earlier step.


When you’ve created and locked your D2V file, launch StaxRip and cargo your D2V file by dragging and dropping it into the appliance. I’m working with the DS9 episode “Indiscretion” under:

That is what StaxRip will present you while you first load the D2V file. These are default outputs and settings.

There’s lots occurring right here, however you don’t need to care about most of it. First, double-click on the “Mpeg2Source” window. This may open a sub-window the place you may enter script parameters.

Sadly, I nonetheless don’t have a solution to print the script I like to recommend simply. You’ll be able to copy it under. Don’t fear about the truth that it isn’t utterly seen; it will copy appropriately in case you seize a little bit of textual content from the paragraph under, then delete it.

TFM(pp=5, mode=2, micmatching=three).TDecimate(hybrid=1)
QTGMC(ShutterBlur=three,ShutterAngleSrc=180,ShutterAngleOut=180,SBlurLimit=Eight,Preset="Very Gradual", TR2=three, InputType=1,SourceMatch=three,, MatchPreset="Very Gradual", TR0=2, TR1=2, MatchPreset2="Very Gradual", sharpness=zero.6, SMode=2, Rep0=22, Rep1=22, Rep2=22, RepChroma=True, Sbb=three, SubPel=four, NoiseProcess=1, ChromaNoise=True, GrainRestore=zero.5, NoiseRestore=zero.25,DenoiseMC=True, NoiseTR=2)
pSharpen(energy=50, threshold=90,,
MAA2(masks=1, chroma=true,ss=four, aa=128, aac=128, threads=Eight, present=zero)
LSFmod(defaults="sluggish", energy=50, Smode=5, Smethod=three, kernel=11, preblur="ON", safe=true, Szrp=16, Spwr=four, SdmpLo=four, SdmpHi=48, Lmode=four, overshoot=1, undershoot=1, Overshoot2=1, Undershoot2=1, gentle=-2, soothe=true, preserve=20, edgemode=zero, edgemaskHQ=true,,, dest_x=704, dest_y=480, present=false, screenW=1280, screenH=1024)

A technique to enhance your efficiency is so as to add the road “Prefetch(x)” to the underside of the script, the place “x” stands for the utmost variety of threads you wish to run. Sane values are 2-Eight. Decrease values will go away you extra CPU efficiency for different issues. If you happen to intend to make use of your PC whereas encoding, set this worth to ~50 % of your cores or much less. Bear in mind that values bigger than Eight are typically extra more likely to trigger instability than to enhance efficiency. If I needed to encode two recordsdata concurrently whereas additionally utilizing a 16-core PC, I’d launch each StaxRip runs with a price of Prefetch(four) and go away myself eight threads for different duties.

To manage your output system, look to the right-hand aspect of the picture. Click on on the “x265” textual content, and a menu will open, providing you varied different codecs and output choices.

If you wish to alter these choices to fine-tune them, clock on the “Choices” button. This may open an extra sub-menu:

x264 choices. I like to recommend “Very Gradual” and a high quality stage of “6”, although the latter is a bit arbitrary.

If you wish to change your ultimate container choices, click on on the blue textual content labeled “MKV.” This gives you an array of selections. Personally, MKV recordsdata work advantageous for me. StaxRip detects each audio tracks and preserves each by the encode course of, so that you don’t want to alter these settings until you particularly wish to encode into totally different codecs. Click on “Subsequent” after which hit “OK” to start out the method.

That is what your display screen ought to present after loading the AviSynth script. Take note of the output body fee (23.97602) and the x264 / x265 presets. Resize decision needs to be 704×480, not 720×480. Don’t fear in regards to the 10 % error metric, ultimate output will probably be appropriately sized.

Professional Tip: If you’re experimenting with script settings, don’t render a complete episode to do it. You’ll be able to cease StaxRip at any time by hitting the “Abort” button. As soon as the appliance returns to the principle web page, hit “Subsequent” once more. The applying will let you know that a Video and Audio encoding already exists and ask if you wish to re-use the video you already rendered or re-encode it. Choose “Re-use.”

This may create an MKV file of no matter partial episode you rendered out for take a look at functions. You’ll be able to plug this into Topaz VEAI and verify the output. Simply bear in mind to set the ultimate rendering body manually. In any other case, you’ll render a ton of clean, black frames. They could upscale superbly, however you’ll by no means be capable of inform.

Output: One MKV file, assuming you’re advantageous with StaxRip’s default choices. If not, one MP4, MOV, or one other output file of your alternative and configuration. DS9 recordsdata encoded with these presets needs to be between 3GB and 5GB relying on how a lot noise you inject. Injecting noise will make your ultimate output bigger. That is your pre-processed, pre-upscale model of Deep Area 9.

Topaz Video Improve AI

When you’ve began TVEAI, navigate to the listing the place your MKV output from the earlier step is saved. Open the file. You should utilize the choices to pick out the part of the video you want to render. If you happen to want to upscale all the file, you don’t want to trouble with these settings. Swap the “AI Mannequin Selector” part on the high of the right-hand aspect of the appliance to “All” from “Urged.” Select “Artemis Excessive-High quality v11” and “400%” under that.

Scroll down and select your grain settings. I like to recommend between 2.four – 2.7. Above will get fairly heavy. I like to recommend that you just output to PNG recordsdata. TVEAI can output video recordsdata in ProRes at four:2:2, however the ultimate output recordsdata are fairly massive for video recordsdata and also you’ll wind up compressing them once more or taking them aside in FFmpeg and rebuilding them with much less obnoxious dimension necessities anyway. Set TVEAI for PNG output and you may cease the upscaler at will, use your GPU for different issues, after which fireplace it up once more when handy.

Output: A collection of PNG recordsdata, sometimes created in a subdirectory of wherever your MKV file is stashed.


FFmpeg is a command-line utility you need to use to take your PNG recordsdata and wrap them again up right into a video file. When you’ve downloaded FFmpeg, you will have two choices. You’ll be able to add it to your Home windows PATH (good concept, greatest safety apply) or you are able to do what I did, and dump the executables immediately into your C:WindowsSystem32 folder. There are all types of fine causes not to do that associated to safety and greatest practices and never encouraging end-users to muck round in folders they ought to not contact, so I’ll go away it as much as you which of them technique you like.

It’s not as dangerous as it would look, I promise.

As soon as TVEAI is completed with its work, go to the unique subdirectory the place you dropped the VOB recordsdata and from which you presumably ran StaxRip. It is best to discover some audio recordsdata with the extension *.ac3. Be at liberty to rename them to one thing extra believable, like “Indiscretion-2ch.ac3” and “Indiscretion-5ch.ac3.” The file with a bigger Kbps quantity is your 5.1 audio, the smaller quantity is your 2-channel audio. You’ll be able to choose which audio you wish to encode as your major channel relying in your choice on this matter.

Copy each of those recordsdata into the identical listing the place your PNG recordsdata are saved. An upscaled episode of DS9 incorporates ~65,143 PNG recordsdata.

Open a command-line immediate by hitting the Home windows key and typing CMD.

Open the subdirectory the place your PNG recordsdata and audio recordsdata are saved. Click on within the deal with bar and hit Ctrl-C to repeat the deal with.

Return to your open command immediate. Kind “cd” and hit the house bar as soon as, after which paste the deal with you simply copied. If you’re working off a distinct drive (D as an alternative of C), you have to to sort “d:” and hit enter earlier than starting this sequence of instructions. If you happen to use default names on your recordsdata and subdirectories, your ultimate output will probably be in a listing named one thing like: “C:DS9S6D2Sacrifice_4.00x_2560x1920_ahq-11_png”

When you’ve navigated to the suitable listing, modify the next command to suit your personal necessities. This command might be copied immediately off the online web page as a result of there aren’t any sensible quotes concerned (sensible quote formatting is what wrecks AviSynth scripts in our backend). Within the instructions under, change “Indiscretion-2ch.ac3” or “Indiscretion.mkv” with the file names of your individual episodes and their related audio tracks.

ffmpeg -r 23.97602 -f image2 -s 2560×1920 -i %06d.png -i Indiscretion-2ch.ac3 -vcodec libx264 -crf 16 -pix_fmt yuv420p -acodec copy Indiscretion.mkv

The title of the .ac3 file needs to be changed with the title of the audio file you wish to use. If you wish to preserve each audio tracks, we break up the method up into steps. There’s undoubtedly a method to do that in a single ingestion, however I haven’t fairly nailed the syntax for that but. Begin with:

ffmpeg -r 23.97602 -f image2 -s 2560×1920 -i %06d.png -vcodec libx264 -crf 16 -pix_fmt yuv420p -acodec copy Indiscretion.mkv

This may compile your frames into an MKV file, however you received’t have any audio. When the video file has completed compiling itself, sort:

ffmpeg -i Indiscretion.mkv -i Indiscretion-2ch.ac3 -i Indiscretion-5ch.ac3 -map zero -map 1 -map 2 IndiscretionCombined.mkv

This may compile your ultimate file and output with a number of audio recordsdata. If you’re upscaling at 200 % as an alternative of 400 %, make the suitable decision adjustments to the “-s 2560×1920” variable. If you wish to use H.265 as an alternative of H.264, change “libx264” with “libx265.” Decrease or larger compression elements might be set by adjusting the crf quantity.

Bonus Spherical: Subtitles

If you’d like subtitles, you may have them. There’s an extra step right here involving a program known as CCExtractor and an utility known as MKVToolnix.

To make use of CCExtractor, run the appliance and drag each of your VOB recordsdata into it, as proven under:

Navigate to the far right-hand aspect of the tab record. You’ll be able to’t really see the “Execute” tab you’re in search of by default and there’s no solution to widen the appliance sufficient to incorporate it by default. Ah effectively.

Now you will have a .SRT file and might set up MKVToolNix. MKVToolNix will end this complete process up for us.

Drag your accomplished MKV file sans subtitles and your subtitles file into the appliance. MKVToolNix will ask you what sort of file you wish to create. Select so as to add a brand new supply file to the present multiplex settings, as proven under.

Select these choices and choose your ultimate file title. “Begin Multiplexing.” Rejoice! You could have completed an episode whereas retaining each audio tracks and subtitles.

How one can Alter StaxRip Picture High quality

The one solution to get precisely the output I’ve proven all through this course of is to observe my actual steps. However that doesn’t imply there isn’t room to experiment. If you happen to really feel as if the ultimate output is inappropriately sharpened (or not sharp sufficient), alter the Sharpness setting within the QTGMC script. You can too experiment with eradicating the “psharpen” and “MSAA” calls altogether. I might strip LSFMod out final — there’s resize code embedded in it that outputs in 704×480, leading to a correct ultimate file dimension of 2560×1920 versus the over-stretched 2618×1920.

If you happen to really feel as if your ultimate output is simply too plastic-looking, there are a number of methods to regulate for this. Lower sharpness in QTGMC downwards to zero.2 and alter the “energy” variable of LSFMod downwards. You can too strive injecting extra grain and noise within the ultimate output. If you happen to select to regulate NoiseRestore above zero.5, take away the “ChromaNoise=True” line from the QTGMC script. If you happen to don’t, the output will flip barely greenish. The impact doesn’t get very noticeable till above zero.75, however there’s no purpose to depart it there within the first place.

Growing noise output in QTGMC might barely enhance total picture high quality in Artemis-HQ, however the impact just isn’t as massive because it was in earlier variations of Gaia-CG. It will probably nonetheless enhance background starfields, nevertheless.

No Longer Left Behind

This text will probably be up to date as my understanding of greatest practices continues to broaden. Readers have requested that I check out Voyager, to see how greatest to adapt Deep Area 9’s processing strategies to that TV present. Sooner or later, I’ll be swapping the Defiant for the Delta Quadrant. I’ve tossed a number of screenshots right into a slideshow under, for these curious to see how Voyager holds up underneath the identical processing strategies, although I’ve already experimented with one of the best ways to tweak them. VOY was mastered with higher-quality footage than most of DS9 and the distinction is apparent while you put them aspect by aspect. Take into account this a preview (you may right-click any picture and select “Open in New Tab” to see the body full-size:


Am I “achieved” with Deep Area 9?

Sure — and no.

I’m nonetheless contemplating coloration grading, however DaVinci Studio Resolve can’t edit or create MKV recordsdata, and the strategy laid out above is predicated on them. Regrading coloration can be a brand new area for me and I can’t make any guarantees about how rapidly I’ll be capable of sort out it. Coloration grading wasn’t contemplated within the unique undertaking as I created it, and I don’t want to delay this tutorial even longer whereas I be taught.

To start with, I got down to create a way of upscaling Deep Area 9 that might do the present justice in comparison with Netflix and even what you might purchase on DVD. I’ve little question that the standard of the present will enhance as instruments resembling Topaz Video Improve AI enhance. However, I’ve reached some extent the place I really feel snug recommending this course of to individuals.

Sooner or later, footage of the standard I’ve proven all through this undertaking will probably be accessible in real-time. By the point it’s, I’ll have constructed one thing higher by the usage of non-real-time rendering. I spent 20 years ready for ViacomCBS to sort out this undertaking and I don’t intend to take my eye off it till we both have a local 4K model of the present construct immediately by ViacomCBS or third-party AI instruments have superior to the purpose to render such a model redundant.

However the aim of the Deep Area 9 Upscale Venture was by no means to attend till 2030 when the right instruments turn into accessible. I created this undertaking as soon as it turned clear that AI instruments and free utilities like AviSynth might be used to create a model of Deep Area 9 that might be sufficiently higher than baseline to be well worth the effort of making within the first place. This tutorial was all the time the story I needed to put in writing. Now, I’ve written it.

Totally different individuals will attain totally different conclusions on whether or not the present deserves this type of effort. That’s okay. Each time I publish considered one of these articles, somebody totally different pops out of the woodwork to say how the Netflix model or the baseline DVDs are advantageous. I’m glad individuals really feel that method. As somebody who loves Deep Area 9, I need individuals to benefit from the present. If you happen to’re proud of the model on TV with out spending a number of hundred (or thousand) hours bettering it, I’m glad for you.

I wasn’t.

Now, no one else must be, both.

If you happen to suppose you may beat my high quality, do it. Let me know the place the standard enhancements come from and I’ll embody them right here and credit score you.

I nonetheless hope ViacomCBS remasters Deep Area 9. I don’t suppose it can shock anybody at this level to say I’d like to be a part of such an effort. I’ve been requested how I’d really feel if a remaster was introduced subsequent week and my sincere reply could be “thrilled.” I consider if such a factor occurs, it’ll be as a result of my very own undertaking and others prefer it collectively illustrated to Paramount that there was an urge for food for a greater model of the present. I’m additionally prepared to wager it’d promote higher than TNG did at its Blu-ray debut if Paramount 1). Dedicated to doing each VOY and DS9, 2). Launched each reveals on disc and on ParamountPlus, and three). Didn’t attempt to promote it for 80 a season.

If you happen to love Deep Area 9 sufficient to even ponder this undertaking, you’re the individual I had in thoughts after I pitched this story to my EiC, Jamie Lendino. It isn’t linear. The issues we love not often are. My most heartfelt thank-you to the a number of people who labored on Deep Area 9’s VFX group and have contacted me all through this course of to supply perception and assist.

Different tales and assignments might take me to the depths of the Delta Quadrant or bury me in CPUs however I’ll stand with you once more, right here, on this place the place I belong.

Hruska out.

Now Learn: