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. |
24th October 2022, 16:58 | #1601 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
So something like Code:
. . . a = last b = a.bwdif(some settings) Subtract(a,b) #Levels(125, 1, 127, 0, 255) # for 8bit #Levels(503, 1, 505, 0, 1023) # for 10bit : (126*4)-1=503 : (126*4)+1 = 505 if filtered is lighter than original, and below mid grey if darker than original (Subtract(a,b) will be opposite). None of above tested.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 24th October 2022 at 17:04. |
|
24th October 2022, 17:57 | #1602 | Link | |
Registered User
Join Date: Aug 2016
Posts: 609
|
Thank you for all the help, I'm learning a lot here.
On another note... Quote:
I've spent hours trying to understand how the resize crop params work but I can't get my head around whether it's shifting the chroma or if it's actually stretching the chroma out from a fixed point (and if so, which point -- center or a corner?). edit: just realised I can set the offset to a high value and measure the pixels in photoshop. In this case it seem hello_hello's code is correct: good 50px offset, bad chromashiftSP code A separate problem I'm dealing with is how to crop n lines off the top and bottom, and then zoom in to hide the black bars while preserving aspect. For a 720x576 16:9 video (which Avisynth sees as square pixels 720x576 with aspect 1.25:1) I've got this code for cropping 50 off the top and bottom: Resize(Round(576*(16.0/9.0)), 576, 50*(720.0/576.0), 50, -50*(720.0/576.0), -50) In other words, if I'm cropping 50 off the top and bottom, then I need to crop 1.25 times more pixels of the left and right in order to main aspect (I have no idea if this is right, it's just my thinking) and then finally stretch to 1024 wide to compensate for anamorphic pixels. Last edited by flossy_cake; 24th October 2022 at 18:48. |
|
24th October 2022, 19:13 | #1603 | Link | |
Registered User
Join Date: Aug 2016
Posts: 609
|
Quote:
Subtract(ChangeFPS(last,50),BWDIF(field=-2)) Subtract(ChangeFPS(last,50),BWDIF(field=-2)) Levels(127, 1, 129, 0, 255) clip: https://drive.google.com/file/d/1WfW...ew?usp=sharing edit: perhaps need a threshold so it wont amplify pixels that barely changed at all? Last edited by flossy_cake; 24th October 2022 at 19:21. |
|
25th October 2022, 10:55 | #1604 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Code:
Th =16 # or whatever center = 126 # TV else 128 PC levels Levels(center-Th, 1, center+Th, 0, 255)
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 25th October 2022 at 15:42. |
|
25th October 2022, 16:09 | #1605 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
(Levels defaulted to Coring=True, so was correct). Anyways, I've done this before I twigged that I was the wrong'un. Code:
BlankClip(pixel_type="YV12") #ConvertBits(10) # TV = true # Use True if Subtract TV levels. Th8 = 16 # Threshold, 1 = Max AMP, > 1 reduce AMP. ### bpc = Last.BitsPerComponent() shift = bpc - 8 mul = BitLShift(1,shift) center = (TV) ? 126 : 128 # 126 TV else 128 PC levels center = center * mul # center at current bit depth Th = Th8 * mul # Th at current bit depth oMax = BitLShift(1,bpc)-1 # 255 @ 8bit, 1023 @ 10 bit RT_DebugF("bpc=%d Shift=%d mul=%d Center=%d Th=%d oMax=%d",bpc,shift,mul,center,Th,oMax,Name="LEVELS: ") # Write to DebugView (google it) Levels(center-Th, 1.0, center+Th, 0, oMax, coring = FALSE)
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 25th October 2022 at 16:20. |
|
26th October 2022, 19:26 | #1606 | Link |
Registered User
Join Date: Aug 2016
Posts: 609
|
Should TFM() be capable of correctly deinterlacing the cheese slices clip?
Apparently all it needs for perfect progressive reproduction is to weave frame A field 1 with frame B field 2, but I can't get TFM to do that (tried all the modes and setting different cthresh & MI values). I suspect what's happening is it's just detecting all frames as combed. I can confirm that MadVR can correctly deinterlace it with its "film" mode deinterlacing which I'm told is madshi's own custom CPU code for detecting cadences aka "field matching" like TFM. |
26th October 2022, 19:43 | #1607 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
When you have patterns such as thin horizontal lines, that situation is always going to be detected as false positive and be deinterlaced. You can disable post processing globally with TFM(pp=0) . Or you can use are overrides or exclusion bands (eg. moving text, lower thirds) In real life, you're typically not going to encounter thin lines such as test patterns, and in real life, you're going to have to use overrides to get it perfect for non standard content |
|
26th October 2022, 20:44 | #1608 | Link | |
Registered User
Join Date: Aug 2016
Posts: 609
|
Ok cool. I always thought that test pattern was kind of ridiculous.
Regarding TDeint though, do you reckon it would work better if it used per-block combing detection? i.e if 16x16 block is combed, then treat only that 16x16 block as combed. Currently it seems to think that means the whole frame should be treated as combed: Quote:
|
|
29th October 2022, 03:11 | #1609 | Link |
Registered User
Join Date: Aug 2016
Posts: 609
|
I can't seem to detect any difference between:
TDeint(tryWeave=true, full=true) TDeint(tryWeave=true, full=false) In both cases it seems to perform combed frame detection according to cthresh,MI,blockx,blocky etc., and returns the full frame if it wasn't detected as combed. Is my understanding correct, or should there be some difference between the two? |
5th November 2022, 03:58 | #1610 | Link |
Registered User
Join Date: Aug 2016
Posts: 609
|
I've been getting into NTSC DVDs a bit lately, but was disappointed to find a few of them appear to be using "soft telecine" where the actual frames seem to be stored in the MPEG2 stream as 23.976p. This sounds great in theory as it wouldn't need any deinterlacing, but I'm finding a few of them have these split-second combing artefacts on scene changes. Annoyingly just enough to produce a visual annoyance that can't be ignored.
What's the best way to deal with this kind of content -- TFM? Decimate? Can it handle these split-second combing artefacts or are they too short to be detected? Keeping in mind this is "soft telecine" not "hard telecine" (the latter being 23.976p living inside a 29.97i stream using the 3:2 pattern -- this is not that). Also does anyone know what is actually happening with these artefacts -- are they "baked into" the 23.976p image, or is the MPEG2 stream actually changing to 29.97i mid-stream (i.e variable framerate, which MediaInfo reports is true for all of these DVDs). Of course I could just throw BWDIF at it, but then I'd be wasting half res on anything that moves. And sadly DXVA deint chokes on "soft telecine" -- produces constant bob artefacts. I don't think it knows the stream is 23.976p and is trying to treat is as hard telecine 29.97i or something. And MadVRs own "film" deint also cannot detect and repair these split-second combing artefacts either, so it looks like I'll need an Avisynth solution. |
5th November 2022, 13:12 | #1611 | Link |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,546
|
Use DGIndex and watch what pulldown results it throws: 100%film, 98,57%film, etc.
Inspect the .d2v index file with Editor. If the content stems from film there shouldn't be any pulldown transitions. If you find them these places got to be repaired and left as 23,976p. Video (credits, VFX) on top of film: there are lots of suggestions, I would go dgmpgdec, QTGMC to 59,94p If content is animation any valid MPEG-2 pulldown pattern could have been used to match intended animation flow: The same, dgmpgdec, QTGMC to 59,94p. I have still a Sponge Bob sample floating around, and it has been discussed here in doom9
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain) "Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..." |
6th November 2022, 01:33 | #1612 | Link |
Registered User
Join Date: Aug 2016
Posts: 609
|
Here is a clip of soft telecine 24p containing 2 problematic scene cuts: https://drive.google.com/file/d/1dwa...usp=share_link
For some reason DirectShowSource won't open the file on my system, but FFmpegSource2 and LWLibavVideoSource will. Their parameters rffmode and repeat seem to affect whether they will output it natively as 24p or convert to 60i using the repeat flags stored in the stream. LAV Video Decoder seems to use repeat flags to convert it to 60p and doesn't seem to offer a choice. edit: actually after more testing, MadVR's film mode deint seems to be handling those combed frame transitions perfectly. DXVA almost gets it right but interpolates those ones and jumps back a field for some reason. Not sure why I was having trouble with it before. edit: it seems LWLibavVideoSource documentation is wrong: the repeat param seems to default to true or perhaps some auto setting, since not setting it results in repeat fields mode. Setting it to false actually causes the video to play back way too fast at 30fps. A separate issue is that because Avisynth outputs square pixels I have to scale it to 720x540 but that offsets the field lines which makes it impossible to do MadVR or DXVA deint which happen after Avisynth. Last edited by flossy_cake; 6th November 2022 at 02:26. |
6th November 2022, 02:37 | #1613 | Link |
Registered User
Join Date: Aug 2016
Posts: 609
|
So this seems to work perfectly for handling the problematic combed transitions:
Code:
LWLibavVideoSource(clip) TFM() TDecimate() LanczosResize(720,540) I'll have to play around with the thresholds to see if it can be improved, but my experience with TDeint seems to imply it's going to be difficult and/or need per-scene thresholding. edit: PP=0 seems to help with that. Last edited by flossy_cake; 6th November 2022 at 11:11. |
6th November 2022, 03:55 | #1614 | Link | |||
Registered User
Join Date: Jan 2018
Posts: 2,156
|
Quote:
Quote:
or: Quote:
|
|||
6th November 2022, 19:18 | #1615 | Link |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,546
|
How has the .mkv been obtained ?
Throwing it at VirtualDub2 gets repeated frames and the mentioned combs. MPEG2Source sees FINISHED 95.69% FILM Flagging borked or DVD borked ? I would suggest to go back to the .vob and work from there.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain) "Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..." Last edited by Emulgator; 7th November 2022 at 15:26. Reason: (had wrongly called DGSource) |
6th November 2022, 20:02 | #1616 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
If its DVD VOB, then better use DGIndex [EDIT Mpeg2Source(d2v] and TFM(d2v=d2v_Filename), DGSource dont work with d2v arg. [EDIT: or rather, TFM, dont work with d2v=dgi_Filename] (you sometimes get mid frame edits (edits split on 2nd field) and Perverse Telecine where progressive fields split across frames.) TFM on VOB will also announce presence of illegal field transitions with d2v arg. [throw error]
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 7th November 2022 at 10:30. |
|
6th November 2022, 21:17 | #1617 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
Leaving PP=0 will leave combed frames (scene transitions, orphan fields - fields 220, 490 that have unique full content , but missing their "partner" field pair) , because this is not a 100% soft pulldown source (decimated frame numbers 88, 196 will be combed -ie. the frame before the next scene) You can use display=true to debug MI , cthresh values. eg. The grid pattern of yellow laundry basket might elicit false positive comb detection because it "looks" like combing. (or any scene that looks like combing, maybe some types of horizontal venetian window blinds). e.g you can see MI values going as high as 166 in the laundry scene. But the true combed frames have mic of 246 and 228. So if you set mi>166 but <228 eg. mi=170, you should catch everything in this clip (you'd have to check the rest of the DVD to see if those settings are ok), and the orphaned fields will be deinterlaced properly, while not deinterlacing the progressive content frames DGSource("soft telecine.dgi") TFM(mi=170, clip2=QTGMC().SelectEven(), display=true) TDecimate() |
|
7th November 2022, 02:16 | #1618 | Link | |
Registered User
Join Date: Mar 2011
Posts: 4,829
|
Quote:
It's been mentioned already but after remuxing the MKV as a TS file and opening it with DGIndex: Frame Rate: 29.970030 fps Video Type: Film 95.90% Frame Type: Progressive Coding Type: B Colorimetry: BT.470-2 B,G* Frame Structure: Frame Field Order: Coded Number: 256 Playback Number: 2 Frame Repeats: 0 Field Repeats: 0 According to DGIndex (and MediaInfo) it's been encoded as progressive, but given the hard telecine, I assume it should have been encoded as interlaced? Even without using QTGMC to de-interlace, this fixes 90% of it, but it creates a blended frame on at least one scene change (I only checked one). TFM(pp=5) TDecimate() Last edited by hello_hello; 7th November 2022 at 02:43. |
|
7th November 2022, 05:01 | #1619 | Link | |
Registered User
Join Date: Aug 2016
Posts: 609
|
Quote:
I bought the DVD discs the other day and used MakeMKV to remux it to mkv. So there hasn't been any transcoding (I expect it to be just the original MPEG2 stream living inside mkv file) but I'm not sure if the mkv container uses timecodes as well which could be interfering with it somehow. The snippet was then extracted using XMediaRecode in "copy" mode -- again avoiding any transcoding, but still possible that it could be altering metadata or timecodes in the original mkv file. In theory it shouldn't. In any case that clip is definitely soft telecine 24p, not 30i or 30p. The earlier seasons of that same show seem to be using hard telecine. Last edited by flossy_cake; 7th November 2022 at 05:09. |
|
7th November 2022, 05:29 | #1620 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
DGIndex Mpeg2Source(d2v) on a DVD VOB d2v would do it better, gives TFM more to work with.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 7th November 2022 at 10:31. |
Tags |
tdeint, tivtc |
|
|