Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
15th May 2020, 02:33 | #161 | Link |
Registered User
Join Date: May 2020
Posts: 77
|
I do not yet understand the organizing principle behind this TV show's use of various frame rates and content sources. All of the statements below are 100% true and I can back them up with specific scenes.
1). Much of the CGI footage is encoded at 23.976 progressive in Season 6. In other places, however, the CGI footage is 29.97 interlaced. This appears to be more common in Season 7. 2). The non-CGI sections of the show are mostly -- but not entirely -- in 23.976 fps. There are at least two places in "Sacrifice of Angels," where footage bounces up to 29.97 fps and then back to 23.976 fps in the middle of shooting a conversation between characters. 3). Sometimes, space shots are interlaced footage. Sometimes they are not. Sometimes, they are 29.97 fps. Sometimes they are not. 4). The credit sequence of the show is the ugliest, *ugliest* part of it, by far. The original DVD looks like it was recorded off someone's VHS. Watch when the camera pans over the station, in particular: https://www.youtube.com/watch?v=xL8nPEmLKLE Fixing the credits the way you did is amazing, if only because they were so awful before. I can *show* you something of the effect I am trying, specifically, to create. I created both of the videos below (please set YT to 4K -- and yes, while video takes a hit, you can still see the effect I'm specifically going for, so I'm not worried about it). https://www.youtube.com/watch?v=DzeENB9JKmE That's an upscaled MKV file of DS9. I took a pre-existing encode of the show and ran it through Topaz VEAI Gaia-CG. That's the result. When the clip starts, watch the leading edge of the Galaxy ship and how smoothly it moves towards the viewer. Watch the level of noise on the ship hulls. (I mostly care about the first 10 seconds of the clip as far as a demonstration of what I'm looking for). Now compare it to this video (set for 4K) -- particularly how smoothly the approaching edge of the Galaxy saucer moves, but also hull noise and the like. https://www.youtube.com/watch?v=8DwfHADU0QY The file I call "Rubicon" is much smoother than the upscaled MKV, even though it's still running at 23.976 fps. But the production process for this image quality is whack as *hell*, and it can't be good for the file. Start with a Handbrake CFR rip. Encode in AviSynth with the QTGMC process I posted originally + daa3mod. Run the result through DaVinci Studio Resolve, increasing the framerate to 119.88 fps. Then, run the result of *that* encode through AviSynth again via "ChangeFPS(24000, 1001)" filter to change the frame rate back to 23.976 fps. Then upscale in Topaz VEAI. This is obviously rather tortured, and there's evidence. The very first frame of the video (you may need to rewind to see it) shows a distorted stardrive deflector shield on the approaching Galaxy-class ship for a single frame. What I like about Rubicon, specifically, is how it removes noise, has excellent smooth motion (to my eye, anyway -- I am not saying it couldn't be better), reduces flicker on the hulls of the ships (check the Galaxy-class vessel in the upper left for window flicker), and antialiases the hulls. Is there a gentler way to achieve this kind of frame rate improvement via IVTC? Last edited by JoelHruska; 15th May 2020 at 03:10. |
15th May 2020, 04:43 | #162 | Link | |||
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
Sorry if I missed it, but what is the reason for Resolve ? Are you only using resolve for optical flow 23.976=>119.88 ? ChangeFPS is just dropping what you just interpolated (*5 , /5). But what is the purpose ? If Resolve resamples all frames (does not keep the original set of frames in the interpolation), then you will get slightly different no matter where in the cycle you choose. If it keeps original frames, then it depends where in the cycle the you select (0,1,2,3,4) . You have more control over the offset with SelectEvery . There might be some other options to get what you want, and avisynth has optical flow options if you needed it for some reason Quote:
Or you can control the application of filters to specific sections to avoid those sorts of issues Quote:
|
|||
15th May 2020, 04:48 | #163 | Link | |
Registered User
Join Date: May 2020
Posts: 77
|
One more note. I tested the following script from back on page 7:
Quote:
|
|
15th May 2020, 07:54 | #164 | Link | |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
Quote:
|
|
15th May 2020, 08:06 | #165 | Link | |
Registered User
Join Date: Jan 2015
Posts: 1,056
|
Any results that you might perceive of as wonky, are that way because that's exactly the way the DVD is encoded. My method perfectly preserves field-accuracy.
Quote:
Also, we did get your email about the retrograde field behavior. We apologize for not responding to it earlier. To use the trim command to get rid of it, the script would look something like this: Code:
mpeg2source("arbitrary ds9 episode.d2v") A=nnedi3(field=-2).selecteven() B=nnedi3(field=-2).selectodd() C=Tfm(field=1,mode=0,slow=2,cthresh=2,MI=40,blockx=8,mthresh=2,clip2=A,micmatching=0) D=Tfm(field=0,mode=0,slow=2,cthresh=2,MI=40,blockx=8,mthresh=2,clip2=B,micmatching=0) E=Tfm(field=1,mode=0,pp=5,slow=2,cthresh=2,MI=40,blockx=8,mthresh=2,micmatching=0) F=Tfm(field=0,mode=0,pp=5,slow=2,cthresh=2,MI=40,blockx=8,mthresh=2,micmatching=0) X=interleave(C,D) Y=interleave(E,F) Trim(X,0,82)+trim(Y,83,247)+trim(X,248,0) Code:
mpeg2source("arbitrary ds9 episode.d2v") A=nnedi3(field=-2).selecteven() B=nnedi3(field=-2).selectodd() C=Tfm(field=1,mode=0,slow=2,cthresh=2,MI=40,blockx=8,mthresh=2,clip2=A,micmatching=0) D=Tfm(field=0,mode=0,slow=2,cthresh=2,MI=40,blockx=8,mthresh=2,clip2=B,micmatching=0) X=interleave(C,D) Y=separatefields().doubleweave().tfm(field=1,mode=0,slow=2,cthresh=2,MI=40,blockx=8,mthresh=2,clip2=A,micmatching=0) Trim(X,0,82)+trim(Y,83,247)+trim(X,248,0)
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers. |
|
15th May 2020, 08:59 | #166 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
Just in case you weren't joking and suggesting to stuff H.264 / H.265 into AVI - You appear to operate in a different reality than most of us.
__________________
Groucho's Avisynth Stuff Last edited by Groucho2004; 15th May 2020 at 09:43. |
|
15th May 2020, 09:34 | #167 | Link | |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
Quote:
JoelHruska, I really can't stress enough how little credence you should give to anything Katie Boundary says. This is not me being rude; it's simply that more often than not, they just don't know what they're talking about, often insist on using objectively worse methods for nothing other than arbitrary reasons, and simply refuse to listen to any dissenting advice. |
|
15th May 2020, 16:12 | #168 | Link | |
Registered User
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
|
Quote:
2) The built in functions have chroma positioning errors. Using z_ConvertFormat would be preferred. Last edited by Stereodude; 15th May 2020 at 16:14. |
|
15th May 2020, 16:40 | #169 | Link | |
Registered User
Join Date: May 2020
Location: Canada
Posts: 49
|
Quote:
|
|
15th May 2020, 16:51 | #170 | Link |
Registered User
Join Date: Oct 2012
Posts: 7,926
|
a colorsapce doesn't have a bit deep but a DVD is 8 bit.
if you do math with pixel you can end up with fraction so you need more bit deep to store these result accurately or you will get side effect like banding. the "colorspace" used on DVD is usually BT 601 and what was the name SMPTE 170M there was more i can't remember EBU or something. so you have to check first what it is the sample was matrix bt 601 and primaries SMPTE 170M. |
15th May 2020, 16:57 | #171 | Link | ||
Registered User
Join Date: May 2020
Posts: 77
|
Quote:
I have only barely started testing IVTC, however, and the functions written by hello_hello and others are far more complex than anything I tested, so I want to look at this carefully before I start saying what will or won't work. What I want, ideally, is a function that will fix the occasional instances of interlacing and 3:2 pulldown without overly changing anything else, and I'm *really* hoping for something I can run against every DS9 episode as a global script. Quote:
Handbrake: Handbrake is being used because StaxRip will not properly align a MakeMKV VFR file. Handbrake is also being used because DaVinci Resolve Studio will not read MPEG-2 or MKV. Handbrake will output M4V files. M4V files are acceptable to DaVinci Studio Resolve. StaxRip: StaxRip is being used because it offered access to the filters I wanted to run at the time, and the front-end makes it easier to launch multiple encode instances simultaneously. I do not like StaxRip very much and it is not really in active development. It has bugs. But I have not found a better front-end GUI yet. I am not wedded to StaxRip at all. I just want something that works and is relatively easy to use when launching multiple instances of the application at once. MKV over AVI: I couldn't care less about container format, except that certain dependency chains must be fulfilled. StaxRip cannot encode a native M4V file without extracted timecodes. DaVinci Studio Resolve cannot ingest MPEG-2 or MKV. StaxRip also cannot align A/V playback when using FFVideoSource. Last edited by JoelHruska; 15th May 2020 at 16:59. |
||
15th May 2020, 17:04 | #172 | Link | |
Registered User
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
|
Quote:
I'm not familiar with Topaz and what color formats and bit depths it accepts. It may be better to feed it the 8-bit 4:2:0 YUV video directly (if it accepts it) and save the upscaled output from Topaz in >8-bit losslessly compressed video. |
|
15th May 2020, 17:41 | #173 | Link | |
Registered User
Join Date: May 2020
Location: Canada
Posts: 49
|
Quote:
The z_ConvertFormat is a bit over my head, but based on the doc, my guess is the command I need to go from YUV -> RGB is: Code:
z_ConvertFormat(pixel_type="RGBPS",colorspace_op="470bg:601:470bg:full=>rgb:601:470bg:full") Code:
z_ConvertFormat(pixel_type="YUV420PS",colorspace_op="rgb:601:470bg:full=>709:709:709:full") Code:
ffmpeg -i inputfile.avs -c:v libx264rgb -preset ultrafast -crf 0 -vf scale=-2:480,setsar=10/11 outputfile.mkv I'm sure I messed up a bunch and would appreciate any advice. |
|
15th May 2020, 17:50 | #174 | Link | |
Registered User
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
|
Quote:
There are some i60 text graphics inserted on top of it, fades in and out of black at the commercial breaks that are i60 (on top of the telecined p24), and the end credits are not 24fps. The show intro is i60 edited telecined film so you can't perfectly IVTC the intro where it fades between shots. However, no one is watching the show for the end credits or the intro (that's in every episode). You're not losing anything of importance with p24 (drop frame) output. You can blend the end credits to p24. So what if the star field behind the credits is blended? And the intro ends up with a few 5 frame segments that gets blended to p24 instead of decimated to p24. Hardly a loss. That leaves you with very few frames in an episode where an IVTC can't perfectly restore the underlying footage. The underlying footage is the concern not the titles that are faded in and out on top of it right? I haven't found any actual i60 content (that should be turned into p60 by deinterlacing) in the show itself in the episodes I've looked at that. It's all p24 content that was edited as video (i60) after the p24 content was turned into i60 via a telecine. The IVTC works. The problem is that the extra things done to the show when it was edited as i60 video occasionally break the IVTC pattern detection algorithms and require per episode override files if you want the best possible output to fix the few frames that it gets wrong per episode. That blows up your desire to be able to treat every episode the exact same and just run them through an entirely automated process. You might also get marginally better output on the frames that get blended to p24 (instead of decimated to p24) if you waited to blend them until after they were upscaled by Topaz, but that further complicates the whole process. |
|
15th May 2020, 18:11 | #175 | Link | |||
Registered User
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
|
Quote:
Quote:
z_ConvertFormat(pixel_type="RGBPS", colorspace_op="170m:601:170m:f=>rgb:srgb:170m:f") & z_ConvertFormat(pixel_type="YV12", colorspace_op="rgb:srgb:170m:f=>709:709:709:f") Also, I suspect that Topaz may not accept RGBPS video, but it might. Quote:
|
|||
15th May 2020, 18:15 | #176 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
You can't use float formats in Upscale AI (and avisynth can't export float formats anyways) , but it will accept 16bit PNG's and can export 16bit TIFFS . You would use "RGBP16" if you wanted 16bit RGB for the RGB step, and "YV12" for 8bit 4:2:0 for the YUV 8bit 4:2:0 step There is a negligible difference between 8bit vs. 16bit in this workflow given this source. Chroma upsampling/down for 1 generation using internal avs function vs. zlib is pretty negligible too |
|
15th May 2020, 18:19 | #177 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
https://forum.videohelp.com/threads/...SC#post2578796 Some people reported "interlaced" . But is there actually any real interlaced content in this series ? By that I mean actual content with 59.94 different moments in time . Not some interlaced fade, not text overlays, or some orphan field. My opinion #1 - Single rate anything - IVTC, deinterlace, whatever - will be jerky in sections because you have mixed content. VFR is the only way to have everything run at the correct frame rate. My opinion #2 - One filter for everything is works good on some sections, but not so good on others. Definitely I would filter the problem aliasing sections selectively , otherwise you kill the details on 95% of the other sections. Counterproductive when upscaling. Analogy - A F1 car is great on a track, but sucks on city streets with potholes or offroading. A 4x4 is great for off roading but sucks on the track. Last edited by poisondeathray; 15th May 2020 at 18:22. |
|
15th May 2020, 18:21 | #178 | Link | |||
Registered User
Join Date: Jan 2015
Posts: 1,056
|
Quote:
Because that's already more colors than the human eye and brain can distinguish Quote:
Quote:
If that's correct, then you could get rid of the vast majority of your problems by just making this a flat 59.94 FPS constant frame rate project. AVI works with everything and its only drawback that is relevant to this project is that it can't do VFR, which shouldn't even be a priority anyway. A pattern of frames that alternate between lasting 1/20th of a second and 1/30th of a second is NOT jerky, at least not to anyone with human eyes and a human brain.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers. Last edited by Katie Boundary; 15th May 2020 at 18:28. |
|||
15th May 2020, 18:26 | #179 | Link | ||
Registered User
Join Date: May 2020
Location: Canada
Posts: 49
|
Quote:
Quote:
|
||
15th May 2020, 18:28 | #180 | Link | |
Registered User
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
|
Quote:
|
|
|
|