View Full Version : Trying to remove blended fields from animated source
TlatoSMD
22nd December 2024, 19:39
Tonight, I've found StaxRip, and I thought for the very first time, I could finally try out deblending after having tried (and miserably failed) to even just open a file in AVIsynth for 20 years.
However, I've tried close to 5 different deblending filters so far tonight, and nothing works. Not even the people on the StaxRip server can help me.
See samples in attached files. I hope you guys can tell me how to fix this once and for all.
24p file: https://www.mediafire.com/file/w68ouyz7u4gjgdq/Cut.mp4/file
29.97p file: https://www.mediafire.com/file/j33oq56ysbl22uw/Cut02.mp4/file
As the 24p file has a better resolution, but a nasty barcode on top, it'd be great if I could fix both files, to patch over that barcode with the lower-rez 29.97p version in that area.
Selur
22nd December 2024, 22:48
for clip02 brutally go for 6fps:
Cdeblend(omode=3)
TDecimate(mode=7, rate=6.0000)
then upscale with some anime upscaler
TlatoSMD
22nd December 2024, 22:52
for clip02 brutally go for 6fps:
Cdeblend(omode=3)
TDecimate(mode=7, rate=6.0000)
then upscale with some anime upscaler
Getting this error now: "No function named Cdblend" (see attached image).
Also, I really thought I could maintain a higher effective framerate.
Selur
23rd December 2024, 07:35
Getting this error now: "No function named Cdblend"
You are probably missing:
http://avisynth.nl/index.php/C_deblend
[quote]Also, I really thought I could maintain a higher effective framerate.[/quote|
Maybe you can, only had a fast go at it and that seemed to be the number of unique frames, if I missed some and there are more, a higher frame rate is possible.
(or one could increase the frame rate with some interpolation)
TlatoSMD
23rd December 2024, 11:17
You are probably missing:
http://avisynth.nl/index.php/C_deblend
That script is giving me a PowerShell Script Exception error.
TlatoSMD
23rd December 2024, 11:46
for clip02 brutally go for 6fps:
Cdeblend(omode=3)
TDecimate(mode=7, rate=6.0000)
then upscale with some anime upscaler
Okay, somebody has told me now how to load external scripts into StaxRip.
What happens now is that I'm losing a hell of a lot of frames in an entirely irregular pattern with your solution, but the blended frames stubbornly remain.
TlatoSMD
23rd December 2024, 16:26
From what little I can tell, this footage seems hybrid due to its highly irregular pattern, so I'd actually have to set a hybrid mode in TDecimate, but hybrid mode only works with modes 0 or 1. However, in modes 0 and 1, TDecimate just refuses to actually do any decimation of the framerate.
Selur
25th December 2024, 15:25
Couldn't get better results when using sRestore instead of TDecimate, and I didn't see a sequence where I saw more than 6 unique/original frames, so I settled for 'TDecimate(mode=7, rate=6.0000)', so I too would be interested to see if you can find a way to get a higher frame rate.
Maybe when using AnimeIVTC or Wobbly/YATTA you might be able to find something.
TlatoSMD
30th December 2024, 02:53
Couldn't get better results when using sRestore instead of TDecimate, and I didn't see a sequence where I saw more than 6 unique/original frames, so I settled for 'TDecimate(mode=7, rate=6.0000)', so I too would be interested to see if you can find a way to get a higher frame rate.
Maybe when using AnimeIVTC or Wobbly/YATTA you might be able to find something.
Well, that's no use for me if I'm mainly losing a hell of a lot of *CLEAN* frames that way and mainly the *BLENDED* ones remain. That's on top of the fact that it's only 6fps afterwards.
If I would get 6fps with only *CLEAN* frames, that'd be some progress. But that's not what I'm getting with your script.
Selur
30th December 2024, 12:59
Strange, worked fine for me. (cdeblend+tdecimate)
poisondeathray
30th December 2024, 16:16
For Cut02.mp4, the fps is 59.94, not 29.97. It was probably double rate deinterlaced already. You never have more than 2 unique frames in a row , so you can use selecteven
The unique frame fps for the running in the hall section is ~17.982.
LSmashVideoSource("Cut02.mp4")
selecteven()
selectevery(40, 0,1,5,6,7,10,11,12,15,16,17,20,21,22,25,26,27,29,30,31,34,35,36,39)
#24/40 * 59.94 = 17.982
Of course that won't work for entire video, because the pattern changes - that's just for an estimate of what the clean frame fps should be
TlatoSMD
31st December 2024, 21:07
For Cut02.mp4, the fps is 59.94, not 29.97. It was probably double rate deinterlaced already. You never have more than 2 unique frames in a row , so you can use selecteven
The unique frame fps for the running in the hall section is ~17.982.
LSmashVideoSource("Cut02.mp4")
selecteven()
selectevery(40, 0,1,5,6,7,10,11,12,15,16,17,20,21,22,25,26,27,29,30,31,34,35,36,39)
#24/40 * 59.94 = 17.982
Of course that won't work for entire video, because the pattern changes - that's just for an estimate of what the clean frame fps should be
I marvel at your math skills...and shudder at how much work it may be to do it for the entire video with changing patterns.
hello_hello
1st January 2025, 16:04
It does look like cuts02 was telecined and blend de-interlaced for 30fps at some point, before the frame rate was doubled.
SRestore has a mode for deblending blend de-interlaced telecine, and it seems to be working reasonably well from what I can tell looking at a very short sample. So...
SelectEven() # try SelectOdd to see if the result is any better
SRestore(mode=-4, omode="pp0")
TDecimate()
The example on the SRestore wiki says SRestore(dmode=-4, omode="pp0").
It's been wrong for as long as I can remember.
If SRestore doesn't find blend de-interlaced telecine in that mode there'll be artifacts for days, so it'll either work, or it'll make a mess, and if the pattern changes it might create an artifact on the next blend, or fail to deblend it.
In fact looking at your sample again I'd probably skip SRestore in the little section where the guy is running because there are some artifacts there, although they're not terribly noticeable.
A = SelectEven().Srestore(mode=-4,omode="pp0").TDecimate()
B = SelectEven().TDecimate()
A.Trim(0,203) + B.Trim(204, 235) + A.Trim(236, 0)
I'm not sure if there's a way to fix the other sample.
FranceBB
4th January 2025, 19:57
It's been wrong for as long as I can remember.
Fixed. ;)
http://avisynth.nl/index.php/Srestore
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.