Can anyone help me figure out how to deinterlace Deep Space Nine properly in Handbrake while keeping the frame rate at 29.97?
If I use Detelecine I get a near perfect result, however scenes with high motion (the space battles mostly) look bad at 23.976 fps.
I've tried I think every possible combination of Decomb, Yadif, with various interlace detections but the result always has horrible artificing or shimmer if I don't use Detelecine (which I can't do at 29.97 unless I want duplicate frames, which I don't). At least I tried every combo supported in the GUI
I've attached a VOB of the intro. Any time I use decomb or deinterlace without detelecine I get massive shimmer as soon as the close up of the space station starts
I've tried using Staxrip instead of Handbrake and while it deinterlaces perfectly using QTGMC, I cannot get the same quality of output that I get out of Handbrake. Like a Staxrip encode of H264 at CQ 10 looks visually worse than one I did in Handbrake at CQ 16. Probably user error on my part but I've spent hours trying to figure it out and would rather just get Handbrake working if possible, as it's much faster
+ Reply to Thread
Results 1 to 30 of 34
Beware the intro sequence like that are often different than the body of the show. But that sequence was shot on film, telecined with 3:2 pulldown, then different shots were crossfaded and titles overlaid. You'll probably want to inverse telecine, not deinterlace. Though sometimes special effects are overlaid as 30p or 30i. Such sequences will be a little jerky at 23.976 fps.
Mpeg2Source("ds9 test intro.d2v") TFM() TDecimate() vInverse()
Last edited by jagabo; 9th Apr 2020 at 13:00.
Handbrake GUI) works quite well most the bulk of the show. However, some FX shots end up looking quite bad in 23.976 fps, probably because they were done on videotape? Just a guess. Anyway, I've attached the sequence where I first noticed the issue, both the VOB and a file that has been run through an inverse telecine. Note the massive judder, especially during the last tracking shot as the Defiant passes over the other spaceship. This is what I'm trying to fix
The series is full of these kinds of shots especially in the last couple of seasons
The only way is VFR for complete sections, 23.976p sections play at 23.976, 29.97p sections play at 29.97p
If there are mixed composited sections (e.g. VFX on top of film, in the same frame), you need to decide what to do differently, take the base rate or VFX rate . Or rotoscope (moving masks) to isolate parts of frames and interpolate (perhaps using optical flow) to match the framerate of the other (VFX at 23.976 or film at 29.97)
Handbrake is awful for this kind of work (and everything else, as far as I'm concerned). If it has to be 23.976fps (and not VFR'd or bobbed to 59.94fps), I'd decimate the fields and not the frames. Like so:
Still jerky during the video parts, just not as jerky.
Yes, the special effects are at 30p or 30i, not 24p like the underlying film. If you really want to use Handbrake set the deinterlace option to Yadif and the Preset to Bob. Then set the frame rate to 59.94. Peak. The frame rate will vary from 24p, to 30p, to 60p depending on which is appropriate. Or set the frame rate to 59.94 constant and the whole video will be at 60p, like when you used QTGMC.
Thanks, I should do a test at VFR. One piece of info I held back from you guys is that I am upscaling these in Topaz Video Enhance AI, which as I understand it works better with CFR, though I have not actually tested VFR. This is also why I want to limit it to 29.97 fps, a 23.976 fps episode encode takes about 4 and a half hours to process in the tool, a 29.97 fps encode takes about 5 and a half hours, and a 59.94 encode would most likely take twice as long as the 23.976. When you have 170+ episodes to convert, this adds up. Here's a clip of what one of these upscales looks like if you are curious: https://youtu.be/oI1_T4xPmOU. Closest we'll probably ever get to having the show in HD.
I saw the thread at doom9, I assumed it was the same people involved
You gave no indication if there were any interlaced content sections. But those would become 59.94p
The VFR I'm talking about is timecode VFR . There are no duplicates, and you have the perfect number of frames for Enhance.
If you did it all 23.976 you'd be missing frames in some sections such as that space battle and it would play jerky in some sections because of the drops. If you did it all 29.97, you'd have duplicate frames in some sections and they would stutter in some sections. If you did it all 59.94 (assuming there were interlaced content sections), you'd have many duplicate sections, and it would play with 3:2 judder in most sections
Enhance does not perserve timecodes, because you are exporting an image sequence like PNG. (It has a mpeg4 option but it's lossy, you probably don't want to use it) . After you encode your final format, you mux in the timecodes to keep everything in sync
I think I may be on to something, I got the following result in Staxrip by deinterlacing with QTGMC and then outputting only the even frames with Filter-> Select Even. Seems pretty smooth to me, certainly an improvement over what I posted before. I'll have to do more testing to see if this is acceptable for processing entire episodes.
As expected, in the film section every 5th frame is a duplicate.
I just do not understand the hard-on that some people have for upscaling.
Whatever you do will suck compared to the HDTV hardware upscaler. It makes intelligent decisions that software cannot. Software is sometimes really stupid, and this is one of those instances. Video hardware is still king for certain tasks. This is one of those tasks.
That Topaz software is laughably craptastic, marketed to low-video-knowledge suckers. Most of their software is idiotic. The one I find dumbest of all (at least for the moment, I'm sure they'll concoct something dumber in time) is the "JPEG to RAW" software. WTF? No. Hell no. GTFO of here with your BS, Topaz! We live in a disinformation age now, where too many people/companies prey on novices (newbies) with nonsense products.
Me, I've never heard of this Topaz upscaler but after your ringing endorsement maybe litmus will rethink his workflow.
Just look at this.
Here's the intro without any processing:
Here is the intro ran through the tool (make sure you set the resolution to 4k, or the max capable of your device):
Here's a live action scene that I posted further up the thread.
Now I suppose you might just go into this with your confirmation bias against Topaz and not be able to see any difference, and you know what, that's fine. If it's important to you that everything Topaz does is crap, by all means run with that. I guess all of us excited about this new software and what it can do are just wasting our times.
Last edited by litmus; 10th Apr 2020 at 07:56.
You want folks to judge quality based on files reprocessed by YouTube? Seriously?
Looks good. litmus should forget Handbrake and Topaz if he wants good results in a reasonable amount of time.
Both examples of that scene on YouTube are flawed. The 'unprocessed' one was 29.97fps and the upscaled one was 25fps. Anyone serious about this project wouldn't want to wind up with speeded up video and audio, even if beginning with PAL DVDs.
This has nothing to do with philosophy, and everything to do with technicals/science of video.
Here is the intro ran through the tool (make sure you set the resolution to 4k, or the max capable of your device):
I quit reading when I saw this:
Source video was ripped from the NTSC DVD using DVD Shrink then encoded using Handbrake with Detelecine filter to remove 3:2 pulldown before being processed in the AI tool.
Upscaling is dumb. (Exception = mixed source documentaries.)
But if you insist on doing it from the DVD:
step 1 = extract the DVD (DVD Decrypter in IFO mode, or comparable) ... not DVD Shrink
step 2 = conversion from MPEG to lossless usually required
step 3 = edit, restore, upscale, whatever
step 4 = encode out
confirmation bias against Topaz and not be able to see any difference,
- fractal artifacting
That test is almost amusing to me. CG on black background is ridiculously forgiving, and is hiding a lot of errors. When the clips jumps back to actual live-action footage, everything falls apart, and the Youtube compression is most obvious of all.
jagabo's quickie Avisynth test is actually a bit worse, in terms of "jiggle" artifacts. This is a problem you run into, and it's present on all of these. I think Topaz is hiding it behind the ghosting, maybe avoiding it with by just letting the fractal noise leak through. The upscale algorithm gets confuses on the motion vectors, and it has a hard time pixel-locking the upscale. So it can be off some, so parts of an image can seem to move/jiggle because of it. Newbies get confused by this, not realize that an upscale is rendering new data, not just "blowing it up" (enlarging), or whatever.
Linear diagonals always look terrible, as bad as many non-QTGMC deinterlacing.
The "proper" way to upscale it to 4K would be to upscale it to like 16K, and then resolve back down. So if you want to upscale to 1080p, do 4K, then scale down. That may look better. May.
Just BTW, I've been upscaling images since before most people even knew it was possible. It's come a long way over the decades, and the "proof of concept" nature of video (multiple still images) is impressive. But it's very disappointing in practice, to the degree that the non-upscaled almost always looks better (and that's been confirmed many times by double-blind studies).
Topaz isn't a game changer, it's just a payware version of Avisynth (worse, actually).
I still remember recording the pilot on VHS the 1st night it aired (and still have that tape, WOC!). I'd been looking forward to it for weeks.
Y'all are some smug people.
1. DVD Shrink is NOT lossy if you save to a DVD Folder. It saves full bitrate VOBs. It's just a very lightweight and snappy tool and that's why I prefer to use it. Maybe if you actually used a tool instead of making assumptions you might know more about it.
2. Jagabo's example is worse than the Youtube example I posted, by quite a bit. One thing I immediately noticed is weird outlines around the credit text.
3. Do you all understand that machine learning upscaling is not the same as regular upscaling? I kind of think you don't.
One useful thing I got out of this thread is someone pointing out that the TVEAI video codec is crappy, this is true. I'm getting much better results now by outputting the frames as PNG files and then encoding to H264 using ffmpeg, so thanks to poisondeathray for pointing that out.
If you all want to read more about people upscaling DS9 with TVEAI here is some more reading:
But again, if you are convinced this is not different than your TV upscaling and/or an AVI Synth script upscaling, what is the point right?
Note that AviSynth's nnedi was one of the first generally available neural network upscalers. It was originally meant as a deinterlacer but was later adapted to more general upscaling. There are many settings you can configure to get better results. I just used the defaults. Also worth noting, it works best for cartoons (that's what I use it for). Using it with live action material can look very artificial (sharp edges with no detail between them).
I also used a simple Sharpen() that may have been responsible for the oversharpening halos around the titles.
Last edited by jagabo; 12th Apr 2020 at 09:14.
I don't know why I care that you guys are implying that a $200 commercial software is essentially a repackaged freely available Avisynth script, but I took some screenshots comparing the Avisynth upscale and the intro from one of my TVEAI upscaled episodes off of my HD. Start by comparing the starfields in these screenshots. That's not the only difference, but is the most obvious one.
Honestly this, voyager, and STNG I just ended up doing tdeint(mode=1) in avisynth and left it at 60p. With x264 crf the bitrate didnt jump much and motion was preserved. Yes there's duplicate frames but on freezes they look fine to me. At 60fps it's not very noticable. That they play on my roku stick, bluray player, and raspberry pi. You could add srestore(frate=29.97) but I always had a jerky frame whenever the framerates changed in the source. Hqdn3d(2,2,3,3) cleaned up most residual noise I had.if all else fails read the manual
Get your VOB files from your DVD to your hard drive using a tool like Smartripper or DVD Decrypter. Then feed your VOB file into DGindex and save your project as a .d2v file. Then import that d2v file into avisynth and, if you're absolutely sure that you want to sacrifice smoothness of motion and effects to get 30 fps output, run the following:
However, if you'd rather preserve the high-framerate parts in all their glory, convert to 60 with the following:
Y=nnedi3(field=-2,nsize=3,nns=4,qual=2,etype=1) A=yadifmod2(mode=1,edeint=Y).selecteven() B=yadifmod2(mode=1,edeint=Y).selectodd() C=Tfm(field=1,mode=0,slow=2,mchroma=false,cthresh=2,MI=20,blockx=4,mthresh=2,clip2=A,micmatching=0) D=Tfm(field=0,mode=0,slow=2,mchroma=false,cthresh=2,MI=20,blockx=4,mthresh=2,clip2=B,micmatching=0) Interleave(C,D)
If you see regular stuttering, switch field=0 to field=0 and vice versa in lines C and D.
To me it's a ridiculous hobby. As a huge fan of THG, DSP and even Voyager, what made them great, especially TNG, were the stories and the characterizations, not the visuals or special effects. If they were to re-master TNG or DSP from the original source files to 4K, would it really make the shows anymore enjoyable? How about the Batman series from the 60's? What made those so much fun was all the camp, the corny over the top acting, the silly fight scenes, the absurd contraptions that the bad guys always used to try and kill Batman and Robin and silly ways that The Dynamic Duo found to get out of them.
To me, trying to upscale THG or DSP is totally missing/ignoring what made those series a must watch.