View Full Version : another restore function


MOmonster
16th June 2005, 13:44
Bad telecined sources with blended fields seems to be normal in my country. The possible solutions for this problems are really rare. For example tdeint(mode=1, tryweave=true) with unblend and a decimater or the the great but really complex function restore24.
That's why I have written the function srestore (18.11.2009) (http://forum.gleitz.info/attachment.php?attachmentid=95810&d=1258566239).
You can download the necessary plugin, Masktools v2 (latest version), here (http://manao4.free.fr/).

For more informations please read the readme or take a look at the wiki (http://avisynth.org/mediawiki/Srestore).
I hope this is a helpful function. Nice tryout. :p

yaz
23rd June 2005, 09:04
No posts....? It seems that nobody need such a function. Hmm.sorry for my late reaction but my spare time is very limited. i tackle with a very bad source for a long time (see here (http://forum.doom9.org/showthread.php?t=95964) ) yesterday i found some time to give your function a go and i must say i was amazed. your script has given me far the best result so far. it cleared most of the banding and most of that funky ghosting.
would it be possible somehow that u have a look at on that dvd. it's not my plain selfish ;) i bet u will find some more ideas how to improve your script further.

i noticed u dropped further versions of cdeint but i had no time to test that, but sure i will.

some questions :
- if i get it right the noise parameter (nlv) is very important but the way u suggsted prompts nlv=20 which i find too high. so, i tried nlv=0-20 stepwise but, amof, i couldn't have seen any difference. how's it possible ?
- what if i get nlv too high or too low ?
- i compared the 'cdeint'ed stream to the 'tfm'ed one but i found (almost) no difference. why this two step process ? isn't cdeint enough alone ?

pretty good job, man! pls, go on ! if u need a tester (and a propagator ;) ) just call me !

thx
y

Mug Funky
23rd June 2005, 11:07
hehe... lack of replies does not equal lack of interest :) i haven't had much use for a deblender of late because i tend to do more in the direction of creating the problem than solving it :)

i think i could probaly use it on some old telecined (the peculiarblend method) footage in the coming few weeks. apart from that my sources are all clean, just waiting for me to blend them.

Didée
23rd June 2005, 11:14
because i tend to do more in the direction of creating the problem than solving it :)
:) What a traitor you are ;)

yaz
23rd June 2005, 11:53
@mug funky
hah ... now i know whom to bless for this (http://forum.doom9.org/showthread.php?t=95964) masterpiece. (would u, pls, drop your address) :D

MOmonster
23rd June 2005, 15:58
@yaz
Nice to read some replies. The new version works a lot better on bad quality sources. The bmode is really helpful for it. Yes the nlv parameter should be used to tweak the blend detection, but this parameter is only helpful for static noise, for example from analoge materials or DV-sources. Useful values are between 0 and 4, anything higher effects the opposite. So itīs not a useful parameter for dvd-sources, keep it 0. (really 20, and you took a scene without any motion?)
In your thread you wrote, that your source looks strange also after using separatefields. Maybe this is a yv12 problem. Use converttoyuv2(interlaced = true) before the deinterlacing. Does this help. If not maybe you can send me just 5mb (a motion scene with problems). You can uploud it for example this way.
http://rapidshare.de

If you use Cdeint alone, please use the modified Version. You would lost some clean frames if you do it with the other version. The combination with tfm, first is faster than using it alone, but the more important advantage is the matching process, because Cdeint itself canīt weave the fields. So for maximum resolution use it this way or the modified version with tdeint(mode=1, tryweave=true) (much slower). Cdeint just choose the right frames of the inputed bobbed source, not more.

yaz
24th June 2005, 09:06
@momonster
sorry but i didn't go further. maybe on the weekend
The new version works a lot better on bad quality sources. The bmode is really helpful for it.when u say 'new' what version do u mean ? 'cdeintmod' or the silent mod of the 1st version ? nevermind. i will try all :)
Useful values are between 0 and 4, anything higher effects the opposite. So itīs not a useful parameter for dvd-sources, keep it 0. (really 20, and you took a scene without any motion?)maybe i was dumbass but instead of scrolling thru the movie chasing for 'real' static scenes i just checked a 'plain black' part having 15-20 frames. however, the very high value seems to be realistic as the noise (a kinda vibration) is clearly visible. now i'm musing about to make a lowpass filtering before 'deblending' as this way i loose too much 'clear' frames.
In your thread you wrote, that your source looks strange also after using separatefields. Maybe this is a yv12 problem.maybe or maybe not. i'm sure this dvd was prepared by people being as incompetent as just can. like me :D
... maybe you can send me just 5mb (a motion scene with problems)ok. i try to do sg. would someone suggest a reliable vob cutter, i've never used such stuffs before.

anyway, isn't a dvd rent there around. it'd worth to have a thorough look on that source.

thx
y

MOmonster
24th June 2005, 10:37
@yaz
I mean both versions. I also updated the first. The modifield version just have some more conditions, that it can be used as standalone function.
You can use mpegtools from tmpgenc for example to demux the m2v videostream from the vob and then use cutterman to cut the videostream.

yaz
24th June 2005, 11:48
thx, but i think i can do it in a way w/dgdecode. however, u must wait till the next week (i'm banned again at my 'private ip'; 'limit exceeding, use of undue authority, aso aso'; what a bad guy i am). in the meantime, i hope, i can make some further experiments. i'm about it.
thx
y

scharfis_brain
24th June 2005, 13:22
MoMonster, I didn't test your unblender due te lacking time :(

So I have one question: how does it handle the Starship Voyager Intro video?
Is it able to deblend the nebula scene without jerkyness?

Didée
24th June 2005, 14:04
I gave it a quick try on CDeintMod yesterday. Seems to work pretty good, overall.

While the blend removal was quite successful (perhaps even better than R24 - I didn't count the misses for both), it produced yet too much skipped frames on scenes where motion happens only in small areas.

Though I don't get fully get the mechanism behind it, the function shows good potential for sure. Good work, Momonster!

Note: Work on R24 resumed ;)

MOmonster
24th June 2005, 18:05
I work on a better condition function for Cdeintmod, that should save more clean frames, but ofcourse it would never save the clear frames as good as restore24, because it just take the bobbed input and choose one of two frames to output. That mean that the bobber you choose give two frames for one original frame. My function just try to find out what is the blend and give back the clear field. For my sources, everytime when tfm is not able to find a match itīs because a blend, thatīs why this simple way works that way (till now smoother and better than the mod version, but there will be further tweaking).
The mod version I created to save more clear fields. So it looks to some more conditions, but there is still some work necessary.
@Didee
Ok, I try to explain short, how the blenddetection work.
The condition is that the blend is the product of the two clear fields around. The blenddetection use a smart bobbed clip, this makes the test easier. I found out, if the blendlevel (the level, the clear fields around are merged together) is 50%, the differences between the blending to the field before and the field after are nearly the same. If the blendlevel is 20%, the difference to the field after is smaller than the difference to the field before.
And this seems logical. So my function try to create the blend with the both differences to the clear fields around. Then it compares the created blend with the original field. If they match, we know, this is a blend.
To make this process more accurate, the function compares the result of the first blendtest with the results of the next blendtest.
I also tried to make it more accurate by using the total difference, but it only slows down things a little bit, and donīt really help, the lumadifference seems to work quite well. In your restore24 thread I posted my first basic function, maybe this is easier to understand.
If there are more questions, just ask me. :)
@scharfis_brain
If you could upload a small part of the intro, I could work a little bit with that source to tweak my function.

yaz
27th June 2005, 09:46
@momonster (and other gurus interesting)
i've uploaded two short examples. link and comments are here (http://forum.doom9.org/showthread.php?t=95964). sorry for crosslinking but i think the files belong there even if we discuss the problems here (hopefully). and i don't want to crosspost.

@momonster
'man proposes God disposes' ... of course, i had time far less than i expected but i'd made some further short tests w/the modded versions. i must confess, i found no difference betw them. however, the results were amazing. most of the blended frames were recovered or cleared significantly. what remained is that strange ghosting i outlined in the other thread.
further, i felt as if i had lost 'too much' clear frames while decoming was defective on frames where it'd been needed only on small regions. however, i haven't checked these more throughly but, imho, they are not 'fatal', so, i could live w/them happy.

a short question. you, and other gurus too, recommend to restore fps24 ? why do u think it's beneficial ? i see that wout some decimation the stream gets jerky but i want to keep fps25. any ide how to do so ? (other than fps25 is hella jerky on a pal tv)

thx a lot
y

Mug Funky
27th June 2005, 09:55
field-blends use up buttloads of bitrate and require bobbing on playback... that's the main reason to restore the non-blended source. also if you plan on standards-converting it a second time and don't want to have blurry crap as an output.

if you have bitrate to spare, you can easily encode an interlaced xvid and play back with on-the-fly bobbing. it's quite a good solution for anime, where there's lots of static scenes.

MOmonster
27th June 2005, 17:12
@yaz
Ok, I dowloaded your clips. What a strange conversation, a soft picture, but no analoge noise and not to heavy artefacts. Iīll take a closer look, if I have a little bit more time.
Why decimating to 24fps?
In most cases the original has 24fps and than converted with strange conversations like temporal fieldshifting fielddoubling and of course fieldblending to 25 or 29,976fps. You see it shoulnīt be 24fps, but 23,976fps. Sometimes the original has only 17fps and one time I have a source, that was already speed upped to 25fps before the strange conversation. So we canīt say that it is general right to decimate the clip to 24fps. So you have to decide, if the 25fps output looks already smooth enough for you, there is no need to decimate. If the 24fps decimated clip have a smoother motion for you, than you can decimate and than speed up the source to 25fps, that you have your pal standard.

As I said before the modded version works not so good till now. I already have another condition function for Cdeintmod. It works better than now and with the right settings already better than the silent Cdeint with tfm. I will update the function, if I have a little bit more time, till now itīs recommed to use the non modded version.

I also think about another modified version that is not only able to use one of two, but is able to use one of three frames to save more clear fields, but I have no such strange sources. Weīll see, what brings us the future. :)

MOmonster
28th June 2005, 08:32
@all
Once more, I updated the functions. The bmode 2 no longer needs the unfilter and the functions have a better handling. The modded version no longer has the nlv value, but a very important motion level value (please read the updated text at the beginning).
I added a new configurable parameter to tweak the blend detection, but in general I wouldnīt touch this parameter, called "hv". This parameter is used for the internal calculation ot the blendtest. Useful values are between 0.6 and 1,4. Normally, higher values help to find the blendings better, so for the silent Cdeint you can use for example 1.0 (default is 0.9). For A clean, sharp (not oversharpened) source set smaller parameter. For worse sources use higher values. If you see that there are blends with factore under 20% are left the default value is maybe to less. For the modded version this value should be set more accurate (default is 0.8), because of the updated internal condition function, it have to recognize really clear.

@yaz
Like you can see it, because of the posts in your thread, I also see no way to restore this nicely. Now I know why my function works better for your source (because of the many blends that stays together). But wonīt help you much. If we just take all the clear fields the source look not so bad, a little bit soft, but no strange artefacts because of the compression. It looks like a bad conversation from Pal to Ntsc and another bad conversation back to Pal or somthing like this.
The big probleme, that some clear fields between two blends are totally missed. So to get not a to strange motion, we have to took one of the blends. Ok some blends left wonīt be the probleme I think, but the strange dark stripes, we can see in every blend. This looks to bad. I donīt think that you get better results than using Cdeint with tfm (or to save some more clear fields the new modded version, but this wonīt make the difference) on it.
Maybe sharfis_brain or Didee know what to do against this strange artefacts, but killing more blends wonīt be good for the motion. Only theoretical it is possible to restore this missing clear fields by adding the two blends together and than substract the blend of the two clear fields around. If we exactly know the blendlevel, it is possible to restore also this cases. But sorry this is just to rare and the function really to complex and would only work with really good compressed material, so I think I wonīt try something like this in near future. Maybe it is the best to buy the ntsc version. I donīt believe that it will also be that bad. :o

Didée
28th June 2005, 09:17
Screenshot of those "dark stripes", please (can't get yaz' samples, currently) ?

Some time ago, scharfis_brain had a source with something he called "negative blending", and this here sounds similar.
For scharfi's sample, I fiddled a spatio-temporal repair function that seemed to work sufficiently. Perhaps it can be applied on yaz' source, too.

yaz
28th June 2005, 12:51
Screenshot of those "dark stripes", pleasehere you are (http://rapidshare.de/files/2654995/musa01.jpg.html)
(can't get yaz' samples, currently) ?naah ... what to say ... :D
thx
y

MOmonster
28th June 2005, 13:34
I know the strong limitations of this server. I uploaded the clip on another server. Download it here:
http://www.megaupload.com/?d=22K8DY2Z

vcmohan
29th June 2005, 03:39
When I click on the link it takes to megaupload.com. What to do next to get the image?

MOmonster
29th June 2005, 07:03
There is a small button "please wait ... seconds". Wait the time and then click on the link. ;)
Maybe you need the macromedia flash plugin to see the button. If you donīt want to install just try the link of yaz. I donīt want to upload the clip once more on another server.

Backwoods
29th June 2005, 07:23
www.uploadhouse.com

www.imageshack.ws

For instant free image hosting.

MOmonster
29th June 2005, 10:18
Thank you for your links. Iīll delete the image after a week or so. This should be not the content of this thread.

yaz
29th June 2005, 11:20
@momonster
thx u for bothering w/my source ! ... and sorry for hijacking your thread (i'm sure i'll get banned soon)

i made some quick tests w/the renewed functions. u were right
- no improvements on my source compared to the old ones :(
- using cdeint as a prepocessor gave better results. when bobbed w/tdeint and processed w/tfm (as u suggested) i can get rid of most of that blending (say, 7 out of 8 frames got cleared) which is pretty good.

what now i see is a kinda blocking on the deinterlaced high motion parts. is it a native consequence of the process or would i tune the parameters to avoid it ? (i used your script from the 1st post wout any change)

would u please explain a bit more the new parameters u introduced. again, i don't know how to tune them, and the 'blind-flight' gave no difference.

thx
y

MOmonster
29th June 2005, 12:46
@yaz
The kinda blocking is a probleme of the bobbed input and has nothing to do with Cdeint. Play a little bit with the thereshold (for tdeint I think it is the mThreshL parameter). Higher values could solve the probleme (I think), but to high values will result in deinterlacing artefacts.
Yes no improvments for your source, but you should use the new version. It no longer needs unfilter for bmode=2 and there are some little internal parameter tweaks. The parameter you know, just use like before (donīt use the nlv parameter for your source, it is only useful for analog noise in your source. Bmode=1 is the right choose for you. New is the hv parameter (hidden value). Hidden, because mostly it is better donīt touch this parameter. Set it between 0.6 and 1.4, never and I mean never higher or less. The blends I see in your clip have no blendlevels (percentage how the clearfields are mixed together) under 20% so keep it like it is. This parameter is only useful, if you have problems with such less blendlevels. Set it like I wrote it in my first post.
The new modded version works better than the old, also for your source, maybe you can save some more clear fields with it. But you wonīt see the difference by playing the output. Maybe for your bad source it is only a waste of time. A big influence to the modded version has the mlv parameter (motion level value). You get this parameter similar like the nlv (see the first post, use bilinearresize). If the fields are the same, the matcher will match them. You can look to the differences in the log file and compare the fields with your eyes. Try to find a value for that you could never find a motion and for that the matcher would match the fields. Read my second post, I also said something for this parameter.
You should choose the bobber you like most, the tryweave option is not necessary for the modded version, you can also get good results with a simple bobber. Maybe you like dgbob more or want to use leakkernelbob with sharp=false. Or nearly the same as tdeint(tryweave=true), but slower, the matchbob function from scharfis_brain. It depends on your eyes.
Maybe Didee can help you with this dark stripes.
Till now, there is no solution for the many blends. Sometimes there are three blends together, that mean two lost clear fields. My function kills two of it. This already gives a bad motion. If you kill all this would have a cruel effect on the motion.

MOmonster
3rd July 2005, 10:21
@all
I updated the modded Cdeint version. I realize some ideas like choosing between three fields or taking the fields with better quality, if possible. The big condition is, that every blend is surrounded from the both clear fieds it consist of. I think for stranger conversations the older version is better.
The mlv parameter is default 1.5 and could be choosen I think between 0.75 and 5.0. Conditions for this parameter are:
1. The lumadifference between a blend and a clear field, also if the blendlevel is less than 15% should be higher than the mlv.
2. The lumadifference between two fields, where there is no motion, also if one has some blocks or other artefacts should be less than 1.6*mlv.
3. The lumadifference between two fields of the same original frame should be less than the mlv.
Maybe for the next update, Iīll explain it better.
With the right mlv the function works a lot better. The motion is smooth, there are less blends and it tries to choose the fields with better quality.
This is the first time I can say also the quality of my function is comparable with restore24, not same good, but comparable.
Just try it out. :D

Didée
6th July 2005, 22:19
how does it handle the Starship Voyager Intro video?
Is it able to deblend the nebula scene without jerkyness?
As far as I tried, it fails big time on this clip. But it must be admitted that this intro is very difficult indeed, and probably I didn't know how to tweak CDeint's setup correctly.

(MOmonster - if you're still interested in Voyager's intro, drop me a PM.)

What I noticed with the latest CDeintMod: it seems to mistreat chroma planes when it is fed with YV12 sources, as CDeint's output shows chroma interlacing, then. When converting to YUY2 beforehand, it's clean.

MOmonster
6th July 2005, 22:35
Also Cdeintmod only choose the right frame of the bobbed input, so I canīt understand this chroma problems. Iīll take a closer look on the next version.
I donīt any longer recommed fdecimate after cdeint. It has a strange behaviour in some scenes. Decimate works fine. I donīt tested Tdecimate.
I just finished a newer and better version, that give me sometimes better results than restore24, but I have to make some more tests with this version.
Iīll send you my emailadress soon.

MOmonster
13th July 2005, 00:05
@all
Once more I updated the modded version (not the silent - will come soon).
There is many new in this version. Now it works much more fluid, also for the Starship Voyager Intro video. It has some other parameters and runs more stable than the last both versions. Like the first you can also use it together with fdecimate, but it is recommed to use decimate.
For more informations please read my updated second post.

yaz
13th July 2005, 09:11
@momonster
thx for the improvements! i'll try to give it a go at the weekend. (i'm still fighting w/the same source ;) )

thx
y

MOmonster
13th July 2005, 09:48
@yaz
Itīs worth a tryout, but it wouldnīt delete more blends, but will give a better motion and runs maybe more stable. Have you found a solution for the dark stripes? Iīm interested in. I still donīt see a nice solution for your source, because there are some clear fields totally lost. Maybe I could create a function that is able to delete all blends, but this would be to cruel for the motion, but if you can live with 12 fps I could try it for you. ;)

Didée
13th July 2005, 12:04
MOmonster - I could only give a quick try on yesterday's preview version. Overall fluidity was indeed better than before, you're on a good way.
Still, there were noticeable problems when motion appears only in small areas of the frame. In a scene where nothing moved but the mouth of the actors speaking, it reminded somewhat of an animation @ 8fps or 12fps - the mouths were "hacking". However, small motion is always problematic. Have been fighting with that long enough ;)


@ yaz

A solution I don't have for you. But a strategy. One would have to

1) make a basic restoration by either CDeintMod or R24. After this, most blends have gone. Theoretically, in ideal case, all of the remaining blends are in the places where the good original fields are missing in the source already.
(Do I remember correctly that the good fields are always missing where two consecutive blends are occuring?)

2) Run a 2nd pass, where all blends are replaced with the previous frame. This turns the remaining blends into dup's.

3) run a 3rd pass, with a routine that replaces duplicates with motion compensated frames, computed from N+1 and M-1.


Step 1 is obvious, and both Restoring functions should be able to deal with it.

Step 2 is the problematic one, of course. R24 can not do that, but CDeint should, or should be possible to be changed so that it can.

Step 3' s function does not yet exist AFAIK, but wouldn't be that hard to do. (I wonder why nobody did it, yet)

yaz
13th July 2005, 14:51
@momonster
dunno, man ... one of your last scripts removed most of that funky black lines (sorry, can't recall which one). what remained is ok for me. anyway, call me if u have any better solution ;)
the main problem now is the jerkiness left behind. most of that annoying ghosts turned to that. i want to see what your improvement on the 'smooth motion' field can do w/it ... but i have no time at the moment. maybe, at the weekend (or maybe later)

@didée
yeah ... it's almost that what i'm tampering with (just on my noobish way) ... i've spent some fragmental time w/making a good blend mask but no success so far.
your idea; 1. and 2. seems quite reasonable to me, but 3. i can't even understand. (sorry :confused: ) would u, pls, give some more details.
(Do I remember correctly that the good fields are always missing where two consecutive blends are occuring?) dunno, really. when i watch the separated fields i always know what would i select. in most instances the clear fields are there and your scripts act pretty good on them.
earlier, i've attached the most problematic parts, and thus u think the whole movie looks like that. it's not true. only some special scenes are so horrific (other parts are simply ugly, in the usual way :) )

however, a strange idea came to my mind. it seems as if there were some intentional artifacting on that scenes. i don't know the 'terminus technicus' for that but it's sg like a blurred ghost whirling around the object. maybe, u've seen sg like that before. it's used for making feel that the hero has fatal hot, or 'it's the last glance before death', or 'ohh, i'm so dizzy/drunk/tired' aso aso ... (quite cheap effect, anyway)
if so, it's sure, that parts get blended as they are the most moving parts, right ? thus, the moving object and its whirling ghost get blurred at once. on the overlapping parts there come that blended blends. imho, that black fields are double blended ones. imho, that's what's seen as 'blends' on the separated fields. i hope u get what i mean. sorry, i'm complete noob on this field (too).
my other idea is that it's the effect of a careless and fatal resizing before(!) blending. (maybe, they tried a smooth resizer)

any opinion ?

thx for your help
y

Didée
13th July 2005, 16:05
Of course it is possible that those strange effects originally have been an artistic effect, that later on has been destroyed during the standard conversion ... and if these "consecutive blends with missing clear field" exclusively occur in a few scenes only, then it's even more likely to be so.
But that doesn't help much ... the dark stripes surely were not intended, and if it looks bad, then it looks bad.


To that point 3) :

Thanks to Manao's MVTools, we can create intermediate frames between two given frames. E.g. one can make "true" 50fps from a 25fps source, without blending, by creating new intermediate states of motion between two frames. The result is not always perfect, but usually pretty good.
So, for Dup (or Drop) repairing, one would first create a 2nd stream, where every frame is replaced by a frame that has been motion-interpolated from its two neighbours. Then we scan the original stream for dup frames, and replace them with the according frame from the created 2nd stream. That's all.


the main problem now is the jerkiness left behind.
Indeed. That's the funny lession I learned rather quickly when I started out with Restore24: At first you think removing the blends is the hard part - but isn't. Removing the blends is relative easy. Producing a smooth and fluid result, *that* is the hard part. Blends are not nice ... but broken motion is what can really drive you insane (me, at least). By now, even I hardly care anymore if a restauration script accidentially chooses a 15% weighted blend instead of the clear field ... this minor blending tends to get lost in display's luminescence anyways, one would hardly be able to spot it during playback. For me, jerkiness of motion is what must be avoided by all means.

And in this respect, the upcoming Restore24 will come across pretty well. :)

MOmonster
13th July 2005, 21:00
@Didee
Thatīs the problem by using lumadifference for these cases. For such motion you should use a much smaller value for mlv. Helps it if you use mlv=0? This value is only useful if you want avoid frames with bad quality. To optimize the function play a little bit with the btresh parameter. If this also didnīt help, please could you send me a small scene with this problem. For my examples it helps just lowering the mlv parameter and maybe higher (could result in blends) the btresh. Lowering the mnv parameter could also help, but I donīt think that it really will.
@yaz
Itīs not a big problem to create a good deblender that work similar like my Cdeint, but I donīt know if it will be able to detect blends, through there are missing clear fields and donīt destroy clear fields, where the first pass give already good results. If you want to try it this way, Iīll create you the deblender :)

MOmonster
13th July 2005, 23:15
@yaz
so, here is my deblend function:

c = last.BilinearResize(480,288)

Cdeblend(tclip=c, thresh=20)



Function Cdeblend(clip input, clip "tclip", float "thresh")
{
###### PREPARATION ######
global diff = default(thresh/100 + 1,1.22)
global output = input
global blendclip = tclip

###### FRAMES FOR BLENDPARAMETERS ######
global combingc1 = blendclip.trim(1,0)
global combingc2 = blendclip.trim(2,0)

###### VAR.. ######
global comblc2 = 1
global comblc1 = 1
global btestc1 = 1
global btestc0 = 1

###### Conditional Function Chain, evaluated from bottom to top (!) ######
c99=scriptclip(input, "Outputer()")

c9=FrameEvaluate(c99, "global isblend = (btestc0*diff < btestcb) && (btestc0*diff < btestc1) ? true : false")
c8=FrameEvaluate(c9, "global btestc1 = LumaDifference(blendmadec1, blendpicc1) / (comblc1 < comblc2 ? comblc1 : comblc2)")
c7=FrameEvaluate(c8, "global btestc0 = btestc1")
c6=FrameEvaluate(c7, "global btestcb = btestc0")
c5=FrameEvaluate(c6, "Evaluatec1()")
c4=FrameEvaluate(c5, "global blendlc1 = comblc1 < comblc2 ? 0.5 * Exp(0.8 * Log(comblc1 / comblc2)) :
\ 1 - 0.5 * Exp(0.8 * Log(comblc2 / comblc1))")
c3=FrameEvaluate(c4, "global comblc2 = LumaDifference(combingc1, combingc2)")
c2=FrameEvaluate(c3, "global comblc1 = comblc2")
c1=FrameEvaluate(c2, "global comblc0 = comblc1")
return(c1)
}


# (running inside of the Conditional Environment)

function Evaluatec1()
{
vid0 = blendclip
vid1 = blendclip.trim(2,0)

global blendmadec1 = MergeLuma(vid0,vid1,blendlc1)
global blendpicc1 = blendclip.trim(1,0)
}

function Outputer()
{
(isblend == true) && (comblc1 < comblc0) ? output.trim(1,0) : (isblend == true ? output.duplicateframe(0) : output)
}

You can use Cdeblend in one script together with Cdeint. I changed the internal names and tried to make it simple, but I donīt know how stable it is.
And yes, it do itīs job on your source not to bad. You should save the video output once before you try to realize the third point.
The thresh parameter is most important for the results. Lower values mean a stronger blenddetection. Tclip is like the bclip for Cdeint.
Nice tryout :D

Edit: Please set the mlv=0 (and the mnv) for Cdeint, that makes the third step easier.

Didée
14th July 2005, 00:13
Halt, full stop. Does CDeblend replace the found blends always with the previous frame, always with the following frame, or is this mostly random? That's important! Because, for a selfmade dup repair function we should know if we must replace the first or the second of the produced duplicates ... this can be controlled on creation time, it makes no sense if the 3rd pass must start guessing which is which.

Or even better, if your blend detection is that good: instead of producing duplicates, replace the blends with full-white frames. Then, later, the prepared input clip itself can be used as a mask to overlay the interpolated frames. Easy as cake, no dup detection is needed in the 3rd pass.

Theoretically it could be also done in one go, putting the mv-interpolator directly into CDeblend. But ... applications of MVTools sometimes tend to use much memory, sometimes *very* much. Not a good partner for using AviSynth's Conditional Environment at the same time. Probably it's safer to keep them apart.

MOmonster
14th July 2005, 07:07
Halt, full stop. Does CDeblend replace the found blends always with the previous frame, always with the following frame, or is this mostly random? That's important! Because, for a selfmade dup repair function we should know if we must replace the first or the second of the produced duplicates ... this can be controlled on creation time, it makes no sense if the 3rd pass must start guessing which is which.
Last night I didnīt thought of this problem. Now it outputs a blankclip. Do you know, how I get the color white?

Theoretically it could be also done in one go, putting the mv-interpolator directly into CDeblend. But ... applications of MVTools sometimes tend to use much memory, sometimes *very* much. Not a good partner for using AviSynth's Conditional Environment at the same time. Probably it's safer to keep them apart.
This is what I thought. Also the combination of Cdeint Cdeblend seems to be not that stable. Trying to run it with another big function I think wonīt be the best way. But maybe I could use the function direct in Cdeblend. Iīll search for the thread, but before weekend I wouldnīt have the time for it.
I think sharfis_brain has created such a function. I never used the mvtools before. Weīll see.

Didée
14th July 2005, 12:09
Regarding CDeintMod:

Yesterday evening I made a few quick & nosey tests with the new version. Sorry to say, but the motion smoothness was worse than with the preview version (for Voyager's intro) you PM'ed me the day before.
I didn't test with that VOY intro, but with some scenes from ENT NX-01, Star Trek TNG, and with a strange music video*) .

No matter what I tried (mlv: 0.5|1.0|1.5|2.0 / bthresh: 10|15|22|25|30 / in different combinations), the new version gave me more of that micro-stuttering, and also let some more blends slip through than the tweaked version did.

That's just what the naked eye saw. For the causes "why", I've no clue.


*) "Broken" from Seether + Amy Lee. This one is driving me nuts. It basically follows the usual pattern, BUT the converter box seemingly was set up to use blending only for the weights close to 50% - there are less than half as much blends as "should" be there ... instead, there are duplicate fields. PLUS, the source contains pretty much mpeg artefacts like dct noise and the beloved "texture jitter".

Both CDeintMod and Restore24 fail big time on this one ...

MOmonster
14th July 2005, 17:04
@Didee
Worse than your preview version? If you set the mlv and mnv to zero and and the bthresh to 22 the output should be absolute the same.
Would be nice, if you can send me also another footage my function has this big problems with.
Iīll change the behaviour of my output function soon, but this wonīt solve the big problems :confused:

Eidt: With this micro-stuttering do you mean a stuttering every second (for pal) or also inside the pattern?

Edit2: I get what you mean in some more test. Iīll work on it.

MOmonster
23rd July 2005, 23:39
@yaz
I had some time to work on my functions the last night. My next just better Cdeint version Iīll offer next week. But I also created the function for your use.
So here is my motion_interpolate_deblend function:

crop(8,8,-8,-8)

ord = last.getparity() ? 1 : 0

a = tdeint(mode=1)

c = leakkernelbob(order=ord).BilinearResize(480,288)

motion_interpolate_deblend(a, tclip=c, thresh=45)



Function motion_interpolate_deblend(clip input, clip "tclip", float "thresh")
{
###### PREPARATION ######
e = input.selecteven()
o = input.selectodd()
tempe1 = e.MVAnalyse(isb=true, sx=4,sy=4, lambda=4000)
tempe2 = e.MVAnalyse(isb=false, sx=4,sy=4, lambda=4000)
eout = MVInterpolate(e, tempe1, tempe2, nb=1, bl=0.5, el=0.5, fbw=4).trim(1,0)
tempo1 = o.MVAnalyse(isb=true, sx=4,sy=4, lambda=4000)
tempo2 = o.MVAnalyse(isb=false, sx=4,sy=4, lambda=4000)
oout = MVInterpolate(o, tempo1, tempo2, nb=1, bl=0.5, el=0.5, fbw=4)

global intout = interleave(oout,eout)
global diffval = default(thresh,50.0)/100.0 + 1.0
global output = input
global blendclip = tclip

###### FRAMES FOR BLENDPARAMETERS ######
global frame_c0 = blendclip
global frame_c1 = blendclip.trim(1,0)
global frame_c2 = blendclip.trim(2,0)

###### VAR.. ######
global diff_c2 = 1
global btest1 = 1
global btest0 = 1

###### Conditional Function Chain, evaluated from bottom to top (!) ######
b99=scriptclip(input, "(btest0 / btestb + btest0 / btest1) < diffval ? intout : output")

b4=FrameEvaluate(b99, "global btest1 = LumaDifference(MergeLuma(frame_c0,frame_c2,blendl), frame_c1) /
\ (diff_c1 < diff_c2 ? diff_c1 : diff_c2)")
b3=FrameEvaluate(b4, "global blendl = diff_c1 < diff_c2 ? 0.5 * Exp(0.85 * Log(diff_c1 / diff_c2)) :
\ 1 - 0.5 * Exp(0.85 * Log(diff_c2 / diff_c1))
global btest0 = btest1")
b2=FrameEvaluate(b3, "global diff_c2 = YDifferenceToNext(frame_c1)
global btestb = btest0")
b1=FrameEvaluate(b2, "global diff_c1 = diff_c2")
return(b1)
}

It use the newer simpler and better Cdeblend, but it doesnīt double the frames, it interpolates the motion.
I donīt like the results of mvinterpolate too much, just to blocky for my eyes. But of course better than your strange blends. :)
Higher thresh values mean detecting more blends (everything higher than 75 is too heavy I think).
Just try it out. I donīt tested it till now together with Cdeint, but you can try if they run together. Alone it just runs stable for me.
I hope this help you a little bit.

ps: I donīt know much about the mvtools parameter. If you want to tweak them, therefore you should ask anybody else. :sly:

MOmonster
26th July 2005, 19:26
@all
Ones more I updated the my function. It has many big changes, not only the change of the name.
I wrote a readme and created a package that includes Cdeint, Crestore and Cdeblend.
The bthresh value and with it the blenddetection work different from the last version. The motion is now much better and many other changes applied to the function. It is really worth a try. ;)
Originally Posted by scharfis_brain
how does it handle the Starship Voyager Intro video?
Is it able to deblend the nebula scene without jerkyness?
Yes on my test, the newest version really seems to handle this hard stuff. :p

Didée
28th July 2005, 15:30
Oh, the attachment has appeared ;)

Could only do two small tests so far on Crestore. Judging from these, the new routine seem to do a darn good job. Very well done, MOmonster!


And yes, even the VOY intro is almost perfect now. Small problems detected:

1) In the beginning, from ca. 0:06 to ca. 0:14, there was a slight "pulsing" in the motion - not jerky, just a very small speed difference in the flow of motion. However the effect was not very easy to spot.

2) A clear jerk (dup) was produced around approx. 0:37 (floating blue nebula scene), but this could also have been caused by decimating to 24fps instead of 23.976. (Should be re-tryed with another decimator.)

3) The blended scene transition at 0:49 was definetly jerky - the flying rock was appearing in a bonanza style ...


No. 1) is rather minor - I just noticed it on 3rd view. No. 2) could be an issue of the decimator, so it doesn't count for now. This leaves us with 3) as the only noticeable error in the whole sequence. This is a very good result indeed.

In relation to No. 2) , I'd suggest to switch to another decimator than decimate() - either TDecimate or FDecimate. In the most common standard case, for each 1000 PAL frames there *are* only 959 FILM frames available to restore. Decimating to 24fps tries to restore 960 FILM frames instead, so one jerk (duplicate) is preassigned. There's no guarantee to avoid these by decimating to 23.976 fps, but the chances are much better.

MOmonster
28th July 2005, 16:15
Thanks for the testing Didee,

the first and the second point I know very well. The first is because it donīt find the pattern so accurate, it need some seconds or better a high motion scene (with clear fields) to find the pattern offset more accurate. And yes the second point is because of the decimation process. Theoretical tdecimate should give better results with the right settings, but I donīt get it running together on my pc (not enough ram I think or something similar). Fdecimate doesnīt create good results, thatīs why decimate is recommed.
Because of the third point, Iīll have a closer look on it. Maybe itīs just a point of the bthresh. Weīll see.
I already think about the next version, but mainly to get it more stable and maybe a little bit faster. ;)

MOmonster

MOmonster
9th August 2005, 23:41
@all
I just updated my Crestore function. Ones more there are big changes.
I still donīt get the voyager intro fully dup free, but the third point Didee spokes about doesnīt happens anymore. The new function is more flexible because of the range parameter. The blend detection core is updated and it doesnīt need anymore a decimater. There are two Crestore functions that output 23,976 or 25fps. Crestore_pal wasnīt tested till now, because I have no sources with such a conversion. :o
If you use leakkernelbob for the bobbed input the speed increase significantly compared with my last version. If I use tdeint the speed decrease very strong, I think this is a memory problem (256mb ram has my pc). Maybe somebody with more pc performance could test the speed difference. For more informations, please read the updated readme.

So or so, the new functions seems to do what I want. The development of this package will slow down a little bit in the next time, because I donīt have much more ideas for this function and there are other projects, I want to do.

For the near future I plan to test a totally different simpler and faster blend detection, maybe the next version will ones more have a small speedup.
Also the missing mnv & mlv parameter give me the idea for a new function. :D

Cu, MOmonster ;)

Edit: There was a small bug in the blend detection, I had fixed. Please download the newest version for tryout.

Edit2: I find out where this big slowing down came from. Its the range parameter. Set it smaller (down to 2), if you have this speed problems.

MOmonster
18th August 2005, 12:59
Ok, ones more a new Version (v0.9b) of Crestore is out. Also Cdeblend is updated. The speed problems are solved. This version is the fastest Crestore till now, also the dup problem seems to be solved. I really like the output. :)
The readme is updated, there are some new parameters, so please read it.
At this point I think, that it is a real alternative for restore24. Also the quality fanatics should have a look on it. ;)

Didée
18th August 2005, 14:24
I would give applause, but ... try processing the Voyager Intro with an additional "trim(8,0)" before doing anything else, and prepare for an :eek: effect.

BTW, somehow the flying rock is still riding bonanza for me?

MOmonster
19th August 2005, 08:34
@Didee
So I use trim(8,0) before the script. No problems. It makes no difference for me. Or did you use it only on the bobbed inputs?
I switched framewise the first 1800 frames and there were no dups, but how fluency the motion is I canīt say you, because on my 60 hz monitor the whole intro doesnīt looks that smooth. I try to make it better in my next version. :sly:

I know what you mean with the motion of the rock. No dups, but bad motion, because there are too many blends left. I think with the right settings it should be possible to make it better. I will play a little bit with the parameter this evening. :cool:

Didée
19th August 2005, 13:03
Oh, indeed. My apologies. In fact I was testing the version you PM'ed me, and that one showed the behaviour I mentioned. And since you said apart from some minor thingies it were practically the same, I drew my conclusion.

Still, I think your used method is not correct, and don't understand why it seems to work nonetheless:
Basically, Crestore_xx is producing a de-blended stream @ input framerate, and you're simply calling a "changeFPS(x.xxx)" on that, at the end. This seems more than risky to me, since the source can contain the blends in arbitrary positions, where ChangeFPS works its way through in a fixed pattern.

Or did I miss something, and ChangeFPS has bacome a smart decimator that chooses the least-difference frames for dropping? :confused:

MOmonster
21st August 2005, 22:56
@Didee
I pm'd you to explain how my function does it.

@all
A smaller update of the package. A small improving of the blenddetection should give better results (also for the rock scene, but still far from perfect). Crestore and Cdeblend donīt have any longer a nlv parameter.

Roscoe62
24th August 2005, 21:23
At the risk of incurring wrath for being a total newb, I'd like to know the best way to use this function. I'm trying to "clean up" my PAL ST:TNG episodes and using a function like this seems the right way to go.

However, I'm unsure of the best way to apply it in an avs script. I know I'll be using a .d2v file based on the DVD Vobs of the individual episode for an input. I also know that, ultimately, I wish to produce an XVid file as the finished result, by feeding VDubMod the avs file. However, is it better to apply a function like this as a separate step before doing the XVid conversion - i.e. Produce a "corrected" file first before worrying about doing the XVid conversion (and if so, a file of what format is best?), or do it all in one go - fix it AND produce the XVid?

Sorry if this seems like an overly simple question to ask, but the avisynth FAQs and tutorials don't really cover a situation as specific as this one, and I'm grateful for any help or advice.

Cheers
Ross

MOmonster
24th August 2005, 21:52
@Roscoe62
Did you already try this function. Imean for some sources it works really nice, but in general restore24 still produced the better results in my tests. :angry:
But of course the big advantages till now are the speed and stability. Till now I donīt find any problems running it with virtualdub to get a xvid file. Maybe if you want to do a twopass encoding or your script has many other functions or filters you should first produce the corrected file (I didnīt try a twopass encoding yet), but till now I see no problem to do it in one go. ;)

If you want to produce a corrected file before you should use a lossless codec. The most popular is huffyuv, but there are also some slower but more efficient codecs.

Roscoe62
25th August 2005, 21:22
Thanks MOMonster,

No, I haven't tried your function yet because, as I thought I hinted at in my earlier post, I haven't quite figured out how to use it yet! I had a look at your script, and I know I'd import it into my own script but, apart from using the import line in my own script and possibly tweaking some parameters in C_package, is there anything else I should do?

I "think" I figured out how to use Restore24 last night and I decided to use it in 2 passes. The first involved importing R24 and doing all normal processing EXCEPT using the dust filter and converting to XVid. Instead I just created a Huffyuv file. The next stage I'll use that Huffyuv file as the input, add my dust filter and do a 2 pass XVid encode. I'm interested to see the results, but I'm still very keen to try out C_restore to compare.

Also, Didee says to try your C-restore function, and you're telling me to try R24, so who should I believe?? :D

Again, sorry for the newbie questions, but I'm grateful for any guidance you can provide.

Thanks again!

Roscoe62
25th August 2005, 22:26
Just quickly checked again and I see the C_package contains 4 distinct functions so do I just choose to use one of the functions (Crestore_film perhaps?) or just import all?Hmmm.....maybe I need to do some more reading :-{

MOmonster
25th August 2005, 22:27
@Roscoe62
Ok, short to the differences between these both functions.
At this point for non-anime sources restore24 gives the better results. The output of my Crestore isnīt that smooth like restore24 for some sources (on other it works great, but there are many examples restore24 works better).
So qualitywise for the most sources restore24 gives better results (donīt has to be, just try it out).
But my function has also some advantages. It is much faster than restore24 (will change for the next version, restore24 get much faster). You donīt has to load so many filters (only the bobber), because it works with the internal filters of avisynth2.5. The whole function isnīt that komplex and runs more stable on my system and it doesnīt has the limitations of smartdecimate (50min length, but ofcourse you can use tdecimate instead).
So you can do the filtering and encoding in one go :D
But if time and space arenīt that important for you and you see the motiondifferences between these functions of course you should use restore24.
And yes to use my function just load the avs and the filter for the bobber and then begin to tweak the settings. Defauts doesnīt work that bad. Please read the readme for more. ;)

For pal material Crestore_film. Donīt use Cdeint!!!. If motion isnīt good enough for you, you can also try Cdeblend with a decimater.

MacAddict
7th September 2005, 12:14
Just trying this for the first time. Anyone tried running this function with the latest AVS 2.56 RC1? I'm getting an invalid argument to 'trim' on line 41 of the function. Maybe I'll go back to 2.55 and give it a try later.

Wilbert
7th September 2005, 12:19
Which line is line 41?

MOmonster
7th September 2005, 14:49
@MacAddict
What function did you use. With avisynth 2.55 it all seems to be ok. Iīll test it with version 2.56rc1 the next time.

MacAddict
8th September 2005, 00:06
Sorry for the delay guys, just got in from work.

I'm not sure what line is 41 to be honest because it's all dependent on which application opens the avs file. VdubMod editor shows this line as being 41 and in fact has 'trim' in red letters for some reason.

global testclip = bclip.trim(2,0)

The function I tried was Crestore_film() on a PAL blended DVD source. Korean flick named Seom.

mg262
8th September 2005, 02:36
It is probably objecting to bclip because there is something wrong with it.

MOmonster may be able to pinpoint the problem straightaway, but I think it might help if you were to post the arguments for your function call -- or even better the whole script you are using.

I've just opened up the script, and it looks to me like you may not be passing enough arguments to the function... but that's just a guess.

MOmonster
8th September 2005, 09:40
I just installed the newest avisynth and has no problems to run my script.
I think mg262 is right. You doesnīt set all the clips.
My function needs three different clips, the source clip the bobbed clip for the output and the bobbed clip for the analyse. This is my script:
LoadPlugin("C:\program_me\dgmpgdec\DGDecode.dll")
LoadPlugin("C:\program_me\filters\leakkerneldeint.dll")
LoadPlugin("C:\program_me\filters\TDeint.dll")

import("D:\work\C_package.avs")

MPEG2Source("D:\dvd.d2v")
#ConvertToYUY2(interlaced=true)

#crop(16,32,-16,-32)
ord = last.getparity() ? 1 : 0

a = last.leakkernelbob(order=ord, sharp=false, twoway=false, threshold=4)
b = a.crop(32,32,-32,-32).BilinearResize(640,352)

Crestore_film(bob=a, bclip=b, bthreshmin=48)
It is necessary to set the bob clip and the bclip. If you donīt set the clips direct, you can also do it that way.
ord = last.getparity() ? 1 : 0

a = last.tdeint(mode=1)
b = last.leakkernelbob(order=ord, sharp=false, twoway=false, threshold=4).crop(32,32,-32,-32).BilinearResize(640,352)

Crestore_film(last,a,b)
That a fast smart bobber for bclip and your favourite bobber for bob.The first clip Crestore use is the sourceclip (last). For optimal settings, please read the readme. ;)

Didée
8th September 2005, 10:08
@ MOmonster

Save yourself from such hassle ...
Function Crestore_XYZ(clip clp, clip "bob", clip "bclip", [...]
{
warning1 = """clip variable "bob" was not specified"""
warning2 = """clip variable "bclip" was not specified"""
bob = default( bob, clp.bob().subtitle(warning1),y=24 )
bclip = default( bclip,clp.bob().subtitle(warning2),y=40 )
[...]

mg262
8th September 2005, 10:22
Add to that: as I understand it, putting quotes around an argument allows that argument to be omitted... if I'm correct the following would also work:

Function Crestore_XYZ(clip clp, clip bob, clip bclip,...)
{
[...]

MOmonster
8th September 2005, 10:57
@Didee
Youīre right, maybe such warnings would be better to understand what is wrong. Iīll implement it in my next function, but I donīt know when (and if) I renew this version.

MacAddict
8th September 2005, 14:16
My sincere apologies, I apparently didn't have my bobber set for the bclip even though I read the readme twice. Thanks so much for the explinations and help.

MOmonster
28th September 2005, 20:38
Small bugfix (wrong handling with pattern smaller than 8 Frames), Crestore has now version 0.9e.
There are no changes, the development of Crestore has stopped for other projects.

MOmonster
5th April 2006, 10:02
Because I got the feeling that Crestore is still used, even though there was no development, yesterday I decided to implement the code of the final Cdeblend into Crestore to also finalize this function.

These are the changes:
- new modes -> hq mode is 20% slower than the old Crestore version but much better, mode<0 is still significantly better and 20% faster than the old one (with simple bobber: realtime)
- instead of Cdeint, Crestore_pal & Crestore_film you have just a rate parameter in Crestore(), so you can output also 24fps
- different easier handling and more tweakable
- mt_masktools needed to run the function (included into the zip)

All in all this version works significantly better than the last one.
You find the downloadlink in my first post.

Backwoods
5th April 2006, 10:46
Invalid Attachment specified. If you followed a valid link, please notify the administrator

When clicking the link you posted.

MOmonster
6th April 2006, 07:45
A login was needed, I donīt know why? But it should work now.

Backwoods
6th April 2006, 19:37
Works now, thanks.

MOmonster
7th April 2006, 07:06
Update:
A small bugfix, because a copy and paste mistake, but nothing you will realize during running the function.

stg
8th April 2006, 09:31
I can't make this work, perhaps I'm too much of a n00b :confused:

Everything looks fine until I start the encoding, then I get some unspecified error.

Alain2
8th April 2006, 13:58
No problem for me, works fine, thank you MOmonster :) (btw the name of the function is now Crestore, not Crestore_film as shown in the first post)

stg
8th April 2006, 16:04
Ok, now it works for me too, awesome.

Gotta check out those parameters more carefully, though. The TNG episode I encoded has even more stuttering than the original had..... ;)

MOmonster
10th April 2006, 07:27
@Alain2
I donīt find the function name in my first post. But yes the last version has this name, because there was no rate parameter and I seperated the basic function into Crestore_film and Crestore_pal. But now there is only the function Crestore.

@stg
If you have pal material the stuttering shouldnīt be worse than before. Only in really low motion scenes the decimation donīt work so good because Crestore has only a simple patterndetection for the decimating. For anime and highmotion scenes everything runs fine for me, but on low motion scenes and sources with many edits the decimation works not so good.
If you have NTSC footage you should set the rate parameter to 25. Also this function is only tested with two small NTSC samples, because I live in a pal country. If you have a source for me Crestore donīt work good on maybe you can upload a small sample.

Thanks for the kind words.

stg
10th April 2006, 09:16
The material I was trying to encode was Star Trek TNG season 1 episodes. PAL/European release.

It seems those DVD's are not very good to begin with, and when they're encoded to XviD, they stutter a lot.


Ok, I uploaded this 30mb sample. This is not even the worst case of such stuttering, but if you look at it you will see what I mean. Especially at 35 seconds, the scene in which the captain's face is shot closely.

Sample: http://s37.yousendit.com/d.aspx?id=3L4147J0TGWV503ZDJVIFNRQZO

If someone has encoded these episodes succesfully, I would like to know how/what parameters/etc. was in use. :)

foxyshadis
10th April 2006, 09:50
TNG PAL is probably one of the most frustrating to restore, because it's converted hybrid material, and that's always bad news. You're going to have trouble because some scenes were originally 24 fps, some were 30p, and some were 30i, all now merged into 25i. It's impossible to deinterlace that while keeping a natural framerate, which is why the xvids look so choppy. (Unfortunately I have no good suggestions on handling it, my experience mostly ends at ntsc hybrid.)

MOmonster
10th April 2006, 10:40
You said your source is a dvd, but you send a avi. I need a unprocessed sample to get the problem. If it is really so as foxyshadis said of course Crestore canīt produce a fluid output. Also restore24 will be far from perfect (but will be more fluid than Crestore). The only thing will be unblend (Cdeblend wonīt work with real interlaced parts, but can result in better fluency than Crestore) + hybrid decimating, but I donīt know what tdecimate is able to do in such cases.:o

stg
10th April 2006, 11:39
I must have had a brainfart or something, and posted .avi sample, hehe :sly:

Anyway, here's a sample from the DVD, packed with WinRAR:

(had to put it to 3 packs because of the new yousendit limitations, it's total of 145 mb. Considered making a smaller sample but with this you clearly can see the stuttering)


Part1:
http://s38.yousendit.com/d.aspx?id=0MT87957T0H1Y1LV0Y0TR00F03

Part2:
http://s38.yousendit.com/d.aspx?id=1VELUD4P3EOL2213ISRYDXMCKQ

Part3:
http://s38.yousendit.com/d.aspx?id=0YN93R5Q89YKA1UOOIG5OQQ98G

Alain2
10th April 2006, 14:19
@Alain2
I donīt find the function name in my first post. But yes the last version has this name, because there was no rate parameter and I seperated the basic function into Crestore_film and Crestore_pal. But now there is only the function Crestore.

Oups sorry, i was looking only at the top, but I am at page 4 of this thread ^^
Good function you created, works nice on a kenshin dvd I was given, better than r24rc1 (or maybe I don't know how to tweak it) ; your function eliminates the worst blends, only leaving small ones, but they are not too visible when watching at normal speed :)

MOmonster
12th April 2006, 10:38
@all
Crestore is updated: Thanks to Didee who recognize a bug with a resized "clip2", there was a bugfix and the mt_masktools are now in Version 2.0a28 packed.

@Alain
For anime samples you get a better blenddetection with higher modes (4-8). For really low motion you should choose a bthresh near 100 (between 101 and 111) and not use the mthresh (set it to 0). For extrem low motion (only with postrocessed clip2 or really good quality of the source) Cdeblend(sd=true, mode>5, mil=?) will give a really heavy detection. The sd parameter isnīt implemented in Crestore and can also lead to a wrong detection (not so save).
It can also be, that some parts are overblended, no simple normconversion (-> special Cdeblendmodes).

@stg
I downloaded your samples and will have a look on it this evening.

Fizick
12th April 2006, 16:15
MOmonster,

Thanks for your works! I will try it.

One non-technical comment (it is general, not only to you) .

If you distribute GPL plugins binary (mt_masktools.dll), you must distribute its source too.

Here is part 3 of GPL license text:




3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,

b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,

c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)


Our case is case (c).
So, if you downloaded some GPL binary WITHOUT source (for example Avisynth2.56, which have separate source archive package), you may distribute it without a source too.

But if you downloaded some GPL binary WITH a source in one zip package, you must distribute whole package (with source).

Other possible solution - do not distribute any plugins, but links only.
It will make your archive really very small.

Third You also can solution: make their separate full plugins package at your site.

GPL is not very "free" license.

MOmonster
13th April 2006, 08:06
@Filzick
Oh, I didnīt know that, thanks. Iīll do that.

@stg
I had a look on your sample yesterday. And yes itīs no wonder that Crestore doesnīt work on this sample. Your sample is the result of a so called DEFT conversion, scharfis_brain might correct my. So itīs not so bad like a hybrid source.
There are some possibilities to restore this.
You can for example use Cdeblend with the right settings (mode=1,...) and than decimate to 25fps. Or you use my unDEFTmatcher. Itīs a little bit older, but the results with your source were ok. This is the script I used:
a = last.tdeint(mode=1)
unDEFTmatcher(last, bob=a, MI=55)

Function unDEFTmatcher(clip clp, clip "bob", float "blenddiff", int "MI")
{
###### PREPARATION ######
MV = default(MI,77)
global out = bob
global testclip = clp.separatefields()
global combclip = clp
global matchmask = clp.tfm(mode=0,pp=2,MI=MV,clip2=clp.greyscale())
global diff = default(blenddiff,1.15)

###### VAR.. ######
global me1 = 1.0
global mo1 = 1.0
global choose = false
global match1 = false
global matchc = false
global match0 = false
global matchb = false

###### Conditional Function Chain, evaluated from bottom to top (!) ######
c99=scriptclip(clp, "match1 == true && match0 == true && matchc == matchb ? matchmask :
\ (choose == false ? out.selecteven() : out.selectodd())")

c5=FrameEvaluate(c99, "global choose = ((me1 < me0 ? me0/me1 : me1/me0)*diff < (mo1 < mo0 ? mo0/mo1 : mo1/mo0)) ||
\ (match0 == true && matchex == true && matchbb == matchb) ? false :
\ ((me1 < me0 ? me0/me1 : me1/me0) > diff*(mo1 < mo0 ? mo0/mo1 : mo1/mo0) ? true : choose)
global match1 = AverageChromaU(matchmask) != 128.000 ? true : false
global matchc = ChromaUDifference(matchmask,combclip) < 0.001 ? true : false")
c4=FrameEvaluate(c5, "global match0 = match1
global matchb = matchc
global me1 = YDifferenceToNext(testclip.selecteven())
global mo1 = YDifferenceToNext(testclip.selectodd())")
c3=FrameEvaluate(c4, "global matchex = match0
global matchbb = matchb
global me0 = me1
global mo0 = mo1")
return(c3)
}
You need tivtc to run this function and and should maybe optimize the internal tfm settings for your source.
Scharfis_Brain also created a function to restore these sources. You find it here (http://forum.gleitz.info/attachment.php?attachmentid=75839&d=1127239982).
I donīt know what is the optimal way for your source. Some less duplicates will be there because the transitions (between fieldshifted and progressive, fiedshifted and blended, ...). In case of speed and quality I prefer unDEFTmatcher. But if you hate single blends on scenechanges (I donīt recognize them during playback), the other to possibilities might work better for you.:)

Edit: I remove mt_masktools from the zip because of the GPL licence. You can download Manaoīs newest mt_masktools here (http://manao4.free.fr/).

stg
13th April 2006, 15:24
Thank you for checking out the sample and for the script !!

I'll try it today and see if I can make it work, I'm not very good with this yet, I'm n00b what comes to these....

I was wondering if you could paste me the exact avisynth script + the exact parameters you used with this script, while testing that clip, thank you :)

MOmonster
14th April 2006, 12:49
I was wondering if you could paste me the exact avisynth script + the exact parameters you used with this script, while testing that clip, thank you :)
I allready gave you the full script in my last post (without the loading of the necessary filters):
#here you have to load the necessary plugins: tivtc, tdeint and DGDecode

mpeg2source("...")

a = last.tdeint()
unDEFTmatcher(last, bob=a, MI=55)

#and here is the code for the function
Function ...
The only advice I can give you (canīt test it over the weekend) is to lower the cthresh and maybe also the mthresh in tfm inside the function for your source:
global matchmask = clp.tfm(mode=0,pp=2,MI=MV,clip2=clp.greyscale())
|
V
global matchmask = clp.tfm(mode=0,cthresh=7,mthresh=3,pp=2,MI=MV,clip2=clp.greyscale())
Hope this is clear enough now.;)

stg
14th April 2006, 20:03
Thanks :)

Got it working now, altough I'm still making something wrong as my clips look "wacky", sometimes repeating the same scene multiple times.

Let's see how soon I can produce good results ;)

MOmonster
15th April 2006, 11:29
Thanks :)

Got it working now, altough I'm still making something wrong as my clips look "wacky", sometimes repeating the same scene multiple times.

Let's see how soon I can produce good results ;)
This is a problem I get sometimes if I load different vobs (from different sources) in dgdecode. Create a new d2v and try it one more time and use the source and dgdecode only in one instance.

Cu, MOmonster.:D

stg
18th April 2006, 06:39
It seems I get some promising results with CDeblend, not "quite there yet" but promising.

But with unDEFTmatcher.... every time the result looks like this:

http://download.yousendit.com/B4EE2B485990C698

Tried with different sources, dunno what's wrong.

MOmonster
18th April 2006, 11:34
Oh sorry, there is a big mistake in my script. Of course the bob parameter want a bobbed clip. Instead of a = last.tdeint() it should be a = last.tdeint(mode=1). I hope this works.:o

stg
18th April 2006, 15:22
Ok, now the results look much better ! Thanks. Doesn't look "wacky" anymore :D

MOmonster
10th May 2006, 10:56
Another update:
Crestore is updated to 1.0v2. I included the smoothmotion conditions that gives a much better patterndetection and motion for many sources. Because this donīt work so good for 12fps sources and with wrong settings it can conflict with the basic blenddetection default it is disabled. To enable this feature set the smuse Parameter (10-50).
Also I added another function called Mrestore. Itīs similar to Crestore but it works better for good quality natural sources. It doesnīt need any external filters and has the same speed as Crestore(mode=-x) (->fast).

desta
10th May 2006, 19:23
I'm trying this out as Restore24 just doesn't want to work for me, but I when I load my script into Vdub Mod, there is always a message saying "Choosen *rate* won't work!!" Doesn't matter what rate I use or what changes I make to other settings, it doesn't go away.

There's also still a hell of a lot of telecined/field blended frames remaining.

:(

MOmonster
11th May 2006, 07:16
You have to bob the source before you use C/Mrestore. For a PAL source you first bob to 50fps and than use Crestore/Mrestore with the rate 23.976 (default), for a NTSC source you first bob to 59.94fps and than choose the rate 25 (this is only the default case).
Example:
MPEG2SOURCE("... .d2v")

tdeint(mode=1)
Mrestore()

If this doesnīt work, a small sample could help.

desta
11th May 2006, 21:19
Many thanks. That did sort out the "choosen rate" error. I am still getting a lot of blended frames left over though, and quite a lot of interlaced ones too. I'm very new to this kind of restoring, so it's probably a case of me doing something wrong.

I'm uploading a sample vob somewhere now. Should I just paste the link here when it's done, or pm it?

Thanks again.


edit: I've uploaded it. It's a 106MB 2 minute sample, with a lot of fast motion. Megaupload.com - sample.rar (http://www.megaupload.com/?d=EBQXCMRL). I apologise if the link is not allowed in the forums.

MOmonster
12th May 2006, 07:48
Many thanks. That did sort out the "choosen rate" error. I am still getting a lot of blended frames left over though, and quite a lot of interlaced ones too.
There shouldnīt be interlaced Frames after tdeint(mode=1). I hope you used Crestore and not Mrestore. It was just a sample, the last version was only for a limited range of sources. Your sample is really big but I downloaded it and will have a look on.

@all
I made another update.
Crestore is now a part of Mrestore. Mrestore has a modified blendthresholding and needs now also mt_masktools.
It enables profiles for a easier use of Mrestore. For more informations, please read the Mrestore.txt.

desta
12th May 2006, 08:00
There shouldnīt be interlaced Frames after tdeint(mode=1). I hope you used Crestore and not Mrestore. It was just a sample, the last version was only for a limited range of sources. Your sample is really big but I downloaded it and will have a look on it.
I realise there shouldn't be interlaced frames, which is why I mentioned it. I used Crestore. Hopefully you'll see what I mean from the sample... I get the impression they did a very bad job of telecining/blending/ntsc>pal transfer. I'm actually thinking of just returning the dvd and buying the R1 version.

I appreciate the help.

Alain2
12th May 2006, 13:00
Good idea the profiles :) Maybe you can have a look at the hybridfupp script to see how he creates and handles profiles, seems easier to read and maintain ;)

MOmonster
12th May 2006, 15:23
@Alain
Maybe Iīll do it, but at the moment Mrestore is finished. I have no idea for a faster or better blenddetection (at the moment). The decimation is not so good like in restore24 but itīs really fast and the basic idea of Crestore. Weīll see what comes next. Iīm more interested in programming at the moment.

@desta
tdeint(mode=1)

Mrestore(profile=2)
#Mrestore(profile=6)
This works for me. The output is fluid and the blends are gone. The strong motionblur in some scenes is more disturbing than the really less blends left (for me). These artefacts that looks similar to interlacing are compression artefacts because of the blendconversion. I donīt know if there is much you can do against (you can open a thread and ask for). Profile 2 and 6 both performs good with your source (I like profile 2 a bit more, but this is my taste), but I canīt say what will work better for the whole animation.
I think buying the r1 version is the best idea if these artefacts are too disturbing, but you should first try it, because the pattern is correct detected.

desta
12th May 2006, 20:11
Thanks for the advice MOmonster. I'm gonna check those profiles out and see how it looks. I'm just annoyed that Sony would go through this process to make a PAL DVD... I would've thought it made far more sense to just speed up the progressive film rather than go all 'round the houses the way they have.

Anyway.. I'm rambling, hehe. Thanks again. :)

Alain2
12th May 2006, 23:57
@Alain
Maybe Iīll do it, but at the moment Mrestore is finished. I have no idea for a faster or better blenddetection (at the moment). The decimation is not so good like in restore24 but itīs really fast and the basic idea of Crestore. Weīll see what comes next. Iīm more interested in programming at the moment.
Don't do it for me, i mentionned it just in case you didn't know of this preset method, which can help you I think if you have to dive into the code later.. Thanks for the updates btw :)

Backwoods
14th May 2006, 06:45
I've been trying every version of Crestore and FixBlendIVTC up to this point and it seems I'm getting the same results with Mrestore. Possible that this movie is not recoverable? I provided a sample below. Thanks in advance.

Right Click, Save As (http://www.cleanandquiet.com/ns/ns_sample.m2v)

MOmonster
14th May 2006, 12:27
I have no avisynth here, but in virtualdub your source is progressive blended. Because your short sample has no 24fps parts Iīm not sure about the complete movie, but for your short sample Cdeblend (+ decimator if wanted) should work. Maybe you can upload a sample with a 24fps scene (fast motion or picture effects) if there is such a scene in your movie.

MOmonster
16th May 2006, 09:40
@Backwoods
For your short sample Cdeblend(dmode=8,omode=1,sd=true) cleared all blends, but I really donīt know if this will work the whole movie.

MOmonster
16th August 2006, 09:17
Update:
There was a bug in the profile settings. Using mode>=0 and smuse>0 doesnīt have the wished effect, so Mrestore and Crestore are separate functions again. There are some internal tweaks and the readme is changed. Crestore is recommed for 12fps sources (animes and so on) and pal restoring from ntsc footage. For other sources Mrestore should be used.
Mrestore and Crestore wonīt run together in one script, because same global variables. But using both in one script makes indeed no sence, so I didnīt change it.

MacAddict
19th August 2006, 00:11
@MOmonster

Thank you very much for this _very_ useful function. I'm having excellent success using it for PAL->NTSC field blended material and vice versa. I've had several movies sitting on my drives for a year waiting for some success, now I've encoded all of them using either Crestore or Mrestore. Great work!

MOmonster
13th October 2006, 08:34
@MacAddict
Thanks for the kind words and sorry for my late reaction.

I updated the R_pack with a preview Mrestore v1.5 build. It works clearly better than the older C/Mrestore.
No time to write a changelog but the readme is updated.
Nice tryout.

MBoufleur
18th October 2006, 00:53
Hi there,

just tried the Mrestore as below, but I get a message on top of the video Choosen *rate* won't work!!

LoadPlugin("MT_MaskTools.dll")

Import("Mrestore.avs")

AVIsource("D:\Testes\Brice_PullDown.avi")
Trim(1393,2527)

ConvertToYV12(interlaced=true) #only because of Masktools. Original is RGB32
Mrestore(rate=25)

The source file(29.97fps) is a 25fps>NTSC transcoded material with the following pattern (http://forum.doom9.org/attachment.php?attachmentid=6267&stc=1&d=1161046779).
A 6 Frame cadence with one whole Frame, and 5 other mixed/blended frames (turns 5 frames into 6).

Alain2
18th October 2006, 01:02
mrestore needs a bobbed input, cf. the examples in the readme.. Good choice to try the latest version of mrestore, I find it rather efficient without requiring much tweaking; but if your avi is progressive, I don't think it will be very good.

MOmonster
19th October 2006, 15:34
@MBoufleur
You did all right, but like Alain allready said, you need a bobbed input if your source is progressive.
LoadPlugin("MT_MaskTools.dll")

Import("Mrestore.avs")

AVIsource("D:\Testes\Brice_PullDown.avi")
Trim(1393,2527)

Tdeint(mode=1) #I donīt know if it works with rgb
dsource = last.ConvertToYV12(interlaced=true) #masktools are only used for detection -> converting only dclip to yv12 will also work.
Mrestore(rate=25, dclip=dsource)
Of course you can use your favourite bobber, at the moment I donīt know what bobbingfilter works also with rgb.
You have allready tried restore24, but you should also try repal, maybe it performs really nice in your case.

@Alain2
If there is a pattern Mrestore will also work with progressive source. Its seldom, but some animes for example are converted from clear 12 fps to blended 25fps (progressive). So you use Mrestore(rate=11.998) to restore such sources. Next Mrestore release should also output higher framerates than the half input framerate fine.

MOmonster
16th November 2006, 13:41
Update

Mrestore is now updated to version 1.6. This release works significantly better than Mrestore 1.5. There are no known bugs and the blend detection is more accurate.
changlog
- completly rewritten code
- new decimating algorythm
- improved blenddetection
- better sync
- over all better behaviour
- new parameters

As always the link in my first post is updated.

Alain2
16th November 2006, 14:22
Just to be sure, in the zip, Mrestore.avs is the correct 1.6 release ? Mrestore15beta looks like the 1.5 release but a bit different, whereas Mrestore.avs is completely different so fit the changelog and is much smaller as well

Thanks for the new release! The v1.5 was already performing very good for me with the default settings, and I was happy with the results I hadt when followed by mvdegrain2 set with a large thSAD to correct the few remaining blends. Will see if it gets even better with this new version :)

MOmonster
16th November 2006, 14:38
Yes you are correct. The Mrestore15beta.avs is the next release of the older Mrestore 1.5 preview and the Mrestore.avs contains the 1.6 version and should work better. The readme is also for this version.

Pookie
17th November 2006, 20:59
CDeblend seems to work quite well :)

http://forum.doom9.org/showthread.php?p=901602#post901602

MOmonster
18th November 2006, 14:21
Good that Cdeblend works good for you. It still use an older blenddetection code and it would be really easy to implement the newest one. I think Iīll do next week.
But in general itīs recommed to use Mrestore or restore24 to restore fieldblended sources. This will give better motion (if you donīt want to keep the framerate of the bobbed clip).

MOmonster
23rd November 2006, 12:03
I updated Cdeblend to version 1.1a.
changelog:
- new blenddetection code
- outputmodes has changed,
omode 4 also outputs if the current frame will be detected as a blend
- use code structur from Mrestore 1.6

Alain2
23rd November 2006, 19:52
I see Mrestore has slightly evolved as well ^^

elguaxo
17th December 2006, 22:07
Hi, I have been using your latest Mrestore (23rd November 2006) and it works great! Now I want to try Cdeblend, but the parameters in the 1st sample of the readme seem to be invalid:

Cdeblend(dmode=3, thresh=130)
http://img184.imageshack.us/img184/8325/error1uo7.png

So I just tried Cdeblend() But I get:
http://img184.imageshack.us/img184/1041/error2yy1.png

Any hints? Thanks!

Alain2
17th December 2006, 22:52
Funny I tried cdeblend today as well for the first time and had the same error message (2nd one)

MOmonster
18th December 2006, 12:00
:eek: Oohh, sorry for the misleading sample. It`s the same as for version 1.0. I didnīt change it, sorry.
Cdeblend v1.1 has only the discribed parameters, so dmode and thresh are no parameters of the last version.
I will change it over the week (have no zipping tool here).
And will also have a look on the basic code.
Edit: This should work:
Function Cdeblend(clip input, int "omode", float "bthresh", "mthresh", "xr", "yr", bool "fnr", clip "dclip")
{
###### parameters ######
global thresh = default(bthresh,0.1)
global mthr = default(mthresh,0.6)
global omode = default(omode,0)
omode = default(omode,0)

xr = 0.125 / default(xr, 1.5) #x detection reduction
yr = 0.125 / default(yr, 2.0) #y detection reduction
fnr = default(fnr, false) #fast noise reduction

###### preparation ######
global output = input
btemp = default(dclip,input)
global blendclip= (fnr==false ? btemp : clense(btemp)).bilinearresize(int(width(btemp)*xr)*8,int(height(btemp)*yr)*8)

rate = framerate(input)

###### masking ######
diff = mt_makediff(blendclip, blendclip.trim(1,0))
global mask = mt_lutxy(diff, diff.trim(1,0), yexpr="x 128 - abs y 128 - abs < x 128 - abs x y + 256 - abs < & x 128 - abs x 128 - abs 0.5 ^ - 2 ^ y 128 - abs x y + 256 - abs < y 128 - abs y 128 - abs 0.5 ^ - 2 ^ x y + 256 - abs x y + 256 - abs 0.5 ^ - 2 ^ ? ? x 128 - y 128 - * 0 > -1 1 ? * 128 +", uexpr="x", vexpr="x")

###### initialising ######
global Cbp3 = thresh>0 ? 128.0 : 2.0
global Cbp2 = thresh>0 ? 128.0 : 2.0
global Cbp1 = thresh>0 ? 128.0 : 2.0
global Cbc0 = thresh>0 ? 128.0 : 2.0
global Cbn1 = thresh>0 ? 128.0 : 2.0
global Cbn2 = thresh>0 ? 128.0 : 2.0

global Cdp3 = mthr*0.5
global Cdp2 = mthr*0.5
global Cdp1 = mthr*0.5
global Cdc0 = mthr*0.5
global Cdn1 = mthr*0.5

global current = 0

###### helper function ######
function min(a,b)
{
a = a<b ? a : b
return a
}

###### evaluation ######
function evaluate(float Cdiff, Cbval)
{
global Cdp3 = Cdp2
global Cdp2 = Cdp1
global Cdp1 = Cdc0
global Cdc0 = omode>1 ? Cdn1 : Cdiff
global Cdn1 = Cdiff

global Cbp3 = Cbp2
global Cbp2 = Cbp1
global Cbp1 = Cbc0
global Cbc0 = omode>1 ? Cbn1 : Cdp1<mthr || Cdc0<mthr ? 0.0 : (Cbval-Cbn2)/pow((Cdc0>Cdp1 ? Cdc0 : Cdp1)+mthr, 0.8)
global Cbn1 = Cdc0<mthr || Cdn1<mthr ? 0.0 : (Cbval-Cbn2)/pow((Cdn1>Cdc0 ? Cdn1 : Cdc0)+mthr, 0.8)
global Cbn2 = Cbval


global current = Cbn1<-thresh && Cbc0>thresh || Cbn1<0 && Cbc0>0 && Cbc0+Cbp1>0 && Cbc0+Cbp1+Cbp2>0 ? 1 :
\ Cbc0<-thresh && Cbp1>thresh || Cbc0<0 && Cbc0+Cbn1<0 && Cbp1>0 && Cbp1+Cbp2>0 ? 0 :
\ current==-2 ? (Cbn1>0 ? 2 : 1) : current-1
global current = omode!=2 ? current : min(-Cbp1,Cbc0+Cbn1)>thresh && abs(Cbn1)>abs(Cbc0) ? -1 :
\ min(-Cbp2-Cbp1,Cbc0)>thresh && abs(Cbp2)>abs(Cbp1) ? 1 : min(-Cbp1,Cbc0)>thresh ? -1 : 0
global current = omode>1 ? current : min(-Cbp1,Cbc0)<thresh ? 0 : omode==0 ? -1 : 1

omode==4 ? output.subtitle(string( Cbc0>0 && Cbp1<0 ? min(-Cbp1,Cbc0) : Cbc0<0 && Cbp1>0 ? -min(Cbp1,-Cbc0) : 0.0 ) + (min(-Cbp1,Cbc0)>=thresh ? " -> BLEND!! " : " ")) :
\ output.trim(0,1) ++ output.trim(2+current,0)

return last
}

###### final evaluating ######
omode>1 ? scriptclip(output, "evaluate(LumaDifference(blendclip.trim(1,0),blendclip.trim(3,0)), AverageLuma(mask.trim(1,0)))") :
\ scriptclip(output, "evaluate(LumaDifference(blendclip,blendclip.trim(2,0)), AverageLuma(mask))")

recl = last.changefps(rate*2).changefps(rate,linear=true)
return(recl.addborders(0,0,8,0).crop(0,0,-8,-0))
}
The warning wonīt appear if you set omode (Cdeblend(omode=0)) or use this version.
In line 78 the local not setted variable omode is requested. Avisynth donīt use the global variable if not explicit called.
My failure.:(
As I said, I will fix it.

elguaxo
18th December 2006, 14:28
It works! :thanks:

MOmonster
21st December 2006, 08:57
I updated the R_pack.:)
changes:
- fixed Cdeblend
- added FixBlendIVTC (more info here (http://forum.doom9.org/showthread.php?t=101477&highlight=FixBlendIVTC))
- added Interlacing2Reader (helper detection function)

MOmonster
3rd May 2007, 16:05
Mrestore 2.0 rc
The version 2.0 was almost ready before I get some last things todo. But the version works allready so good that I wanted to post it to get some feedback of things that needs changes.

If somebody have pal to ntsc blendconverted ntsc sources, could you please upload a low motion (but of cause with motion) pan. I need such a sequence to test the motion calculation for ntsc sources (different from pal). (I know I can create it by myself with another source, but it`s just too idealistic, no edits and so on).


history:
- v1.6 not finalized because of better ideas for new version
- v1.7 not scripted because I did forget the idea for the new blenddetection
- v1.8 tested new decimation code based on scharfis_brain manual restoring code -> failed:mad:
- v1.9 tested new decimation idea for v2.0 -> works nice
- v2.0 new blenddetection, added weave (hard work:) ), complete script rewrite, improves decimation handling, some other smaller changes

todo:
- test losted blenddetction idea of v1.7
- motion calculation for pal from ntsc restoring
- error subtitles
- guide
- readme
- finish weave function
- smaller tweakings

parameters:
- rate, mlimit, rr and dclip like rate, mlimit, yr and dclip for last release
- quality:
1. fast blenddetection (doesnīt need masktools)
2. pixelblenddetection, slower and better -> default
3. like quality 2 with a better motion control (needed for weave, but also without useful)
- weave: currently it doesn`t weave (:devil: will come next release), but if you set it true you will have a better quality and better motion for non full framerate scenes (only animations).

function:
function Mrestore(clip clp, float "rate", int "quality", float "mlimit", "weave", float "rr",clip "dclip")
{
###### source preparation ######
rr = 0.125 / default(rr, 2.0) #y detection reduction

dclip = default(dclip,clp)
global det = dclip.bilinearresize(width(dclip),int(height(dclip)*rr)*8).KillAudio().ConvertToYV12() #detection clip
global det3 = blankclip(det,pixel_type="YV12",length=3)+det #detection clip + 3 frames
global out = clp.trim(0,2)+clp #output clip


###### parameters ######
global irate = framerate(clp) #input framerate
global orate = isfloat(rate) ? abs(rate) : round(irate*100)==5994 ? 25.0 :
\ round(irate)==25 ? 11.988 : 23.976 #output framerate
global weaved = isclip(weave) ? weave.changefps(irate).trim(0,2)+weave.changefps(irate) :
\ isbool(weave) && weave==true ? out : false #weaving no fullrate
global qual = isclip(weaved) ? 2 : default(quality, 1) #detection quality
global mlim = abs(default(mlimit, 0.5)) #motion limit


###### lut blend weighting ######
diff = qual<1 ? nop() : mt_makediff(det3, det3.trim(1,0), y=3, u=1, v=1) #differencing clip
global bclp = qual<1 ? nop() : mt_lutxy(diff, diff.trim(1,0), "x 128 - abs 2 < y 128 - abs 2 < | 0 x 128 - y 128 - * ?").mt_inpand()
#blend clip
global mclp = qual<2 ? nop() : mt_makediff(det3, det3.trim(2,0)).mt_lut("x 128 - abs 0.8 ^ 1 - 5 *").mt_inpand()
#motion clip

###### initialise variables ######
global lfo = -2 #last frame output
global cut = 1 #not linear calling detection
global lifr = 44 #last input frame
global mpl = mlim*1.5 #motion previous last


###### final evaluation ######
ScriptClip(clp, " out.trim(round(cfo)+3,0) ")

FrameEvaluate(last, "

## preparation ##
cifr = current_frame % round(irate*1000)
bfo = cifr==round(irate/orate*round(orate/irate*cifr)) ? 1 : 0
cut = (lifr+1) % round(irate*1000) == cifr ? 0 : 1
global lifr = cifr

## value calculating & shifting ##
global cp3 = cut==0 ? cp2 : YDifferenceToNext(det3)
global cp2 = cut==0 ? cp1 : YDifferenceToNext(det3.trim(1,0))
global cp1 = cut==0 ? cn0 : YDifferenceToNext(det3.trim(2,0))
global cn0 = cut==0 ? cn1 : YDifferenceToNext(det)
global cn1 = cut==0 ? cn2 : YDifferenceToNext(det.trim(1,0))
global cn2 = YDifferenceToNext(det.trim(2,0))

global mp3 = cut==0 ? mp2 : (qual<2 ? LumaDifference(det3,det3.trim(2,0)) : AverageLuma(mclp)) + mlim
global mp2 = cut==0 ? mp1 : (qual<2 ? LumaDifference(det3.trim(1,0),det) : AverageLuma(mclp.trim(1,0))) + mlim
global mp1 = cut==0 ? mn0 : (qual<2 ? LumaDifference(det3.trim(2,0),det.trim(1,0)) : AverageLuma(mclp.trim(2,0))) + mlim
global mn0 = cut==0 ? mn1 : (qual<2 ? LumaDifference(det,det.trim(2,0)) : AverageLuma(mclp.trim(3,0))) + mlim
global mn1 = cut==0 ? mn2 : (qual<2 ? LumaDifference(det.trim(1,0),det.trim(3,0)) : AverageLuma(mclp.trim(4,0))) + mlim
global mn2 = (qual<2 ? LumaDifference(det.trim(2,0),det.trim(4,0)) : AverageLuma(mclp.trim(5,0))) + mlim

## blend calculation ##
mo0 = mn0*mn0<mn2*mp2 && mn2<mp2 ? mn0/mp2 : mp2*mn2<mn0*mn0 && mp2<mn2 ? mp2/mn0 : mn0<mn2 ? mn0/mn2 : mn2/mn0
mo1 = mp1*mp1<mn1*mp3 && mn1<mp3 ? mp1/mp3 : mp3*mn1<mp1*mp1 && mp3<mn1 ? mp3/mp1 : mp1<mn1 ? mp1/mn1 : mn1/mp1
motion = (mo0>=mo1 && (mn0>1.5*mlim && qual>0 || mn0>2*mlim) || mo0<=mo1 && (mp1>1.5*mlim && qual>0 || mp1>2*mlim)) &&
\ mp2>1.3*mlim && mp1>1.3*mlim && mn0>1.3*mlim && mn1>1.3*mlim && mp2<4*mn0 && mp2*4>mn0 && mp1<4*mn1 && mp1*4>mn1 &&
\ (mo0>0.82 || mo1>0.82) && abs(irate/orate-2)<0.2 ? (mo0>mo1 ? mo0*7-5.6 : 5.6-mo1*7) * pow(abs(mo0-mo1),0.5) : 0

global bp2 = cut==0 ? bp1 : qual<1 ? (cp3+cp2+mlim-mp3)/pow(cp3*cp2+0.01,0.7) : -AverageLuma(bclp)/pow(mp3,0.8)
global bp1 = cut==0 ? bn0 : qual<1 ? (cp2+cp1+mlim-mp2)/pow(cp2*cp1+0.01,0.7) : -AverageLuma(bclp.trim(1,0))/pow(mp2,0.8)
global bn0 = cut==0 ? bn1 : qual<1 ? (cp1+cn0+mlim-mp1)/pow(cp1*cn0+0.01,0.7) : -AverageLuma(bclp.trim(2,0))/pow(mp1,0.8)
global bn1 = cut==0 ? bn2 : qual<1 ? (cn0+cn1+mlim-mn0)/pow(cn0*cn1+0.01,0.7) : -AverageLuma(bclp.trim(3,0))/pow(mn0,0.8)
global bn2 = qual<1 ? (cn1+cn2+mlim-mn1)/pow(cn1*cn2+0.01,0.7) : -AverageLuma(bclp.trim(4,0))/pow(mn1,0.8)

## output calculation ##
global cfo = cut==0 ? lfo+irate/orate : 0.25

dup = bfo==0 || isclip(weaved)==false ? 255 : cfo<-0.5 && mp3>1.6*mlim && mp1<2.4*mlim && mp1<(1+mp3/mp1*0.05)*mlim ? -2 :
\ round(cfo)==0 && mp2>1.6*mlim && mn0<2.4*mlim && mn0<(1+mp2/mn0*0.05)*mlim ? -3 :
\ round(cfo)==1 && mp1>1.6*mlim && mn1<2.4*mlim && mn1<(1+mp1/mn1*0.05)*mlim ? -4 :
\ cfo>=1.5 && mn0>1.6*mlim && mn2<2.4*mlim && mn2<(1.1+mn0/mn2*0.05)*mlim ? -5 :
\ cfo<-0.5 && mp2>1.3*mlim && mp1>1.6*mlim && mp3<2.2*mlim && mp3<(1+mp1/mp3*0.05)*mlim && mp3<(1+mp2/mp3*0.08)*mlim ? 0 :
\ cfo<0.5 && mp1>1.3*mlim && mn0>1.6*mlim && mp2<2.2*mlim && mp2<(1+mn0/mp2*0.05)*mlim && mp2<(1+mp1/mp2*0.08)*mlim ? 1 :
\ cfo>=-0.5 && cfo<1.5 && mn0>1.3*mlim && mn1>1.6*mlim && mp1<2.2*mlim && mp1<(1+mn1/mp1*0.05)*mlim && mp1<(1+mn0/mp1*0.08)*mlim ? 2 :
\ cfo>0.5 && mn1>1.3*mlim && mn2>1.6*mlim && mn0<2.2*mlim && mn0<(1+mn2/mn0*0.05)*mlim && mn0<(1+mn1/mn0*0.08)*mlim ? 3 : 100

global cfo = bfo==0 ? lfo : cfo<-0.5 ? -0.75 : cfo>1.5 ? 1.75 : irate<2*orate ? round(lfo)+irate/orate :
\ round(cfo)==0 ? (mp2>2*mlim && cp1<0.9*cp2 ? -0.25 : mn0>2*mlim && cn0<0.9*cn1 || mp1>3*mlim && cn0<0.8*cp1 ? 0.25 : cfo) :
\ mp1>2*mlim && cn0<0.9*cp1 ? 0.75 : mn1>2*mlim && cn1<0.84*cn2 || mn0>3*mlim && cn1<0.75*cn0 ? 1.25 : cfo

global cfo = bfo==0 ? lfo : dup<4 ? abs(dup)-2 : mp2<1.1*mlim && mn0<1.1*mlim && (mp3>1.6*mlim && mn1>1.6*mlim && cfo<1.5 ||
\ mp3<1.2*mlim && mn2<1.2*mlim) || qual<2 && cfo<1.5 && mp2<2*mlim && mn0<2*mlim ? 0.25 :
\ cfo>0 && mp1<1.2*mlim && mn1<1.2*mlim && mp2>1.6*mlim && mn2>1.6*mlim || cfo>1 && qual<2 && mp1<2*mlim && mn1<2*mlim ? 0.75 :
\ cfo<0 && mp2>1.6*mlim && mp1>1.6*mlim ?
\ (motion>0.1 && (bn0+0.1>bp1 || bn0+0.1>bn1) || bp1+0.1<bn0 && bp1+0.1<bp2 || motion>-0.1 && bp1<bn0 && (bp1<bp2 || bn0>bn1) ||
\ cp1<0.01 ? -0.25 : motion<-0.1 && (bp1+0.1>bn0 || bp1+0.1>bp2) || bp1>bn0+0.1 && bn0+0.1<bn1 ||
\ motion<0.1 && bp1>bn0 && (bp1>bp2 || bn0<bn1) ? -0.75 : cfo) :
\ cfo>1 && mn1>1.6*mlim && mn2>1.6*mlim ?
\ (motion>0.15 && bn2+0.1>bn1 || bn1+0.1<bn2 && bn1+0.1<bn0 || motion>-0.1 && bn1<bn2 && bn1<bn0 ? 1.75 :
\ motion<-0.1 && (bn1+0.1>bn2 || bn1+0.1>bn0) || bn1>bn2+0.1 || motion<0.05 && bn1>bn2 ? 1.25 : cfo) :
\ cfo>=0 && cfo<=1 && mp1>1.6*mlim && mn0>1.6*mlim ?
\ (motion>0.1 && (bn0+0.1>bp1 || bn0+0.1>bn1) || bn1+0.1<bn2 && bn1+0.1<bn0 || motion>-0.1 && bn1<bn0 && (bn1<bn2 || bn0>bp1) ? 0.25 :
\ motion<-0.1 && (bn1+0.1>bn0 || bn1+0.1>bn2) || bn0+0.1<bp1 && bn0+0.1<bn1 || motion<0.1 && bn1>bn0 && (bn1>bn2 || bn0<bp1) ||
\ cn0<0.01 ? 0.75 : cfo) : cfo

## preparation for next frame ##
global lfo = bfo==1 ? (dup>4 ? cfo-1 : dup<-1 ? cfo-2 : cfo) : lfo-1

")

return last.changefps(orate)
}

Lux Delux
3rd May 2007, 22:42
Great! :)

I'm lucky, I just got this crappy PAL dvd, interlacing, ghosting...

Just by using this

Bob()
Mrestore(rate=23.976)

with the version you posted above problem was solved! So :thanks:

elguaxo
4th May 2007, 00:21
Thanks!

MOmonster
5th May 2007, 12:03
@Lux Deluxe
You should really use leakkernelbob or yadif (mode 1). They are only a little bit slower but do smart bobbing. This can give a more accurate detection and of cause a overall better quality.
Bob() is good for testing and for really crappy sources.

Setting the rate parameter isnīt necessary for norm-conversions.

Nikos
5th May 2007, 13:29
Another crappy PAL DVD "Seven Samurai."
By using this

Yadif(mode=1)
Mrestore(rate=23.976,dclip=last.crop(16,16,-16,-16))

the results are very good.

Thank you MOmonster.

Lux Delux
6th May 2007, 22:43
@Lux Deluxe
You should really use leakkernelbob or yadif (mode 1). They are only a little bit slower but do smart bobbing. This can give a more accurate detection and of cause a overall better quality.
Bob() is good for testing and for really crappy sources.

Setting the rate parameter isnīt necessary for norm-conversions.

Oh thanks for recommending, will try it out!

Thanks again for the wonderful function :thanks:

MOmonster
18th May 2007, 11:16
Update
I finally finished Mrestore v2.0. There are some things that changed and makes the function more accurate also for NTSC sources.
The link you find as always in my first post.

Hope all problems are solved.


The guide will need some more days. Only little things are missing, but I need to translate my german version first.:rolleyes:

~bT~
18th May 2007, 14:59
So this will solve the decimation probs with longer NTSC source mate?

canuckerfan
18th May 2007, 16:57
yea, that's one of the things he mentioned will be fixed for the final:)

MOmonster
18th May 2007, 17:22
Yes all known bugs are fixed. Thatīs why there are new decimation parameters numr und denm instead of rate.
Itīs tested with sources until four hours length.:)

~bT~
18th May 2007, 18:10
Thanx mate! I was so frustrated when this happened to me 3 times. I couldn't figure out what it was until you mentioned it in another thread.

Will test this out with the same sources and post back.

Cheers!

elguaxo
18th May 2007, 18:14
Is it possible now to restore for example from 25fps to 25fps? I think the PAL version of The Simpsons needs this treatment.

MOmonster
19th May 2007, 17:37
@elguaxo
Yes theoretical this is possible now, but I have no sources to test it, so Iīm not sure about.
The 25fps to 25fps or better 50fps (bobbed) to 25fps restoring sounds like a DEFT conversion. If Mrestore doesnīt work, you should test repairDEFT and unDEFTmatcher.

@all
To answer some questions I got with private messages to avoid writing the same things many times:
1.
Here are the typical numerator and denominator values for some conversions:
59.94 (bobbed) -> 25fps (29.97->12.5) - numr=1001 denm=2400 (default)
59.94 -> 24.975 (no reason to do this!) - numr=5005 denm=12012
59.94 -> 23.976 (29.97->11.988) - numr=2002 denm=5005
50 -> 23.976 (25->11.988) - numr=480 denm=1001 (default)

2.
Mrestore is just a decimating function with a included blenddetection. All the output frames are allready in the (bobbed) source.
What bobber you choose, bob(), leakkernelbob, tdeint(mode=1) or yadif(mode=1) is your decission. You should test them and then decide what gives the best quality-speed balance for you current sample.
The influence of the bobber on the blenddetection is really small and of course you can solve this effect with the dclip parameter.

elguaxo
19th May 2007, 17:39
Thanks MOmonster!

ministrix
19th May 2007, 22:17
Thanks for great plugin. Testing it out and it works great for me with the leakkernelbob bobber. However i got a source thats probably a pal -> ntsc conversion and then they've hardcoded the subs on the ntsc dvd (the pal is french). And using mrestore with leakernelbob gives the greatest result (vs repal and those other bobbers)but its not perfect. i still get some ghosting of the subs and some very faded ghosting around moving objects. Although im happy with the result i wonder is there any tweakings i can do to perfect it. my script is
LeakKernelBob(order=1)
mrestore()
vinverse()
heres a link to a jpg
http://img76.imageshack.us/my.php?image=sampleob8.jpg
can also up a clip if u want
And thanks again for great work:)

foxyshadis
19th May 2007, 23:05
That occurs because of the MPEG compression mixing up the pixels some. The PP modes will help a little, but most likely you're just going to have to use a fairly strong temporal smoother. (Limited to the bottom area if desired.)

Alain2
19th May 2007, 23:10
@elguaxo
59.94 (bobbed) -> 25fps (29.97->12.5) - numr=1001 denm=2400 (default)
Why this as default ? I thought the default always used to be 50 -> 23.976

[edit] oups, looked at the script and back at your post, there's actually 2 defaults... sorry my bad, ignore my comment ^^

MOmonster
21st May 2007, 15:07
@ministrix
As foxyshadis said, mostly these are artefacts in the source. Mrestore use some blurring (for detection only) to lower the influence of these artefacts on the blenddetection.
If you have a closer look into your bobbed source, have the clear frames these artefacts or are they real blends?
You can lower the internal blurring with the rr parameter. Set it 1.0 for a more accurate detection (but bigger artefact influence).
Also try qual=2 or a lower mlimit, because if the motion is only in the subtitle, maybe itīs detected as a still scene.

If all this doesnīt work for you, you can upload a small sample that I can have a look on it.

Fizick
28th August 2007, 16:58
It seems, mrestore has memory leakage
http://forum.doom9.org/showthread.php?p=1036367#post1036367

probably this leakage is in FrameEvaluate (ScriptClip) avisynth function

jeffy
29th August 2007, 14:12
Here is a PAL 25 fps sample of the series credits, I can't get anything decent when trying with:

yadif(mode=1)
mrestore(rate=23.976)

http://mihd.net/vxham7

Could you please help me? Thank you.

edit:
If anyone can't download the file, click "Request Download Ticket" on the left.

MOmonster
29th August 2007, 15:25
@Fizick
Yes I know this problem. I did allready a small modification with a smaller memory leakage. Couldnīt solve this problem until now.
I`m working on v2.1 and hope I can do something about.

@jeffy
Canīt download your sample here, but I will use it for testing v2.1.

Didée
29th August 2007, 17:02
jeffy,
the problem with your sample is that there is no problem. :)
Those credits don't contain any blended fields. All fields are unique, it's straight 50i.
Trying to solve a problem that is not there, MRestore can't be successful on those credits.

Trim the credits off, deinterlace them, assume appropriate fps, and append to the rest of your footage.

Oh, and make sure your source really needs MRestore. If the credits are without blends, perhaps the rest is without, too ...

jeffy
29th August 2007, 18:29
jeffy,
the problem with your sample is that there is no problem. :)
Those credits don't contain any blended fields. All fields are unique, it's straight 50i.
Trying to solve a problem that is not there, MRestore can't be successful on those credits.

Trim the credits off, deinterlace them, assume appropriate fps, and append to the rest of your footage.

Oh, and make sure your source really needs MRestore. If the credits are without blends, perhaps the rest is without, too ...
Didée, thank you for your look, but....
Why they are not fluent when Yadif(mode=1) is used then? They are little jerky. Could you please tell me what is wrong?
Are there any dupes?
The source is European analog TV broadcast of 'Sue Thomas F.B.Eye'
http://www.imdb.com/title/tt0329934/

MOmonster
5th September 2007, 11:01
@jeffy
Your sample is simple interlaced, no dups and no blends.
This script gives a fluid output.
leakkernelbob(1,2,true,true)
Maybe you should set the right order for yadif.

jeffy
5th September 2007, 12:35
@jeffy
Your sample is simple interlaced, no dups and no blends.
This script gives a fluid output.
leakkernelbob(1,2,true,true)
Maybe you should set the right order for yadif.
I have set the value in Yadif to TFF (order=1), yet the credits looked as if they stuttered a little (to me).

Thank you for taking another look. Here is the scene from the same episode, see the balloons, this is blending, isn't it? Could you please comment? (9 MB)
http://mihd.net/4mtfcs

If you can help me, is there any way to get better motion with the previous sample (the credits) at 25 fps?
Just try:
yadif(mode=0,order=1) and see for yourself how awful it is.

MOmonster
7th September 2007, 10:35
@jeffy
downloaded your sample, but currently canīt say much about. Have only virtualdub here and see only two blends in the whole sample.
Will have a look on it later.

jeffy
7th September 2007, 17:16
@jeffy
downloaded your sample, but currently canīt say much about. Have only virtualdub here and see only two blends in the whole sample.
Will have a look on it later.

Thanks for keeping me updated.

MOmonster
10th September 2007, 12:54
Your second sample is indeed a norm conversion, but there is only one blend in the complete sample. Generally restore24 and Mrestore wasnīt created for such sources, but after testing: imo yadif(mode=1) + Mrestore (quality 0 or 2 I think I have used) works better than Yadif or Tfm + Tdecimate.
So you can use Mrestore or test some other decimaters (decimate, smartdecimate...).
In the next release I will tweak the decimation code of Mrestore a little bit more for sources with no blending.

Also I had a second look on your credits sample. I only used yadif(mode=1) and the output was fluid. No dups, no blends, no missing fields, just nice interlacing.
In your case I would just cut off the credits because they have another framerate than the film source.

jeffy
10th September 2007, 20:27
Your second sample is indeed a norm conversion, but there is only one blend in the complete sample. Generally restore24 and Mrestore wasnīt created for such sources, but after testing: imo yadif(mode=1) + Mrestore (quality 0 or 2 I think I have used) works better than Yadif or Tfm + Tdecimate.
So you can use Mrestore or test some other decimaters (decimate, smartdecimate...).
In the next release I will tweak the decimation code of Mrestore a little bit more for sources with no blending.

Also I had a second look on your credits sample. I only used yadif(mode=1) and the output was fluid. No dups, no blends, no missing fields, just nice interlacing.
In your case I would just cut off the credits because they have another framerate than the film source.

Thank you very much for all your time, this is what I needed to know.
imo yadif(mode=1) + Mrestore (quality 0 or 2 I think I have used) works better than Yadif
Yes, I also think it looks better.

Me: If you can help me, is there any way to get better motion with the previous sample (the credits) at 25 fps?
Just try:
yadif(mode=0,order=1) and see for yourself how awful it is.
Is there any hope with these credits fluid at 25/23.976 fps?

outcomes
16th October 2007, 00:52
Hi can anyone upload Mrestore for me and give me th elink or where else can i get it form?

MOmonster
16th October 2007, 11:03
The updated link is always in the first post of this thread.

outcomes
16th October 2007, 22:51
^

Got it

MOmonster
16th November 2007, 18:03
@all
I added the newest mrestore test version to the R_pack. Currently Iīm a bit busy and there are still some things to do, but it works very well (better than Mrestore v2.0) with all non-animated sources.

Todo:
- update Cdeblend with mrestore code
- add dup parameter
- test new code
- add tweakings for animated sources
- add decimation-only code

elguaxo
16th November 2007, 18:08
:thanks:

MOmonster
4th December 2007, 00:25
Update! Mrestore v2.3
Completly rewritten code with many changes compared to the last final release. Nice tryout.

Still todo:
- update Cdeblend
- german readme for mrestore

Deinorius
4th December 2007, 01:24
Don't know exactly if the mistake is on my side, but if I load Mrestore, I get an error: Invalid Arguments to function RequestLinear (Line 214 of your script).

MOmonster
4th December 2007, 10:31
You need TIVTC v1.04, the newest release.

Iīm really thankful for Triticalīs changes.


Important: I kept the wrong version on my hd. This is the rc version and not the final. The extra code for pans is missing. Iīll add it soon.

Edit2: There are some more problems with this version. I donīt find the final one on my hd, but Iīll fix this until tomorrow.

Deinorius
4th December 2007, 11:36
Oh, you're right. Would be better, if you include the needed version into the readme too. I already had TIVTC, but not this version. ^^"

MOmonster
4th December 2007, 11:51
Iīll do for the final release tomorrow.

Edit: Tried to restore the deleted files, but this didnīt work. But I fixed the main issues of this release

MOmonster
6th December 2007, 02:01
I think I did all changes that was in the final.
I updated the link in my first post to Version 2.3b.

Nice tryout:).

elguaxo
6th December 2007, 02:03
Thanks!

jeffy
7th December 2007, 17:12
This is the error I get with the latest version of MRestore and TIVTC 1.04:
Script error: Invalid arguments to function "RequestLinear" (path to script/mrestore.avs, line 203)

Another unrelated question, is there a way to copy the text of the AviSynth error directly? It is shown in a graphic form. I use AvsP for editing.

EDIT:
part of the script
mpeg2source("clip.d2v",idct=4)
degrainmedian(interlaced=true)
yadif(mode=1)
mrestore()

Can you please help me, MOmonster?

MOmonster
7th December 2007, 21:28
Please make sure that really TIVTC 1.04 is used (delete other version or better load it manually). What happens if you set cache=-1 ?

How to copy the error message directly? Good question. I donīt know myself.

jeffy
7th December 2007, 22:03
Please make sure that really TIVTC 1.04 is used (delete other version or better load it manually).

How to copy the error message directly? Good question. I donīt know myself.
Thank you for your advice, my fault, I was loading the wrong version from the script!

jeffy
8th December 2007, 17:50
How to copy the error message directly? Good question. I donīt know myself.
I found the way:
http://forum.doom9.org/showthread.php?p=1073983#post1073983

MOmonster
8th December 2007, 18:29
Oh, thanks for the info.:rolleyes:

jeffy
8th December 2007, 19:34
Are you aware of anything related to this error showing in the final video? Thank you.
http://img148.imageshack.us/img148/9346/divisionjt4.png

EDIT:
script
SetMemoryMax(128)
LoadPlugin("E:\Tools\AIT\DGDecode.dll")
Load_Stdcall_plugin("E:\Tools\AIT\yadif.dll")
LoadPlugin("E:\Tools\AIT\DeGrainMedian.dll")
LoadPlugin("E:\Tools\AIT\MVTools.dll")
LoadPlugin("E:\Tools\AIT\vinverse.dll")
LoadPlugin("E:\Tools\AIT\gradfun2db.dll")
LoadPlugin("E:\Tools\AIT\dctfilter.dll")
LoadPlugin("E:\Tools\AIT\fluxsmooth.dll")
import("E:\Tools\AIT\867316_spresso_Didee_preferred.avsi")
import("E:\Tools\AIT\LRemoveDust_YV12.avsi")
import("E:\Tools\AIT\MR06122007\mrestore.avs")
mpeg2source("J:\src.d2v",idct=4)
degrainmedian(interlaced=true)
yadif(mode=1)
mrestore()
LRemoveDust_YV12(4,2)
RemoveGrain(1,2,2)
DCTFilter(1,1,1,1,1,0.75,0.25,0)

There are all four of your scripts in the E:\Tools\AIT\MR06122007 folder.

MOmonster
8th December 2007, 20:10
Thanks for bug report.

I found the bug and updated mrestore to version 2.3c. Some code cleanup and mode 6 is removed.

elguaxo
26th January 2008, 12:38
I am using your latest release (this one (http://forum.gleitz.info/attachment.php?attachmentid=90809&d=1197140486)) and TIVTC 1.04 (I just upgraded to TIVTC 1.05).

I think the problem I'm getting is because of MRestore, but it is hard to reproduce. I'm encoding with Xvid_Encraw and I'm using a slow script that includes your latest Mrestore. After ~3/4 of the encode I get only black frames.

I can't see the problem doing a preview of the same script via VDM, it happens only during the encode and it seems it only happens with slower scripts.

I recommended Mrestore to a friend and he tried it encoding with Xvid VfW and he gets this kind of errors in a similar situation:

4:24:00: WARNING: Number of counted frames differs from settings!
4:24:00: WARNING: Settings: 156899
4:24:01: WARNING: Counted: 130880
4:24:01: WARNING: Difference: 26019
4:24:01: Correcting Bitrate...
4:24:01: Original Bitrate = 1629 k(=1000)Bits/s
4:24:01: Now encoding at 1954 k(=1000)Bits/s
4:24:01: New target size = 1041568 Kb

Any hints?

BTW, the machine where I get the error is: AMD 64 3200+ and 2GB of RAM.

Thanks in advance.


Edit: Mrestore has a small memory leak

MOmonster
27th January 2008, 13:16
I need the script and the settings of mrestore.

Best solution is to create a temp.avi (lossless, only deinterlacer and mrestore) and do the other complex filtering in the second pass.

Yes, I know about the memory leak. It should be smaller than in the previous version. But I donīt know the reason for this memory leak.

elguaxo
27th January 2008, 13:23
Yes, the leak is small and I experienced just with MRestore().

I have 2GB of RAM and I usually start my scripts with SetMemoryMax(1024). A slow/complex script + the small mem leak was too much for my RAM and I don't even use a pagefile. My solution is starting with SetMemoryMax(256) and I don't get black frames anymore!

If it becomes a problem again I will use a temp lossless AVI as you suggested.

Thanks!

MOmonster
27th January 2008, 13:38
With cache<0 you can decrease the memory leak, but there can be other negative effects.

Maybe I should write the SetMemoryMax tip in the readme. Thanks.

K0zi
27th January 2008, 15:01
I'm wondering if I can setup your plugin somehow in order to get rid of blended fields on that source:
http://rapidshare.com/files/86204144/sample.rar.html

Any suggestions would be appreciated.
Thanks in advance.

scharfis_brain
27th January 2008, 16:23
this source has a constant pattern.

U had success with a method for undoing the constant pattern:

mpeg2source("C:\forum\K0zi\sample.d2v") #,cpu=6)
yadif(mode=1)
changefps(250)
selectevery(10,4)

I described this here i bit more: http://forum.doom9.org/showpost.php?p=1092507&postcount=2

jeffy
27th January 2008, 17:49
Scharfi, can your method be used on this sample? If not, could you please recommend something?

http://rapidshare.com/files/87060512/sample_ttw_long.demuxed.m2v.html

I tried without success:
yadif(mode=1)
changefps(23.976*10)
selectevery(10,0[-9])

Thank you.

scharfis_brain
27th January 2008, 20:00
this is obviously NOT constant pattern.
it is hard telecined 3:2 Film, transferred to video and THEN cut!
cutting 3:2 telecined stuff on video will break the pattern at every cut!

So you need to go for a automated solution like restore24 by Didée or Mrestore/Crestore by momonster.

jeffy
27th January 2008, 20:17
this is obviously NOT constant pattern.
it is hard telecined 3:2 Film, transferred to video and THEN cut!
cutting 3:2 telecined stuff on video will break the pattern at every cut!

So you need to go for a automated solution like restore24 by Didée or Mrestore/Crestore by momonster.
Thank you! If you have some time, could you please explain how did you found out? The sample posted is 25 fps (blended), are there any clues?

scharfis_brain
28th January 2008, 01:29
I just tried the constant pattern method that you also tried.

It failed -> So it has to be an inconstant pattern :p

Also, it is a TV-show. Which is very likely being cut on video.

While movies (the ones for the cinema) are usually cut on film or at least in 24fps.
So these ones have no pattern breaks after a conversion.

EuropeanMan
29th January 2008, 02:20
Speaking of memory leaks...

From what I understood the prior version of MRestore had a memory leak at the 1hr40min mark of a movie...

Where does this happen on this version? Because I am using a modded MRestore that allows me to encode with success for a movie of 3 hours now.

And speaking of quality between new & old Mrestore...what is the % gain? approximately...

elguaxo
29th January 2008, 02:58
I just finished an encode using MRestore(mode=0). The leak happens right from the start and in my case it was ~750MB for a 2 hours movie.

MOmonster
29th January 2008, 07:31
mrestore(mode=4,cache=-1)
should work pretty much the same as the modded version (quality wise and stable). But the other modes can give some advantages for quality.

@elguaxo
~750mb is a lot. Could you also test cache=-1?

Iīll try to find a solution for this problem in the next release.

EuropeanMan
29th January 2008, 07:42
@MOmonster

^ was the above MEANT for ME?

ord = last.getparity() ? 1 : 0
a=Yadif (mode=3,order=ord)
MRestore(a,quality=2,mlimit=0.2)

this is what i'm using with the current movie i'm encoding... 2 1/2 hrs...

in the future, when & if i use the new version...could you please advice a comparable solution, that will NOT induce a memory leak?

vielen dank fuer mich helfen

MOmonster
29th January 2008, 11:02
Yes the above was for you.

Mode 3 with cache<0 and mthr~-2 is most comparabe to your solution. You can also test the other modes but keep cache<0.

If there are still problems, please post your results.

scharfis_brain
29th January 2008, 11:25
ord = last.getparity() ? 1 : 0
a=Yadif (mode=3,order=ord)

this is obsolete!

Yadif() does getparity also internally

Deinorius
29th January 2008, 14:57
@MOmonster
Hey, got a question. I'm testing Converting for PSP nowadays. So I thought for deinterlacing I will just use "SeperateFields().SelectEven()".
But how could I use this in combination with MRestore? Is there a possibility at all? Can I bob by halfsizing the resolution?

~bT~
29th January 2008, 15:06
ord = last.getparity() ? 1 : 0
a=Yadif (mode=3,order=ord)

this is obsolete!

Yadif() does getparity also internally

Am I right in assuming that the line below is correct?

Yadif (order=-1)

EuropeanMan
29th January 2008, 17:15
ord = last.getparity() ? 1 : 0
a=Yadif (mode=3,order=ord)

this is obsolete!

Yadif() does getparity also internally

i go with what works...i still have to do some research on yadif and it's arguments. sorry boss.

but from what i understand my script takes care of a movie that switches from TFF to BFF on sources that have those breaks...and sometimes it even goes BACK to TFF.

foxyshadis
29th January 2008, 21:08
No, the only way to handle that is inside Yadif itself, or to manually trim it and swap fields. GetParity only runs when the script is compiled.

MOmonster
29th January 2008, 22:16
Hey, got a question. I'm testing Converting for PSP nowadays. So I thought for deinterlacing I will just use "SeperateFields().SelectEven()".
But how could I use this in combination with MRestore? Is there a possibility at all? Can I bob by halfsizing the resolution?

Mrestore outputs even and odd fields. To avoid the bobbing effect you need a smart bobber as leakkernelbob or yadif or tdeint not selecteven or bob(). But of course you can use your favourite downsizing method.

Deinorius
29th January 2008, 23:21
I just tried "SeperateFields().MRestore()". Works fine. The video is synchron. I like it.

There's just the problem, that the performance isn't better, but that's a problem for MT.

K0zi
30th January 2008, 00:09
this source has a constant pattern.

U had success with a method for undoing the constant pattern:

mpeg2source("C:\forum\K0zi\sample.d2v") #,cpu=6)
yadif(mode=1)
changefps(250)
selectevery(10,4)


I've tried your script, changing values in selectevery from 0 to 9, just like you described, but there are still some blended fields left.
:confused:

scharfis_brain
30th January 2008, 01:44
cause the source is uber-blended.
you cannot remove these blends.
you better look for smooth motion now...

EuropeanMan
30th January 2008, 04:19
No, the only way to handle that is inside Yadif itself, or to manually trim it and swap fields. GetParity only runs when the script is compiled.

so in the future, it's enough to tell yadiff what field order is INSIDE it's brackets? :)

scharfis_brain
30th January 2008, 05:17
No!

if you use MPEG2SOurce(), then the fieldorder is AUTOMAGICALLY signalled to Yadif(). You don't need to pass the order argument to it.

If you use another source, you want to put assumetff() or assumebff(9 before the call of yadif()

kawarimi
20th February 2008, 04:04
I have a 25fps interlaced DVD source that has blended fields.

yadif(mode=1)
c = last.crop(8,16,-8,-8)
Cdeblend(omode=2,dclip=c)

yadif(mode=1)
c = last.crop(8,16,-8,-8)
mrestore(mode=0,dup=1,dclip=c)

Cdeblend removes almost all the blends but Mrestore leaves a few.

Should I:
1) Cdeblend and leave it at 50fps.
2) Cdeblend
decimate(5)
decimate(4)
This might make panning/scrolling not smooth because in the credits there is movement every frame at 50fps.
3) Mrestore. What settings for mrestore will remove blends like Cdeblend?

Is there a way to do the deinterlacing postprocessing like motion compensation and reducing deinterlace flicker after blending is removed?

MOmonster
20th February 2008, 07:30
Mostly you donīt get fluid motion with Cdeblend, so mrestore should be choosen. Could you upload a small sample. With the right settings mrestore should be as blend clean as the Cdeblend output.
The deinterlacing flicker reducing has to be done before mrestore.

kawarimi
21st February 2008, 09:15
Oh it works using mode=4.
Mrestore does have a little bit more fluid motion and removes blends as well as cdeblend.
There was a frame where cdeblend removed a blend but mrestore kept it in, but it was a frame that was an original frame (not found anywhere else) half blended with another frame, I think that's what you call a doubleblend?

I'm using mrestore v2.3c and it says:

Invalid arguments to function "RequestLinear"

cache<0 ? last : last.RequestLinear(8, cache, 5, false, false)
cache<0 ? last : last.RequestLinear(8, 5, false, false)

and

CFrameDiff does not have an argument "rpos"

bpos = rf>6 ? 0 : int(bclp.CFrameDiff(prevf=false, nt=0, blockx=16/rf, blocky=16/rf, rpos=true))
bpos = rf>6 ? 0 : int(bclp.CFrameDiff(prevf=false, nt=0, blockx=16/rf, blocky=16/rf))

I think maybe that's what caused mode=0 to not work that well?

MOmonster
21st February 2008, 16:19
Did you use the last TIVTC release?

kawarimi
23rd February 2008, 08:29
Thanks it works now, using TIVTC v1.0.5 17 January, 2008.

I was using TIVTC v1.0.1 19 February, 2007 which is apparently the latest one according to MeGUI. And one year old is pretty recent.

I've decided to use mrestore for the 24fps part and cdeblend for the ending which looks smoother using cdeblend because there's panning that moves at 50fps, which I can't tell if they're blended because they move 2 pixels a frame, but it has some of the 24fps that was blended.

thetoof
8th April 2008, 03:36
I'm using FixblendIVTC on a VHS capture and it works very well to detect the blends and make the clip ready for decimation, but I'm having problems with the postprocessing... I tried the suggested deen, but couldn't get satisfying results. Does anyone know a good plugin/script that could help?

anonova
15th May 2008, 17:41
I'm trying FixBlendIVTC on an old film, and I'm having problems encoding it. The first time I encoded, each scene change would be erratic. Say I had abcde. The encode would show abdce. I went back and framestepped through, and it was fine. Any ideas what's causing this? I'm just using a regular script.

fixblendivtc()
decimate()

thetoof
16th May 2008, 04:00
Could you upload a short sequence that gets messed up after fixblendivtc? I'd be easier for us to reproduce your issue.

MOmonster
16th May 2008, 18:36
@anonova
You can put RequestLinear(8, 5, 5, false, false) between FixBlendIVTC and decimate. If this doesnīt work doing a lossless first (extra) pass and encode the lossless file.
Hope this works.

@thetoof
Without a sample I canīt give you a better advice for the postprocessing.

Vesi
15th June 2008, 13:21
Hi, I have source which I anlyze with VDM and I see some 2 interlace frame and 3 prograsive frame, when I see the 2 interlace frame they are also dublacate, hopefully I'm right?

sample (http://www.sendspace.com/file/mh8vs1)

is this a TELECINE source with field blended? and how should I deal with this type of source?

45tripp
15th June 2008, 15:14
no it's just hard telecine

tfm()
tdecimate()

thetoof
15th June 2008, 17:56
Yes, and I'd add that if you have aliasing as there was in this (http://forum.doom9.org/showthread.php?t=137879)thread, you could use the even more precise (but slower) field matching in post #11.

Vesi
15th June 2008, 20:01
Immersion & thetoof Thanks alot guys for the replay. Immersion when i analyzed my source with MeGUI, that automaticly suggest tfm()
tdecimate(). Which I don't want to use it, coz I want to learn the better way for dealing with this type of source.
@ thetoof I will give it try when I get home.

O. Can we use Cdeblend for this purpose? if not then, for which purpose we can use it?
Thanks in Advance

Thanks.

thetoof
16th June 2008, 04:59
Cdeblend is a simple blend replacing function like unblend or removeblend
You can find the rest of the info in the script... open it with the notepad

Leak
16th June 2008, 13:49
when i analyzed my source with MeGUI, that automaticly suggest tfm()
tdecimate(). Which I don't want to use it, coz I want to learn the better way for dealing with this type of source.
Which is silly, because "this type of source" is simply telecined, which is exactly what TIVTC (i.e. TFM and TDecimate) was made for.

Since there's no blending in the fields of the VOB you posted it simply doesn't make sense to use something like CDeblend...

elguaxo
22nd June 2008, 21:13
I'm trying to encode an anime which has many blends among other problems. I tried AnimeIVTC and MRestore for fighting the blends. I am happy with MRestore but I get some frames with these errors:

http://img440.imageshack.us/img440/8793/samplesv7.th.png (http://img440.imageshack.us/img440/8793/samplesv7.png)

Vob sample: http://www.mediafire.com/?hddyclbhy32

Script reduced just to the MRestore part. I get an error like in the screenshot above just using this:
Import("D:\AviSynth 2.5\plugins\MRestore.avs")

DGDecode_mpeg2source("I:\sample.d2v",info=3)

interp=nnedi(-2)
yadifmod(mode=1, edeint=interp)

Mrestore(mode=0, numr=2002, denm=5005, chroma=true, dup=1)

Any hints?

MOmonster
23rd June 2008, 20:56
I updated mrestore to version 2.3d and bob_repair to version 0.4.
Download link in my first post.

@elguaxo
Thanks for the report. I fixed the bug.
Using a faster bobbing for dclip will speed-up your script.

elguaxo
23rd June 2008, 21:02
great customer service! :)

MOmonster
1st July 2008, 21:18
@elguaxo
No problem.

@all
Another bug were found and fixed. Mrestore version is now 2.3e.

Adub
9th July 2008, 19:14
I added Cdeblend to the wiki. I will try and get to Mrestore some time today.

MOmonster
11th July 2008, 09:48
Oh, thanks really much.:thanks:

smekoslav
3rd August 2008, 10:44
When I try to use mrestore() in my script (trying to convert 60i to 25p) I get this error:
ChangeFPS: Ratio must be less than 10 for linear access. Set LINEAR=False.
Naturally I tried setting linear=false but then the script became useless as it crashed every time.

My script:
import("C:\Program Files\AviSynth 2.5\plugins\mrestore.avs")
DirectShowSource("E:\TDL-Folder\bdg\BDMV\STREAM\g1.grf",audio=false)
mrestore()

foxyshadis
3rd August 2008, 17:52
Are you sure that it's actually coming in as 60i? Replacing mrestore with info() should give you 30 fps for the framerate, if not then you need to specify that in directshowsource. And don't forget to specify the final framerate in mrestore.

smekoslav
8th August 2008, 14:19
info() gives 29.97fps, not 60i as eac3to states.
so how exactly must i put the final framerate into mrestore? using numr and denm won't work.

levi
18th August 2008, 18:36
Mrestore use the numerator and denominator instead of an output framerate parameter, because this is more accurate.

foxyshadis
I thought the latest version (mrestore v2.3e?) no longer supported final framerate specification? It there some place to download the prior versions - sometimes I would like to go back to that, but I didn't keep a local copy:eek:

smekoslav
FYI - I got this error when I had a typo in the numerator - doesn't seem to apply to your case, but thought I would mention it

MOmonster
19th August 2008, 10:08
@smekoslav
Before calling mrestore you have to bob the interlaced source. Mrestore will decimate the input 59.97fps to 25fps at default.

@smekoslav and levi
outputframerate/inputframerate = numr/denm
You just have to find the right integers that fit this condition.
This is only necessary for non-standard conversions. In these cases finding the right outputframerate is more difficult than calculating the necessary parameters.
I can upload an older version, but 2.3 works significantly better than 1.6. If it`s just this parameter I will add this.

levi
20th August 2008, 01:56
In general, the problem sources I deal with are going to be output framerate of either 23.976 or 25 fps.

In most cases, I do get amazingly impressive results with the correct numr / deno specified, but sometimes the source is just too bad - I can't get any combination to work. In this case, it would be nice to have the output fps parameter as a last resort. :)

highjds
20th August 2008, 16:00
I want encode Galapagos( 1080i 29.978 ) with Mrestore( 29.978fps --> 25fps ), and I used Mrestore v2.3e
and AvsP displayed error-massage like below

ChangeFPS: Ratio must be less than 10 for linear access. Set LINEAR=False.

My scripts:
DirectShowSource("D:\MOVIE\Galapagos\BDMV\STREAM\test.GRF", fps=29.970, audio=false)
ConvertToYv12()

Import("C:\Program Files\AviSynth 2.5\plugins\mrestore.avs")

d = last.bob(-0.2,0.6).reduceflicker(strength=2)
Yadif(mode=1)
mrestore(mode=-4,1001,2400,dup=1,dclip=d)

Crop(0, 0, -0, -8)

And I insert changeFPS

DirectShowSource("D:\MOVIE\Galapagos\BDMV\STREAM\test.GRF", fps=29.970, audio=false)
ConvertToYv12()

Import("C:\Program Files\AviSynth 2.5\plugins\mrestore.avs")

d = last.bob(-0.2,0.6).reduceflicker(strength=2)
Yadif(mode=1)
ChangeFPS(60000,1001)
mrestore(mode=-4,1001,2400,dup=1,dclip=d)

Crop(0, 0, -0, -8)

The screen of the result trembles extremely though the error did not appear.

I want the advice of the problem sincerely.

Galapagos Source Sample (http://mail24.paran.com/write/download.php?id=highjds70@paran.com&home=/D24/h/i/0/highjds70@paran.com&host=gigamail8.paran.com&port=80&bigpath=/D8/3/20080821/00/03/highjds70@paran.com&uni=1219246170.10468.mail24x0.m2ts&bigname=00000.m2ts)

jeffy
20th August 2008, 16:11
Galapagos and field blended for Blu-ray? Isn't the document simply telecined?

Zwitterion
20th August 2008, 20:08
The screen of the result trembles extremely though the error did not appear.

DirectShowSource is the problem here. Mrestore seeks alot in the stream... and most DirectShow filters/splitters are not used to this.

Try to build a graph with GraphStudio (http://blog.monogram.sk/janos/tools/monogram-graphstudio/): Insert Haali Media Splitter (available in this (http://haali.cs.msu.ru/mkv/MatroskaSplitter.exe) package) and point it to the M2TS file. Then connect a VC1 decoder like the Sonic Video Decoder. Save the graph and open it with "DirectShowSource("test.grf", audio=false)". The trembling should disappear as Haali's splitter usually is frame accurate.

However you won't be able to restore the original frame rate as there is just one unblended frame in every six. No tool could ever restore that.

highjds
21st August 2008, 00:28
Try to build a graph with GraphStudio (http://blog.monogram.sk/janos/tools/monogram-graphstudio/): Insert Haali Media Splitter (available in this (http://haali.cs.msu.ru/mkv/MatroskaSplitter.exe) package) and point it to the M2TS file. Then connect a VC1 decoder like the Sonic Video Decoder. Save the graph and open it with "DirectShowSource("test.grf", audio=false)". The trembling should disappear as Haali's splitter usually is frame accurate.

I used Sonic Decoder and GraphStudio. then Such result is come out. :(

Isn't its problem on the version of Mrestore probably?

highjds
21st August 2008, 00:39
I can upload an older version, but 2.3 works significantly better than 1.6. If it`s just this parameter I will add this.

I hope uploading your old version. :) Mrestore 2.3e is needed ChangeFPS()

Thx MOmonster :)

Zwitterion
21st August 2008, 01:00
This graph (http://img84.imageshack.us/my.php?image=stutqx7.png) results in stuttering, while this (http://img84.imageshack.us/my.php?image=nostutwo0.png) does not.

MOmonster
21st August 2008, 09:13
Yes, mrestore donīt like directshowimport. I donīt know how to solve this problem.

@all
I updated the R_pack. FixblendIVTC and mrestore have been updated and some older versions are included in the zip.
The outputframerate has to be set directly now.
For more information please read the readme first.

highjds
24th August 2008, 04:42
Thanks for MOmonster's upgrade and Zwitterion's advice. :)

I have work for following setting.

Source : Galapagos BD Sample Source (http://mail24.paran.com/write/download.php?id=highjds70@paran.com&home=/D24/h/i/0/highjds70@paran.com&host=gigamail8.paran.com&port=80&bigpath=/D8/3/20080821/00/03/highjds70@paran.com&uni=1219246170.10468.mail24x0.m2ts&bigname=00000.m2ts) ( 29.970fps, 1080i, VC-1 )
Video Graph : File(async ) --> Sonic HD Demux --> Sonic HD Video Decoder --> Sample Grabber
Plugin : mrestore v2.0

AVS Script :
d = last.bob(-0.2,0.6).reduceflicker(strength=2)
Yadif(mode=1)
mrestore()

but, The result is that screen overlaps and the reclaiming isn't play softly.
of course, 25fps is succeeded.

Here is my result. What's wrong ?

My result (http://mail24.paran.com/write/download.php?id=highjds70@paran.com&home=/D24/h/i/0/highjds70@paran.com&host=gigamail5.paran.com&port=80&bigpath=/D5/5/20080824/12/03/highjds70@paran.com&uni=1219548346.15239.mail24x0.mkv&bigname=Sample.mkv)

I'm a begginer and I tried to be various. But, I can't solve with my ability yet.

I want to succeed sincerely. Plz, Help me :(

Amrit
25th August 2008, 02:13
Hi I am Deinterlacing a blended movie and i chose Mrestore as my unblender


here is my script

Import("C:\Program Files\AviSynth 2.5\plugins\Mrestore.avs")
Load_Stdcall_Plugin("C:\program files\avisynth 2.5\plugins\yadif.dll")
MPEG2Source("C:\Documents and Settings\Amrit\Desktop\[Sample].d2v")
Yadif(Mode=1,Order=1)
mRESTORE()

Sample Unprocessed

http://www.sendspace.com/file/ozt1qs

Look at frames 845 846 DUpes from what i see

Need another example i will post on up ASAP


i also changed the MRestore Line to MRestore(Numr=2400,Denm=6000) to make it 23.976 and then frames 810-811 are dupes

However Repal does the job perfectly. Is there a way i can tweak Mrestore to work on this source. Thanks

Zwitterion
26th August 2008, 15:16
Does anyone else have a problem with AviSynth 2.58? When I run Amrit's script it returns a "nndnd..." sequence @ 25 fps (d is a dup, n is a normal frame). So nearly every second frame is a duplicate.

I'm using mrestore v2.31, masktools-v2.0a35, TIVTCv105.

It works fine with 2.57 (I used the MT_07 version for comparison).
Look at frames 845 846 DUpes from what i see
I wouldn't say that this is a duplicate, he just moves very little.
Also at least in the crash scene there are many intentional duplicates from slowmotion.
However Repal does the job perfectly. Is there a way i can tweak Mrestore to work on this source. Thanks
Repal leaves many blended frames as far as I can see.
With Mrestore I would always use mode=0 for better quality. And if playing around with the other settings doesn't help to get rid of duplicates, you could try an older version of mrestore.

Adub
26th August 2008, 17:14
Is it just me, but I cant see any blending in this source. Anyone want to point out a frame number for me?

Edit: Okay, never mind. Once I deinterlace, I can see 'em.

Hmm...tempgaussmc seems to do a fantastic job here.

Amrit
26th August 2008, 17:40
Does anyone else have a problem with AviSynth 2.58? When I run Amrit's script it returns a "nndnd..." sequence @ 25 fps (d is a dup, n is a normal frame). So nearly every second frame is a duplicate.

I'm using mrestore v2.31, masktools-v2.0a35, TIVTCv105.

It works fine with 2.57 (I used the MT_07 version for comparison).

I wouldn't say that this is a duplicate, he just moves very little.
Also at least in the crash scene there are many intentional duplicates from slowmotion.

Repal leaves many blended frames as far as I can see.
With Mrestore I would always use mode=0 for better quality. And if playing around with the other settings doesn't help to get rid of duplicates, you could try an older version of mrestore.

Yeah i found out older versions of MRestore fix this. I found out to late. Thanks alot though

45tripp
26th August 2008, 18:37
Does anyone else have a problem with AviSynth 2.58?

well spotted.
i trace it to 2.58 rc1.
before that all mrestores are ok.


you could try an older version of mrestore.

i tried.
unfortunate in selection, i guess.
from what i can see, trying again,
only mrestore v20 works with 2.58 rc1 and up.


Repal leaves many blended frames as far as I can see.

i don;t see that.
i suspect you;re talking in general.



tripp

Amrit
26th August 2008, 18:52
Hi i was using this function in Mrestore

MRestore(Numr=2400,Denm=6000)

And i get eror No function NUmr

Ever sicne i updated my Mrestore after dwonloading the R_pack its been buggin.

Adub
26th August 2008, 18:56
Read the readme included in the R_pack. He removed numr, and made things a little easier.

Amrit
26th August 2008, 18:58
Read the readme included in the R_pack. He removed numr, and made things a little easier.

thanks, never knew that till now lol

thetoof
30th August 2008, 09:29
I'd like to use the blend detection of cdeblend to, instead of simply copying the frame before (or after), apply some filters to that frame and then insert it to replace the blend... How can I do that?

vwpassion
9th September 2008, 23:37
How would you guys go about this one?

Sample (http://rapidshare.com/files/143970760/VideoFile_cut.m2v.html)

manono
10th September 2008, 05:41
How would you guys go about this one?
Yadif(Mode=1,Order=0)#sample was BFF
MRestore(FRate=24)
#MRestore(Numr=2400,Denm=5000)#if using an older version, as I do

That works reasonably well.

MOmonster
21st September 2008, 14:45
Update:
Instead of mrestore, Cdeblend, FixBlendIVTC and DupHq there is only one function now: srestore.
The detection has been improved, the memory usage has been decreased and the usage should be a bit easier.
Just test this function.

Important:
- mrestore 2.31 has a big bug and has been removed from the R_pack
- AviSynth 2.5.8 change the calculation of changefps (round to floor). I will adapt srestore when the new AviSynth version gets final.

So, if you have problems with mrestore 2.31 or AviSynth 2.5.8 then test srestore with 2.5.7

@thetoof
Not sure what you really want. I could add a parameter for an alternative clip that is allways used if a blend is detected.
or do it this way:
line 123:
output.trim(0,1) ++ output.trim(2+current,0)
to something like this:
current==0 ? output : output.loop(3,0,0).trim(2+current,0).YourFilter(YourSettings)

Would be the same for srestore. If I wasnīt clear enough just ask.

Edit:
@Amrit
I used srestore with default settings on your source and donīt get any dups that aren`t in the source.

@vwpassion
Same here: Use your favourit bobber and srestore with default settings.

@all
If your problem is still not solved, please post it again. I donīt know anymore what problems are left.

Vesi
21st September 2008, 20:23
:thanks:

Adub
22nd September 2008, 00:29
Yes!! Thanks for your hard work MOmonster!!! Your script is really pretty amazing, and I use it too often. (grrr, bad sources = pure evil). This new single script will sure streamline alot of things, and I am sure it will make thetoof's life easier as well (as I use his script a bit as well).

Amrit
22nd September 2008, 21:34
Thank you boss!!

SweetDream
22nd September 2008, 21:35
Thank you MOmonster :)

elguaxo
22nd September 2008, 21:46
Thanks!

Piper
24th September 2008, 04:05
@MOmonster: Thank you very much for this script! I've only just started using it but already getting very impressive results out of it. Well done! I think you've finally put ol' RePal out to pasture with this one.

Deinorius
24th September 2008, 08:52
Great, thanks. Will be interesting to test it soon. :)

thetoof
1st October 2008, 04:20
Wow, great job!

Actually, after doing some thinking, my request has changed a bit: could you add an argument that'd make srestore output a bool instead of a clip?
Something like bool "boolout" that would return true on blends and false on other frames (I'll use scriptclip). With this, I think I'll be able to get closer to what I'm trying to achieve.

MOmonster
2nd October 2008, 10:17
@thetoof
I will see what I can do for you, but it has to wait over the weekend. Update with Avisynth 2.58 compatibility and so on will be next week.

thetoof
2nd October 2008, 16:22
Thanks!
Another way of doing it that'd be convenient: a separate boolean function isblended() in srestore.avs

MOmonster
6th October 2008, 15:40
Update
I uploaded srestore v2.65. These are some of the changes:

- AviSynth 2.58 kompatibility
- light speed up
- reduced code
- new parameters: speed, thresh, pthresh, pclip
- better dup functionality

@thetoof
I don`t like the idea of calling a function that use the frame evaluation inside scriptclip. You can use this function as base. Rename it and add your own code:
function bcalc(clip source, float "speed", float "blocks", float "thresh", bool "chroma", int "cache", clip "dclip")
{
###### parameters & other necessary vars ######
rad = isfloat(speed) && speed>=1 ? sqrt(speed)*16 : 48
cache = default(cache,-1)
bsize = isfloat(blocks) && blocks>=1 ? sqrt(blocks)*4 : 16

global thrx = abs(default(thresh,22))*0.1
global bfacx = sqrt(bsize*0.25)*0.54


###### lut & more ######
detx = default(dclip,source).killaudio().converttoyv12()
detx = detx.pointresize(int(width(detx)/rad+1)*16, int(height(detx)/rad+1)*16)
detx = default(chroma,false) ? stackvertical(stackhorizontal(detx.utoy(),detx.vtoy()),detx) : detx

code = "x 128 == y 128 == | x y + 256 == | 0 x 128 - abs y 128 - abs < x 128 - abs x y + 256 - abs < & x 128 - abs 1 - " +
\ "y 128 - abs x y + 256 - abs < y 128 - abs 1 - x y + 256 - abs 1 - ? ? 2.4 ^ x 128 - y 128 - * 0 > -0.6 0.6 ? * ? 128 +"
diff = mt_makediff(detx,detx.trim(1,0),y=3,u=1,v=1)
global bclpx = mt_lutxy(diff,diff.trim(1,0),expr=code,y=3,u=1,v=1).bilinearresize(round(width(detx)/bsize+4)*4,round(height(detx)/bsize+4)*4)


###### output preparation ######
global outb = blankclip(source) #do your filtering here, it will be faster and more stable
global outc = source #if you do it outside the conditional enviroment


###### initialise variables ######
global lfrx = -100


###### evaluation call & output calculation ######
scriptclip( source, """

### preparation ###
cfrx = current_frame
jmpx = lfrx+1==cfrx
lfrx = cfrx

bx_v = 128-yplanemin(bclpx)
bx_v = bx_v<0 ? 0 : bx_v * bfacx
cx_v = yplanemax(bclpx)-128
cx_v = cx_v<0 ? 0 : cx_v * bfacx

## blend value shifting ##
bxp = jmpx ? bxc : bx_v
bxc = jmpx ? bxn : bx_v
bxn = bx_v

## clear value shifting ##
cxp = jmpx ? cxc : cx_v
cxc = jmpx ? cxn : cx_v
cxn = cx_v

isblend = bxc+cxp>bxp+cxc+thrx && bxc+cxn>bxn+cxc+thrx #detects nearly every blend but also frames with very low motion
isblendsave = isblend && bxc+cxp>bxp+(1+.2*thrx)*cxc && bxc+cxn>bxn+(1+.2*thrx)*cxc && bxc>(1+.2*thrx)*cxc #saver blenddetection

### output clip ###
isblend ? outb : outc #call your filtered sources here
#outc.subtitle(string(isblend)).subtitle(string(isblendsave),y=16) #to compare isblend and isblendsave

""")


###### final decimation & caching ######
cache<0 ? last : last.RequestLinear(8, cache, 5, false, false)

return last
}

SweetDream
8th October 2008, 23:11
Thanks for the new version :)

Piper
9th October 2008, 02:43
Yes, thank you for the new version. I'm getting some really nice results on some analogue captures with:


mvdegrain3i(2,0,1)
TDeint(order=1,field=1,mode=1,type=2,tryweave=true)
crop(8,56,-8,-56)
NNEDI(field=1,dh=true,threads=2)
srestore()


Using TGMC would probably improve it further, but I'm not quite there with tweaking its denoising parameters... Still this is proving very nice. Speed is reasonable too. Thanks again.

thetoof
9th October 2008, 03:10
Thanks a bunch, this'll be very, very useful.

EuropeanMan
9th October 2008, 06:07
Am running my first srestore tonite...will report back as soon as it finishes; thanks MoM for all the hard work you've put in...very much appreciated.

Getting great speeds.

MOmonster
9th October 2008, 21:40
@all
Thanks for your kind words. Good to hear that the function is so useful.
I'm allready working on a new blenddetection to speed up srestore, but I don't when the next version will be released.

ankurs
10th October 2008, 21:56
thanks a lot !

superuser
13th October 2008, 20:31
thnxs a lot ... tried srestore works gr8.

though I was running into problems last nite using MT around srestore with 2.5.7 rev of Avisynth. Is MT recommend to use around SRestore for 2.5.7?

It was giving me error messages in the clip and can post SS for the same when I get back to my place.

MOmonster
14th October 2008, 12:03
Sorry no clue about it. Never used MT.
Did it work with mrestore? If not, it is probably a problem with the conditional enviroment.
Could you post the error and your script?

superuser
15th October 2008, 05:47
I have not used MRestore with MT as had switched to another plugin 6-8 months back.



MT("srestore(frate = 25.0, dmode=4, omode=6, speed=9, blocks=3, thresh=24, chroma=false, dclip=last.crop( 6, 46, -10, -58))", threads=4)

i even took out other params to leave it to below:

MT("srestore(frate = 25.0)", threads=4)

and in both cases I get error below:

http://img404.imageshack.us/img404/8094/srestoremterrorxy2.png

If I use above without MT it works fine
http://img513.imageshack.us/img513/7335/srestoreww8.png

thanks for the looking into it

MOmonster
15th October 2008, 15:43
I will test MT with the next srestore release and see what I can do for you.

krieger2005
16th October 2008, 08:10
Before you start to test with MT i would ask the developer if MT support ScriptClip-Enviroments yet. I don't think so. MT is still in development...

superuser
17th October 2008, 03:55
Before you start to test with MT i would ask the developer if MT support ScriptClip-Enviroments yet. I don't think so. MT is still in development...

thnxs Krieger ... I hve asked for help in MT plugin for the same here (http://forum.doom9.org/showpost.php?p=1197097&postcount=976)

I will test MT with the next srestore release and see what I can do for you.

:thanks: again and lets c what response we get in MT plugin.

In meanwhile I will try out MRestore also and see if tht works or not.

Regards

aand
19th October 2008, 14:33
Can you implement a <max number of dups/blens in a row> variable? Currently SRestore is cutting blends and also some frames with motion blur, leaving dups behind, breaking the motion.

MOmonster
19th October 2008, 15:37
@aand
Such a variable won't help much. I'm allready working on a saver detection. Could you upload a sample and post your script, please?

thetoof
23rd October 2008, 03:26
I'm having some trouble with a source... It a fieldblended anime that contains regular simple blends (easily detected and removed by srestore) and these wonderful double chroma blends (http://www.mediafire.com/download.php?uzrvo2xojdz)

MOmonster
23rd October 2008, 20:22
The avi is not the source, or?
A sample of the source would be better.

The chroma is not blended. The chroma-fields shifted. Frame 4 has the chroma of frame 5 and otherwise. That's why it looks like chroma double blending.

thetoof
23rd October 2008, 22:04
Yeah, sorry 'bout that, I thought that it was some kind of blending so I uploaded the bobbed clip. It comes from the source in this post (http://forum.doom9.org/showpost.php?p=1197364&postcount=293).
Thanks for helping.

Trixter
24th October 2008, 21:54
I just have to say that, after telling people for 11 years that it was impossible, my jaw dropped the first time I used srestore() today. I took an NTSC interlaced blend of a PAL source, double-rate bobbed it with yadif, and then ran srestore() -- and the source turned into a blended mess into a pure 25fps original. My jaw hit the floor so hard I think I lost a tooth! Excellent work!!

MOmonster
24th October 2008, 22:18
@thetoof

Sorry, really less spare time at the moment, but I will have a look on it.


@Trixter

:thanks:, I try to make next version even better.

thetoof
25th October 2008, 18:32
@MOmonster
Goodie good, take your time.

@Trixter
If you tried TempGaussMC_beta1() (http://home.arcor.de/dhanselmann/_stuff/TempGaussMC_beta1.rar) instead of yadif, I think your jaw would hit the floor so hard it'd break it ;)

EuropeanMan
31st October 2008, 06:21
recently this weekend i tried yadif with srestore() on a source but i couldn't get rid of ghosting properly.

will it be okay if i put a link for a sample ?cuz i'm having problems fixing the ghosting...thanks

MOmonster
31st October 2008, 17:11
@thetoof
I think this is fixable. A script I will create later.

@EuropeanMan
Of course, post the sample! I allready gave a sample on my hd srestore doesn`t get rid of. Post a link, I will use it for the next release.

thetoof
1st November 2008, 05:18
Awesome! Here's another sample to play with http://www.mediafire.com/?hdzdyjwnwg0
You'll see the issue around 0:15.680

edit: and here's another new issue (well, it's something new for me :p): (post# 331 & 332 (http://forum.doom9.org/showthread.php?p=1208681#post1208681))

EuropeanMan
1st November 2008, 05:56
http://www.sendspace.com/file/ctv6r7

here is the sample and thx in advance

EuropeanMan
1st November 2008, 17:15
bump in hopes MOMonster is around to help me with the link provided by 'thetoof' in post 2 above this...

thanks

45tripp
1st November 2008, 20:21
a bump after 12 hours will earn you no favours

Piper
3rd November 2008, 23:31
@MOmonster: After a bit of experience with srestore, I've noticed the following with with static scenes. Say someone is talking in an otherwise static scene and they move their head to the side. There's a frame or two delay from when they stop moving and the scene remains motion blurred to when it becomes nice and clear again. Is this simply an unavoidable outcome of this type of pattern matching or is there a threshold one could tweak to tighten this up a bit? Or, is it a bobbing issue? I've used TempGaussMC_beta1() along with all the other usual suspects, but without much success. Any advice?

Adub
4th November 2008, 05:22
Do you have an example? Preferably an example clip, or screen shots if we have to.

MOmonster
5th November 2008, 21:56
Sorry for the delay, but there are some other things I have to do.


@the_toof
Here is a simple function to solve the chroma problem. I was wrong it is indeed blending. Clear chroma fields are missing, but this is fixable:
see page 19
Just bob the source and add this function. Decimation is still necessary.

Your second example (the music clip, I think) is to messy for a simple automated solution. Some parts have to be treated as interlaced, other as progressive, combined with many artefacts and different framerates. In my opinion it`s really not worth the work.


@EuropeanMan
I don`t know why, but I can't download your sample from sendspace.


@Piper
As Merlin7777 allready posted, without a sample I can only guess.

thetoof
6th November 2008, 04:12
Many thanks!

Piper
7th November 2008, 04:21
@Merlin777 & MOmonster: While readying a sample clip, I discovered that by increasing the dmode & omode parameters to 8, the issue resolved itself.

The source clip I had intended on sharing included a scene change followed by 2 blended fields. Using srestore defaults, the same 2 frames appeared a bit blurred, the 3rd being clear. With the tweak, transition is smoother.

Thanks

MOmonster
8th November 2008, 22:24
Maybe a bug in this version, but I have allready finished the next release.

Update
I uploaded the srestore 2.7 prerelease.

Adub
8th November 2008, 23:59
Changelog?

MOmonster
9th November 2008, 00:36
ok, short changelog:

- removed some parameters (pclip,pthresh,chroma,... see readme)
- added possibility to merge duplicates
- fixed a bug in the double blend removal
- significantly saver detection for smoother motion
- new blend detection
- code cleanup

I'm thinking of some further changes, but on the less sources, srestore didn't perform good, the new version improved allready a lot.

elguaxo
9th November 2008, 00:44
thanks MOmonster!

thetoof
9th November 2008, 07:46
I have a hard time removing the double blends in this (http://www.mediafire.com/download.php?xggttgjd2ju) source... could you recommend some settings?
Small mouth blends are kept and there is a mess up after the scene change. I'm using the latest srestore.

MOmonster
9th November 2008, 11:58
Very bad source.:)
I see the problem:
The motion of the hair is much bigger than the mouth motion. That's why srestore detects this as a single blend.
Using other settings won't help. I'll try to improve this in the next version.

thetoof
9th November 2008, 15:07
Very bad source.:)
Yeah... maybe some prefiltering would help?

MOmonster
9th November 2008, 16:52
I had a closer look on the source. The detection will be saver in the next version, but the two problems with the sample won't be solved.
1. The scenechange is also an edit. So the first clear frame followed by the double-blending isn't there
=> a right and save detection isn't possible in this case
- next version won't touch these frames
2. The text that running through the picture is not blended and the lumadifference of the scrolling text is higher than the difference caused by the mouth-motion. That's why the detection also doesn't work in this case.
=> This is not restorable. The text will be messed up.

MOmonster
12th November 2008, 17:44
Srestore has reached version 2.7c

- changed many internal conditions to improve detection
- same speed as v2.6 (a little nit faster than 2.7pre)
- changed double-blend-detection
- no changes in usage


@thetoof
The detection works better, but as long as you don't crop the text, you won't be satisfied.

thetoof
12th November 2008, 19:53
Goodie good, I'll test it tonight by using a cropped dclip.

ministrix
18th November 2008, 14:36
i got troubles removing the blending in this clip (http://www.mediafire.com/?lzlmdliyikl). Tried different settings on srestore but didnt remove all blends. Is there anything i can do to tweak it? the dvd is from UK but its ntsc so my guess its a badly converted job. Ive used srestore several times and very pleased with the filter so tx a bunch momonster for a great job

MOmonster
19th November 2008, 00:58
The sources is not fully restoreable. Some blends aren't removable.
To set the right output framerate is very important for the pattern detection of srestore.
These settings give significantly better results than the default ones one your clip:
srestore(speed=-9,frate=23.976)

thetoof
19th November 2008, 04:48
All the links in this post were posted previously in this thread... it's just to reduce the possible confusion due to referring to many clips.

-Double blend removal works like wonders
-Chroma_rep leaves some of the blends behind (check frame #4 of the Simpson sample (http://www.mediafire.com/download.php?uzrvo2xojdz))
-Could chroma_rep take into account only chroma blends (i.e. if the blend is a "luma+chroma blend (normal blend)", don't consider as a blend)... this could make automatic restoration of chroma blends work on the music video sample (http://www.mediafire.com/?hdzdyjwnwg0) and then srestore could be called to remove the simple blends & decimate accurately (the chroma blends srew up the detection).
-There was no answer about this issue (http://forum.doom9.org/showthread.php?p=1208681#post1208681)

Thanks for everything you've done so far!
toof

MOmonster
19th November 2008, 07:50
Thanks for remembering, I just lost the overview.

- good to hear
- will have a look on it, function is definetly improvable
- if chroma_rep and srestore are necessary, chroma_rep has to be used before. Chroma_rep detects only this special case of chroma_blending. that have nothing todo with the luma channel, and srestore doesn't regard the chroma with default settings, so there is no reason why chroma_rep or chroma blending in general screw up the detection of srestore (maybe problems with the conditional enviroment).
the decimation of srestore won`t work on your clip. There is no possibility srestore can work nice on hybrid sources. With a special more agressive blend-deduping blenddetection, it would be possible to remove most blends in this clip, but I don`t know if this is worth the work, this is the only example I know with this strange blending.
- I downloaded the sample and will have a look on it later.

Edit: I had a look on the source and this is not restorable. Triple-Blends and more. Maybe a normconversion that was just deinterlaced. Only solution is getting another source.

18fps
21st November 2008, 14:02
To set the right output framerate is very important for the pattern detection of srestore.

Thanks for your great work, MOmonster! I use your script mainly to deinterlace / deblend silent movies, where figuring the right speed is (to me at least, as I get lost after a couple seconds of counting unique frames) the most difficult part. On this particular source (http://www.mediafire.com/?sharekey=7a457f4227490c72ab1eab3e9fa335ca005c9b9debaa37fa), however, your Interlacing2reader tells me there are some fields shifted. I should pre-process this source before calling srestore? Also, what parameters of srestore would you recommend considering that I prefer a blend than a duplicate ? (framerate should be 19 fps). Thank You!

MOmonster
23rd November 2008, 22:42
There are't enough blends in your sample and the decimation ration is higher than 3, so srestore doesn't find a pattern. Using srestore as deblender and add the right decimation works better:
bobbing
srestore(omode=4,cache=5)
tdecimate(cycleR=41,cycle=60,mode=1)

This is the decimation ratio, I found, but it doesn't have to be the the right one (small changes are possible).

18fps
24th November 2008, 11:23
Thank You! I'll try it.

krosswindz
25th December 2008, 07:57
@momonster I am not sure what the problem is but I am facing issues with srestore with movies over 150mins with the rip crapping out. If I replace dont use srestore for de-interlacing everything goes fine.

manono
25th December 2008, 16:10
Not just you, krosswindz. It seems to have a memory leak. It uses up all my memory (2 GB) and then quits. I sometimes have to divide the Lagarith creation into 2 parts when using SRestore.

While encoding with a script using SRestore, do a CTRL-ALT-Delete from time to time and have a look at the encoder's (VDubMod for me) memory usage.

krosswindz
26th December 2008, 17:38
Not just you, krosswindz. It seems to have a memory leak. It uses up all my memory (2 GB) and then quits. I sometimes have to divide the Lagarith creation into 2 parts when using SRestore.

While encoding with a script using SRestore, do a CTRL-ALT-Delete from time to time and have a look at the encoder's (VDubMod for me) memory usage.

in all my avisynth scripts I have setmemorymax(512) as a result of which whenever I check my encoder xvid_encraw/x264 never seem to take more than 500-600MB. I only have 1G of memory in my computer :(.

elguaxo
14th January 2009, 13:36
Not just you, krosswindz. It seems to have a memory leak. It uses up all my memory (2 GB) and then quits. I sometimes have to divide the Lagarith creation into 2 parts when using SRestore.

the memory leak is huge. I had memory leak issues in the past (see here (http://forum.doom9.org/showthread.php?p=1092652#post1092652)), but not this big. I'm doing a lossless first pass and I'm using srestore's default cache value, but 2GB of RAM is not enough.

It seems I must use manono's trick and divide the encode into smaller parts.

levi
16th January 2009, 20:53
I can also confirm a memory leak :(

Perscitus
19th January 2009, 09:59
I am trying to fix a blending problem using mretsore, it's my first time using the filter so I'm sure I've done something wrong. With this script I still get blending, it's occurring mostly at the scene changes. Any suggestions on an adjustment that might improve it?
d2vpath="C:\DVD\Encodes\gto\gto01test.d2v"
DGDecode_mpeg2source(d2vpath)

d = last.bob(-0.2,0.6).reduceflicker(strength=1)
tdeint(mode=1)
mrestore(numr=2, denm=5, mode=0, dup=1, dclip=d)

crop(8,6,-8,-10)
Tweak(sat=1.1)
Lanczos4Resize(640,464)

My Source: Download here (http://wesker.home.comcast.net/GTO-01-testsample.demuxed.m2v)

MOmonster
27th January 2009, 13:03
@all
Yes there is a memory leakage. That more things are calculated inside the conditional enviroment that bigger it gets. I don't know how to fix it. If I find the time for this after my next exams I will start writing v3.0, but it will need its time.
If your script is not to complex, use setmemorymax(64) for the start. If this doesn't work you have to divide the encode into parts (lossless isn't always needed). I'll try to fix it in the future.

@Perscitus
I download your sample and will have a look on it. Did you already tried it with default settings?

thetoof
27th January 2009, 14:57
MOmonster, maybe the solution (or the beginning of it) lies in GRunT. I don't think there was a memory leak fix... but heh, could be worth giving a try. If you feel like posting there for help: http://forum.doom9.org/showthread.php?t=139337
edit: Oh, just saw you already went in that thread...

MOmonster
27th January 2009, 15:57
@Perscitus
Sorry, but your source is just not repairable.

@thetoof
I already had the same idea, but GRunT doesn't change anything. Like I said, if I'll find the time, there will be v3.0.

thetoof
28th January 2009, 03:16
Remember that nice chroma_rep you wrote a few months ago? (stoopid question since it's only a few posts above, but heh :p)
I tried it on this (http://www.mediafire.com/?o2jn124wbjm) sample posted in the AnimeIVTC thread (check the beam blast at the beginning, as well as a few thingies throughout the sample) and it did more bad than good, even though it looked like the same problem as the Simpson sample you originally wrote it for.

Any hints?
Thanks.

MOmonster
30th January 2009, 08:35
Chroma_rep is really special, that's why I don't support it so much;)
This is a real NTSC double blending, but only present in the chroma. In the German forum there was already such a source (Batman NTSC).
This was the result:
matched = last.tfm(mChroma=false,field=1,mmsco=false,micmatching=0)
bdeint = last.fielddeinterlace(blend=true,threshold=16,dthreshold=4)
bdeint = mergeluma(last,bdeint)
bdeint.srestore(omode="pp0")
mergeluma(last,matched)
tdecimate(mode=1,chroma=false)

It doesn't work 100% perfect, but the output is pretty good.

Arshad07
1st February 2009, 01:09
anyone can help me sort out these ghosting problems please:confused:

http://imuploader.com/images/b486jtl2es1gwk3pfot.png http://imuploader.com/images/9cgxk3oicy11evd6lab.png http://imuploader.com/images/twp82ue6escxzk4gfo.png http://imuploader.com/images/8wg7juqcvze0vjeb5pr.png http://imuploader.com/images/cfvwv6n2eesr5c5uyz1v.png http://imuploader.com/images/tr0v1r82t5rga60yqmo7.png http://imuploader.com/images/kzbubjphdd4jweoqw2t1.png http://imuploader.com/images/xmwqo8byfpbl9z9g8sx.png http://imuploader.com/images/sn20lncn8q6rschxwogg.png http://imuploader.com/images/vopg4yx7lulnymdb581c.png

Script

import("E:\k-lite\R_pack\srestore.avs")
DGDecode_mpeg2source("E:\Bewafaa (2005) Untouched DVD9 NTSC DrG\rip\B.d2v", info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
srestore(frate=25,omode=6,dmode=4,blocks=16,chroma=true)
crop( 2, 52, -2, -56)
Spline64Resize(656,288)

Sample

http://www.sendspace.com/file/lv4mau

thanks :)

manono
1st February 2009, 02:54
Hi-

Pictures do no good at all. You wasted your time adding them. We don't need a 75MB 90 second sample. And the one you chose wasn't all that good because of all the quick cuts. A nice 10-15 second sample with steady movement is usually enough to figure out what's going on. In this case, though, the script was enough. You have to bob the video before using SRestore:

Yadif(Mode=1,Order=1)#or your favorite bobber
SRestore()

I can't get your script to open, what with all the errors. Maybe you're using an older version of SRestore. Or maybe I don't know what I'm doing. And, if I were you, I'd also try and do something about the horribly blown-out whites and crushed blacks typical of lousy Indian DVDs.

thetoof
1st February 2009, 04:12
This is a real NTSC double blending, but only present in the chroma.
Maybe I'd get it if I wasn't that tired, but atm I need an explanation of the difference between the 2 "double chroma blending" since they look pretty similar to me.

MOmonster
1st February 2009, 19:22
@Arshad07
I'm downloading your file and will report later.

@thetoof
This is the NTSC-Doubleblending pattern:
aa bb bc cd dd ee
The Chroma is blended this way but the luma is just interlaced this way (pulldown). Srestore can be used for this.

The simpson sample has (at least I remember it this way) such sequences:
aa bb cd cd dd ...
And these sequences are sporadic. Chroma_rep use the correlation between chroma and luma to find these doubleblends. This case is very special.

MOmonster
2nd February 2009, 21:15
@Arshad07
Just bob the source before using srestore. Deblocking could also help.

EuropeanMan
4th February 2009, 01:45
Strange...with mRestore, I couldn't work on sources longer than ~ 120 minutes or so...but these days having no problem with 180+ minute films with sRestore...no memory leak whatsoever. Could anyone explain this?

MOmonster
4th February 2009, 08:10
There is still a memory leakage in srestore. On my pc it's reduced compared to mrestore, but depending on the Avisynth version and some other things it seems to be the oposite case. I don't know why, but I try to do it better in the next version.

EuropeanMan
4th February 2009, 18:47
^ will wait for next version as well. fyi, i just finished encoding 227 minute film via srestore...had no issues at all. will try it now on a ~360 minute film (Fanny och Alexander; Ingmar Bergman film)

i've got a intel core2duo t5550 lappy with 3GB ram...that's it. i did NOT use setmemorymax/MT at all either...

jason288
6th February 2009, 05:38
Originally posted in the animeIVTC thread:
Can anyone tell me what I should be using for this mess: http://www.mediafire.com/download.php?itmminhzm4m

I have tried mode=1 and mode=2 but it doesn't get rid of the ghosting.

Thetoof suggested that I ask over here in case anyone had any ideas. So here I am.

Any help is greatly appreciated.

MOmonster
6th February 2009, 07:20
#your bobber
srestore(frate=23.976)
This will improve the output compared to default settings, but the output is still everything else than perfect. Some parts are just overblended and srestore has problems to follow the jumpy pattern.
I will use your sample to improve the next version.

canuckerfan
6th February 2009, 09:18
^i have a sample here in which i wasn't able to get rid of all the blends (I tried all the modes in srestore 2.7c). I've uploaded it here in case anyone wants to take a look: http://www.sendspace.com/file/uwkt1y

manono
6th February 2009, 11:26
Hi-

Have you already tried:

Yadif(Mode=1,Order=1)#or your favorite bobber
SRestore(Frate=23.976)

You'll never be able to unblend it entirely because there are often 3 or more blended fields in a row. Bob it and check out the birds flying about half way through. For an unblender to work 100% you need more "clean" fields than you have there. The same thing happens when the domed buildings come into view a bit later. About the best you can hope for is to get the right framerate with a minimum of blends left over, and for it to play smoothly.

canuckerfan
6th February 2009, 19:18
^yea, I did try that. and you're right. there is some residual blending on birds and the side of the domes. still looks way better than before, though. maybe the next version might improve things a bit. either way, thanks for lookng:)

thetoof
7th February 2009, 18:42
@thetoof
This is the NTSC-Doubleblending pattern:
aa bb bc cd dd ee
The Chroma is blended this way but the luma is just interlaced this way (pulldown). Srestore can be used for this.

The simpson sample has (at least I remember it this way) such sequences:
aa bb cd cd dd ...
And these sequences are sporadic. Chroma_rep use the correlation between chroma and luma to find these doubleblends. This case is very special.
"Rested eyes see well" - someone sometime
I just had a look and it's obvious; chroma is double blended in the last sample and is swapped between fields in the Simpson sample. I had no access to the files and didn't recall that difference when I posted... Nways, thanks.

canuckerfan
8th February 2009, 01:08
Hi-

Have you already tried:

Yadif(Mode=1,Order=1)#or your favorite bobber
SRestore(Frate=23.976)

You'll never be able to unblend it entirely because there are often 3 or more blended fields in a row. Bob it and check out the birds flying about half way through. For an unblender to work 100% you need more "clean" fields than you have there. The same thing happens when the domed buildings come into view a bit later. About the best you can hope for is to get the right framerate with a minimum of blends left over, and for it to play smoothly.
i'm happy to report that using tempgaussmc as a bobber has improved the results. the blending is still slightly visibly, but not as much now. wow, didn't know a good bobber could make such a difference.

stej4u
8th February 2009, 05:33
Can someone help me with deinterlacing this indian source:

sample 1: http://www.sendspace.com/file/f6glkv

sample 2: http://www.sendspace.com/file/ysmmrb

If a script works for sample 1 then it doen't work for sample 2 and vice versa.

this is what i have:

yadif(mode=1,order=1)
srestore()


ends up at 25fps

thetoof
8th February 2009, 05:42
I have a new challenge for you MOmonster: http://forum.doom9.org/showthread.php?p=1246756#post1246756

Dunno if anything can be done since more than 2 frames in a row are affected, but this looks like something chroma_rep is made for.

MOmonster
8th February 2009, 09:45
@stej4u
Use srestore(frate=23.976) instead. There are still the temporal artefacts of a filter used after blending, but the blending is gone and the motion smooth.

@thetoof
Allways these exotics you are coming up with. Theoretical with a very very complex filter restoring would be possible. But this is the theory. Have a look at the V-Plane, it's completly overblended. Y and U are fine, but the V-Plane is really a mess:
tdeint(mode=1)
mt_lut("128",y=1,u=1,v=3)

manono
8th February 2009, 15:30
Can someone help me with deinterlacing this indian source
Welcome to the forum,

Most of Sample 2 is useless for determining the framerate. The only decent part is the woman walking along outside the house. Someone talking on the phone does no good at all. The No Entry sample, while unnecessarily large, is a much better sample because there's nearly non-stop movement. In the future please try and find samples with steady movement. The framerate is 23.976fps, but srestore(frate=23.976) isn't good enough. No disrespect is intended to MOmonster who, I'm sure, has better things to do than examine every sample carefully. It leaves too many blended frames and duplicate frames, and drops too many unique frames. I had my best luck with:

Yadif(Mode=1,Order=1)#or your favorite bobber
SRestore(Frate=29.97)
TDecimate(Mode=0,Cycle=15,CycleR=3)

stej4u
8th February 2009, 23:57
Welcome to the forum,

Most of Sample 2 is useless for determining the framerate. The only decent part is the woman walking along outside the house. Someone talking on the phone does no good at all. The No Entry sample, while unnecessarily large, is a much better sample because there's nearly non-stop movement. In the future please try and find samples with steady movement. The framerate is 23.976fps, but srestore(frate=23.976) isn't good enough. No disrespect is intended to MOmonster who, I'm sure, has better things to do than examine every sample carefully. It leaves too many blended frames and duplicate frames, and drops too many unique frames. I had my best luck with:

Yadif(Mode=1,Order=1)#or your favorite bobber
SRestore(Frate=29.97)
TDecimate(Mode=0,Cycle=15,CycleR=3)
thx you MOmonster and manona for your time.

I've already tried: srestore(frate=23.976), its doest work smoothly
I found something similar to that of manona:

yadif(mode=1, order=1)
CDeblend()
BlendBob(badFrames=0)
TDecimate(Mode=0,Cycle=15,CycleR=3)


edit: sorry im still a noob but why did you use frate=29.97 when it is already 29.97 after yadif?

manono
9th February 2009, 00:30
Because it isn't 29.97fps after Yadif. Yadif is being used as a bobber (Mode=1) and after using it (and before the other 2 lines) the framerate is 59.94fps.

stej4u
9th February 2009, 03:55
Because it isn't 29.97fps after Yadif. Yadif is being used as a bobber (Mode=1) and after using it (and before the other 2 lines) the framerate is 59.94fps.
Thanks I forgot mode=1 was bobbing. Which one would be a better choice then, Srestore or BlendBob to reduce it to 29.97 fps?

manono
9th February 2009, 04:19
For your current source SRestore is better. Where'd you get that script anyway? BWT? It sounds like something I used and maybe recommended before SRestore was around and when MRestore wasn't working well with some source.

stej4u
9th February 2009, 04:47
For your current source SRestore is better. Where'd you get that script anyway? BWT? It sounds like something I used and maybe recommended before SRestore was around and when MRestore wasn't working well with some source.

I read it on a site, I just checked again and found this: [for a source] "At this time Srestore didnt exist when i was testing on this..."

MOmonster
9th February 2009, 11:39
... The framerate is 23.976fps, but srestore(frate=23.976) isn't good enough. No disrespect is intended to MOmonster who, I'm sure, has better things to do than examine every sample carefully. It leaves too many blended frames and duplicate frames, and drops too many unique frames. ...

You are right, I took only a short look on the sample (just short on time).
Will do it better the next time. Thanks for your correction.

Lucky Luciano
15th February 2009, 00:47
Hi! First of all thank you very much for this script! It has helped me on numerous occasions! But now I think I'm stuck.

I have a DVD without any interlaced or combed frames but it has a pattern of 4 progressive frames and 2 blended ones. The DVD runtime was about 4% lower than IMDb so I assumed a PAL->NTSC transcode yet srestore doesn't work and I'm getting a 3:2 pattern with 25fps. I've tried playing with the speed and mode parameters but with no better result.

You can find a couple of small samples in any of the links below (50 MB)
http://www.mediafire.com/download.php?a2wdjzmmdmt
http://rapidshare.com/files/198126594/samples.zip
http://www.megaupload.com/?d=M66I6PD6

I'd greatly appreciate any advice!

MOmonster
15th February 2009, 19:57
This is IVTC-Doubleblending. Basically this is restoreable, but in your source the blend weights aren't constant. Until now there is no function that can restore this.

stej4u
17th February 2009, 04:16
Welcome to the forum,

Most of Sample 2 is useless for determining the framerate. The only decent part is the woman walking along outside the house. Someone talking on the phone does no good at all. The No Entry sample, while unnecessarily large, is a much better sample because there's nearly non-stop movement. In the future please try and find samples with steady movement. The framerate is 23.976fps, but srestore(frate=23.976) isn't good enough. No disrespect is intended to MOmonster who, I'm sure, has better things to do than examine every sample carefully. It leaves too many blended frames and duplicate frames, and drops too many unique frames. I had my best luck with:

Yadif(Mode=1,Order=1)#or your favorite bobber
SRestore(Frate=29.97)
TDecimate(Mode=0,Cycle=15,CycleR=3)
Well, I encoded the entire film and I'm still not satisfied. try to encode this sample with Yadif(Mode=1,Order=1).SRestore(Frate=29.97).TDecimate(Mode=0,Cycle=15,CycleR=3)
and some unique frames get deleted.

sample: http://www.sendspace.com/file/xka2rh

canuckerfan
17th February 2009, 04:46
Well, I encoded the entire film and I'm still not satisfied. try to encode this sample with Yadif(Mode=1,Order=1).SRestore(Frate=29.97).TDecimate(Mode=0,Cycle=15,CycleR=3)
and some unique frames get deleted.

sample: http://www.sendspace.com/file/xka2rh
try TDecimate with mode=1. i don't know if it'll work, but at this point for you it's probably worth a shot.

stej4u
17th February 2009, 05:04
try TDecimate with mode=1. i don't know if it'll work, but at this point for you it's probably worth a shot.
no, still deletes unique frames. I tried

yadif(mode=1, order=1)
BlendBob(badFrames=0)
TDecimate(Mode=0,Cycle=15,CycleR=3)

I'm not sure why but it seems to work better.

canuckerfan
17th February 2009, 06:05
^in some cases it just might. but go with whatever you prefer. if you have residual combing after that script, you can try a yadif+nnedi combo. or if your computer is ready for it you can try mvbob/mcbob/tempmcgauss. a good smart bobber will only help blendbob more.

MOmonster
17th February 2009, 07:54
I had a closer look on your source (sample 1), but I can`t recommed this (just because of the pattern):
SRestore(Frate=29.97).TDecimate(Mode=0,Cycle=15,CycleR=3)
Just for fun I tested tdeint(mode=1).srestore(frate=24) and in the first sample it just worked (no annoying blends, dups or missing fields). I like it more than the blendbob methode, maybe it's something with your encoding (srestore don't like all encoders:mad:) or maybe I just tested the wrong scenes.

stej4u
17th February 2009, 09:37
Just for fun I tested tdeint(mode=1).srestore(frate=24) and in the first sample it just worked (no annoying blends, dups or missing fields). I like it more than the blendbob methode, maybe it's something with your encoding (srestore don't like all encoders:mad:) or maybe I just tested the wrong scenes.
still deletes some unique frames [on one scene]. :(

stej4u
19th February 2009, 06:40
I used yadif and then used srestore to bring this particular source down to 25 fps but ghosting is created: http://i39.tinypic.com/mjpf7d.jpg

are there any settings that I can use to remove/reduce the ghosting?

Who Am I ?
10th March 2009, 13:46
^
those are more off nasty edge sharpening ( induced/retained ? ) halo's .. try something like dehalo_alpha( agressive settings ) and something like fizzkiller() or checkmate() to clean the dancing noise off as well which seems pretty evident in there .

jason288
12th March 2009, 01:32
So I was wondering if anyone might know what I could do with this: http://www.mediafire.com/?njmw5yj4nmm

Its from the new powerpuff girls DVD. I asked in the animeivtc thread and thetoof said that he had an idea and then he retired.

I have something for it thanks to MOmonster's good tips, but I'm looking into how it could be automated to become a viable solution.

Any help with this would be appreciated.

MOmonster
14th March 2009, 01:52
With a pretty complex function the chroma problem can be reduced a lot (reduced, not solved!), but at the moment I really don't have the time for this. If you have any possibilty to get a better source, imo you should use it.

jason288
14th March 2009, 16:59
With a pretty complex function the chroma problem can be reduced a lot (reduced, not solved!), but at the moment I really don't have the time for this. If you have any possibilty to get a better source, imo you should use it.

I will look and see if I can find anything better, however I don't think these is. If I cant find anything then I will wait until you have some free time to come up with a script. Thanks again for all your help.

stej4u
27th March 2009, 23:23
I have a different source for which I cant find a good deinterlacement for. I tried yadif and srestore but it ends up with a whole bunch of blends.

sample: 34.36MB - http://www.sendspace.com/file/na5h4x

manono
28th March 2009, 02:58
First, about half of that sample was useless. No one wants to see someone talking on the phone or just standing around carrying on a conversation. Try and find a sample that shows steady movement.

No unblender is going to be 100% perfect, but using a simple:

Yadif(Mode=1,Order=0)#the sample is BFF - be sure of your field order
SRestore()

seemed to do the job OK. What script are you using?

stej4u
28th March 2009, 04:54
I used exactly what you did Yadif(Mode=1,Order=0).SRestore() but blends heavily remain.

A better sample: ~40mb - http://www.sendspace.com/file/qh54h9

manono
28th March 2009, 05:27
Yes, that sample was better, but this time it was TFF, so:

Yadif(Mode=1,Order=1)#the sample is TFF - be sure of your field order
SRestore()

and then counted through a 1000 frames until I got sick of it. And I didn't see a single remaining blend. Maybe you're getting the field order wrong?

stej4u
28th March 2009, 07:39
Yes, that sample was better, but this time it was TFF, so:

Yadif(Mode=1,Order=1)#the sample is TFF - be sure of your field order
SRestore()

and then counted through a 1000 frames until I got sick of it. And I didn't see a single remaining blend. Maybe you're getting the field order wrong?
what do you mean by the field order?

manono
28th March 2009, 12:40
From the Yadif doc:
order = -1 : field order as Avisynth assumes (default).

= 0 : Bottom field first.

= 1 : Top field first.
You said you had Order=0. But if it should be Order=1, that will easily explain your problem. To find out the field order, one way is to run the Preview in DGIndex. Perhaps a better way is:

AssumeTFF()
SeparateFields()

and open it in VDub(Mod) and advance a frame at a time. If it's jerky, it's really BFF; if smooth playing it's TFF.

stej4u
29th March 2009, 07:39
From the Yadif doc:

You said you had Order=0. But if it should be Order=1, that will easily explain your problem. To find out the field order, one way is to run the Preview in DGIndex. Perhaps a better way is:

AssumeTFF()
SeparateFields()

and open it in VDub(Mod) and advance a frame at a time. If it's jerky, it's really BFF; if smooth playing it's TFF.
thats kinda weird, the first sample works good with the bottom first but the second sample works better with top first.

edit: should i put it at 'varying field order'?

manono
29th March 2009, 07:52
thats kinda weird, the first sample works good with the bottom first but the second sample works better with top first.
No it's not weird. Because of the way you cut them the first sample wound up as BFF and the second as TFF. What's important is the field order of the movie itself. They're usually TFF, but not always. I'm pretty sure yours is TFF because you said Order=0 didn't work well with it.

Boulder
29th March 2009, 10:23
Is there a proper way to fix this video: http://www.mediafire.com/?0gzftmm0ocq ?

The basic bob->SRestore still leaves dupes/blends behind.

vwpassion
29th March 2009, 14:36
Is there a proper way to fix this video: http://www.mediafire.com/?0gzftmm0ocq ?

The basic bob->SRestore still leaves dupes/blends behind.

Try this:

Yadif(Mode=1,Order=1)
srestore()

Boulder
29th March 2009, 14:40
I tried that already..see frames 4 and 5 after you run that. I think I saw similar things in rather random places when trying to run SRestore over the whole video.

stej4u
29th March 2009, 21:00
I tried that already..see frames 4 and 5 after you run that. I think I saw similar things in rather random places when trying to run SRestore over the whole video.
I think I saw this aswell. I tried yadif(mode=1,order=1) over the whole movie, it doesnt work.

manono
30th March 2009, 09:24
I think I saw this aswell. I tried yadif(mode=1,order=1) over the whole movie, it doesnt work.
Try RePAL then. That's what I usually use anyway for PAL2NTSC stuff. Only if it doesn't work do I use SRestore. I use SRestore for all other kinds of blends, though.

So far, though, there's nothing difficult about the samples you've provided. If you say something doesn't work, it's your responsibility to provide us with a sample showing us a place where it doesn't work.

Deinorius
30th March 2009, 10:12
If anyone might help me. I have a problem regarding this video (http://www.unet.univie.ac.at/~a0427198/test.m2v). It's an older Anime with norm-conversion and horrible blends I can't get rid of.
I already tried many settings. Sadly I can't get AnimeIVTC to work (I have to test my plugins).
Anyway do you have any suggestions?

MPEG2Source("F:\VTS_01_1.d2v",idct=7)
#TDeint(order=1,mode=1,type=1) Import("D:\VIDEO\AviSynth 2.5\plugins\sRestore.avs") sRestore(omode=7,speed=9, mode=4, thresh=16)
#Load_StdCall_Plugin("D:\VIDEO\AviSynth 2.5\plugins\yadif.dll") Yadif(Mode=1) Import("D:\VIDEO\AviSynth 2.5\plugins\sRestore.avs") sRestore(omode=7,speed=9, mode=4, thresh=16)
AnimeIVTC(mode=2,precision=3,iregion="PAL",oregion="NTSC")
Crop(12,2,-12,-6)
FillMargins(1,0,1,0)
DeGrainMedian(limitY=6,limitUV=8,mode=3)
gradfun2db(thr=1.6)

stej4u
31st March 2009, 01:25
Try RePAL then. That's what I usually use anyway for PAL2NTSC stuff. Only if it doesn't work do I use SRestore. I use SRestore for all other kinds of blends, though.

So far, though, there's nothing difficult about the samples you've provided. If you say something doesn't work, it's your responsibility to provide us with a sample showing us a place where it doesn't work.
a much better sample: http://www.sendspace.com/file/5j7iwo

MOmonster
31st March 2009, 16:17
@Deinorius
Some parts of your source aren't restorable (all frames blended), other parts are restorable, but only 12fps and because of the switching brightness at the beginning srestore completly falls out of the pattern. I will try to improve srestore a little bit, but your source is a mess.

@stej4u
I simply used tdeint(mode=1).srestore() (only your last sample) and the first 600 frames were all fine. If you found a problem usually uploading a sample with around 100 frames is enough. It's a bit annoying searching the problem in more than thousand frames.

MOmonster
31st March 2009, 17:00
@RsVolcom
The function rep_chroma has now a threshold parameter (default 0.125). You can increase it if not all chroma doubleblends are detected or decrease if there are wrong detections. Use it this way:
bob().chroma_rep(thr=0.125)
separatefields().selectevery(4,1,2).weave()
After this you can use AnimeIVTC or any simple IVTC method, but keep in mind that chroma_rep use the conditional enviroment. Maybe you have create a lossless temporary avi file before you can go further with other complex filtering.

Here is the modificated chroma_rep function:
function chroma_rep(clip source, int "cache", float "thr")
{
###### parameters & other necessary vars ######
cache = default(cache,-1)
global rep_thr = default(thr, 0.125)


###### source preparation & lut ######
global out1 = source
global out2 = mergechroma(source,mt_adddiff(source.trim(1,0),mt_makediff(source.trim(1,0),source.trim(2,0),y=1,u=3,v=3),y=1,u=3,v=3).blur(1))


###### initialise variables ######
global lfr = -100


###### evaluation call & output calculation ######
scriptclip( source, """

### preparation ###
cfr = current_frame
jmp = lfr+1==cfr

global lfr = cfr

l_v = LumaDifference(out1.trim(1,0),out1.trim(2,0))
c_v = ChromaUDifference(out1.trim(1,0),out1.trim(2,0)) + ChromaVDifference(out1.trim(1,0),out1.trim(2,0))

## luma value shifting ##
l10 = jmp ? l01 : l_v
l01 = jmp ? l12 : l_v
l12 = l_v

## chroma value shifting ##
c10 = jmp ? c01 : c_v
c01 = jmp ? c12 : c_v
c12 = c_v

### condition ###
change = l12*2<l01 && c01*1.25<c12 && c01*l12/c12/l01<rep_thr
chango = l01*2<l10 && c10*1.25<c01 && c10*l01/c01/l10<rep_thr

change ? out2 : chango ? out1.trim(1,0) : out1

""")


###### final decimation & caching ######
cache<0 ? last : last.RequestLinear(8, cache, 5, false, false)

return last
}

Deinorius
31st March 2009, 19:12
I will try to improve srestore a little bit, but your source is a mess. I already know that, tell me something new. :sly:

If you think, I should cut from another position, tell me. I just cut with DGIndex.

And thanks for improving. That's always a good choice. :devil:

MOmonster
31st March 2009, 20:19
You can cut the source at the very end. This would help to improve it a lot:D.
No, it won't help much to cut the first scene. Srestore loose the pattern, but it get back very fast. The bigger problem is the design of srestore. The function is just not programmed for 12 in 50 fps with some doubleblends. As I said I will improve it. But this won't solve the problem with the overblended scenes.

Deinorius
31st March 2009, 20:45
The only solution would be to get NTSC DVDs, don't you think? But what do you think my answer would be. :p

stej4u
1st April 2009, 03:45
@stej4u
I simply used tdeint(mode=1).srestore() (only your last sample) and the first 600 frames were all fine. If you found a problem usually uploading a sample with around 100 frames is enough. It's a bit annoying searching the problem in more than thousand frames.
everytime i render the script with tdeint(mode=1).srestore() and CCE blending seems to be the problem:

http://img25.imageshack.us/img25/52/snapshot20090331214001.jpg

MOmonster
1st April 2009, 08:36
@stej4u
Tdeint(mode=1).srestore() is not a general solution, but it's the right one for your third sample (I don't see this frame in your third sample). For a 24p to NTSC conversion you have to change the settings. Another reason could be the combination with cce. I heard with Mrestore there were unwanted effects. Doing a lossless pass before final encoding could help here. I will keep it in my mind for the next version.

@Deinorius
You're right.:D
For me this is only a hobby. The last time I did convert a full movie (not for testing but for my one use) is more than three years ago.

scriptmagic
2nd April 2009, 08:38
I have a video with pattern 111110111110111110, 1 being interlaced and 0 being progressive.
The video is NTSC 29.970 BFF.

My noob solution:

DGDecode_mpeg2source(mg.d2v", cpu=4, info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
Yadif(mode=1,order=0)
srestore(frate=29.970)

would this script get the job done?

manono
2nd April 2009, 11:01
would this script get the job done?
Probably not - not unless you like stuttering video. Please provide a sample - 10 seconds with steady movement will be plenty.

And welcome to the forum.

scriptmagic
2nd April 2009, 19:17
^here's the sample (http://www.transferbigfiles.com/Get.aspx?id=5ae3f85c-bcef-48de-9172-1dfaa9d47533)

manono
2nd April 2009, 22:10
Yadif(Mode=1,Order=0)#Sample was BFF
SRestore()

scriptmagic
2nd April 2009, 23:02
thanks manono,

could you briefly explain why resulting 25 fps is preferred over 29.970.

stej4u
3rd April 2009, 04:32
@stej4u
Tdeint(mode=1).srestore() is not a general solution, but it's the right one for your third sample (I don't see this frame in your third sample). For a 24p to NTSC conversion you have to change the settings. Another reason could be the combination with cce. I heard with Mrestore there were unwanted effects. Doing a lossless pass before final encoding could help here. I will keep it in my mind for the next version.

tdeint(mode=1)
blendbob()
tdecimate(mode=2,rate=25)

seems to work better then srestore for me...??

what do you mean by "have to change the settings"?

manono
3rd April 2009, 05:50
could you briefly explain why resulting 25 fps is preferred over 29.970.
How many movies do you know made at 30fps (29.97fps)? Movies are made at 24fps. But PAL DVDs are played at 25fps and they used a PAL 25fps master for the NTSC DVD, so inside that interlaced 29.97fps NTSC DVD is a progressive 25fps movie.

You could figure out the answer to your own question easily. First use your original script, open it in VDub(Mod), and then step through it, noticing the duplicate frame every 6th frame. Which explains my ""stuttering" comment in my earlier reply.

scriptmagic
3rd April 2009, 08:02
I ran the 2 scripts and you are right 30fps has a dupe 6th frame.

MOmonster
3rd April 2009, 08:22
@Boulder
Your source isn't completly restorable. Bob the source and have a look on the frames 58/59 for example. Some clear fields are just missing.

@stej4u
I have used tdeint(mode=1).srestore(dclip=last.crop(4,62,-4,-62)) for all three samples and it works. It really seems to be a problem with cce. If you have enough space just try a temporary lossless encode.

Arshad07
4th April 2009, 18:38
facing some problem with ghosting....appreciate any help

DGDecode_mpeg2source("xxxxxxxxxxxxxxx.d2v", info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
tfm(order=1).tdecimate(hybrid=3)
crop( 16, 66, -12, -64)
Spline64Resize(640,272)

http://www.grinshare.com/img/5KDPQP.png


Load_Stdcall_Plugin("C:\Program Files (x86)\megui\tools\yadif\yadif.dll")
DGDecode_mpeg2source("xxxxxxxxxxxxxxx.d2v", info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
tfm(order=1).tdecimate(hybrid=3)
Yadif(Mode=1,Order=1)
srestore()
crop( 16, 66, -12, -64)
Spline64Resize(640,272)

http://www.grinshare.com/img/FFLZKY.png

sample (http://www.sendspace.com/file/o077d9)

Arshad07
4th April 2009, 20:57
100MB sample

http://www.sendspace.com/file/zsv884

manono
5th April 2009, 15:05
1. No one needs 100MB/2 minutes of that movie to figure out what's going on.
2. Much of that sample is useless for diagnosing the problem and seeing what has to be done with it.
3. Rather than just cutting out a big chunk at random, 10 seconds of steadily moving video is enough, like that section past the halfway point where the camera is spinning around him as he plays the guitar.

I had my best luck with RePAL, but:

Yadif(Mode=1,Order=1)#the sample is TFF
SRestore()

does OK. It'll never be entirely blend/ghost free because it seems to be at least partly double blended, but the result is a whole lot better than what those funky scripts you posted above will give you. The frame you posted above isn't in the sample, so I don't know how it'll do with that.

pdadi
8th April 2009, 23:05
srestore/mrestore doesn't work well on Vista 64 bit OS.

After about 80% of first pass(xvid/x264) fps drops gradually from 30-40 fps to 1/2 fps and there is no progress after that.

I am using the latest versions of srestore/mrestore. I appreciate any help.

krosswindz
11th April 2009, 21:56
srestore/mrestore doesn't work well on Vista 64 bit OS.

After about 80% of first pass(xvid/x264) fps drops gradually from 30-40 fps to 1/2 fps and there is no progress after that.

I am using the latest versions of srestore/mrestore. I appreciate any help.

It might because of the memory leak in srestore. I just split the source up and encode it that solves similar issues for me.

EuropeanMan
15th April 2009, 18:54
http://www.sendspace.com/file/oq95kk

Sample above, very small.

Can I please get some help in solving this? I 'think' it's hybrid, but I WISH to rip ONLY to 23.976...not 29.970. IF 25fps works, how?

I see ghosting as well...without any deinterlacing, check out frames 277 & 278 :(

I've tried simple IVTC, Srestore with frate 23.976, an NNEDI solution...can't seem to solve this. Thanks

for ME, speed is NOT an issue...I just wish to rip it to 23.976 (which I believe is right) or 25fps IF it works...

EuropeanMan
15th April 2009, 19:13
Please let me know if you need a sample from somewhere else in the dvd9.

manono
16th April 2009, 00:55
Hi,
Based on that sample it's not a hybrid, but regular old 23.976fps (and hard telecined), and a lousy transfer with some light blending and what passes for motion blur. You won't be able to make it entirely "clean". I can't find anything that improves on a standard:

TFM()
TDecimate()

You could try:

Yadif(Order=1,Mode=1)
SRestore(FRate=23.976)

but I didn't see any improvement. Some say using TempGaussMC_beta1 as the bobber helps with residual light blending, but I didn't see any improvement when using that either. Maybe others have some better ideas. Exactly what problems do you see when making it 23.976fps one way or another, besides the light blending and the ghosting during fast movement (the motion blur)?

EuropeanMan
16th April 2009, 01:09
well if you put that sample into vdub without any flags/deint...look at frames 277/278 you will see ghosting...and it happens throughout the dvd9. i'd like to find a solution to this somehow.
i didn't notice much improvement with either of your two solutions (which I've already done & checked)...was hoping there MIGHT be a fix also for that ghosting.

EuropeanMan
16th April 2009, 01:14
And also if that IS motion blur (which I'm quite new to)...is that fixable at all? Or am I just hitting my head against a wall?

manono
16th April 2009, 02:40
well if you put that sample into vdub without any flags/deint...look at frames 277/278 you will see ghosting
And if you separate the fields or bob it and look at frames 554-557, you'll discover that both fields of those frames are lightly blended. There is no solution.

EuropeanMan
16th April 2009, 03:14
Ok thanks so much :)

Question on field blending...HOW does this happen exactly when the DVDAuthoring companies (Yash Raj Films in this case) make these DVD9s? I'm going to ASSUME that because it's an Indian movie, it was SHOT in PAL...what WOULD have been the proper procedure then if anyone knows, in making a PROGRESSIVE NTSC DVD9? Is it ANY MORE DIFFICULT OR EXPENSIVE to do so? Why even MAKE these sort of DVD9s that this one is?

manono
16th April 2009, 03:33
It wasn't "shot in PAL". It was shot at the 24fps film speed. PAL had nothing to do with this. It was during the making of the transfer that the light blending was introduced, perhaps during the conversion from film to video. But more knowledgeable people than I would have to explain exactly what happened.

If they actually cared, they could have done it right (make a progressive encoded DVD9). But in India no one cares, their equipment is obsolete, they have no quality control. It's all about rushing it out the door as quickly and as cheaply as possible. Yash Raj is no better and no worse than the rest of them.

EuropeanMan
16th April 2009, 03:37
You rock Manono :) thanks so much...

EuropeanMan
6th May 2009, 04:57
I have another terrible source - yes, I have plenty of them.

I've used Yadif(mode=3) & SRestore() on this...

Now, when I pull the .avs thru VDM and look through the frames, there are many frames with chroma ghosting/bleeds? I don't know quite how
to describe this. I give you 6 consecutive frames to reference.

Also, every 11th/12th frames seem to be DUPLICATE every so often or so.... :( Would love some help....thanks.

http://i43.tinypic.com/2mhj6yo.jpg
http://i42.tinypic.com/j0w3ky.jpg
http://i43.tinypic.com/2lstcu1.jpg
http://i41.tinypic.com/29lclg8.jpg
http://i39.tinypic.com/2v7v2ph.jpg
http://i40.tinypic.com/2dmfogn.jpg

EuropeanMan
6th May 2009, 06:52
Apparently I forgot to provide a sample...sorry. Very small, 8 seconds or so...
http://www.sendspace.com/file/kxu5fo

Would appreciate any response....thanks.

EuropeanMan
6th May 2009, 16:23
Bump....

EuropeanMan
6th May 2009, 23:43
Bump again

thetoof
7th May 2009, 03:34
I know I haven't been around much and that this may be pure ranting, but bumping again and again is NOT going to make everybody want to help you more, especially not if it's in the same *****g day. I don't want to play moderator here, but this is simply annoying.

Basically what seems to be happening here is:
1 - all good
2 - all good
3 - all good
4 - chroma information is about 50/50 current and previous frame
5 - chroma information is almost only from the previous frame and current frame's chroma is missing
6 - all good

How to solve? Dunno since a frame's chroma information seems to have disappeared. Maybe some sort of complex detection + interpolation could do the job...

EuropeanMan
7th May 2009, 04:03
^ Can you point me to some filters that would handle the job? Thanks

thetoof
7th May 2009, 06:35
masktools for detection and maybe MVTools for interpolation, then mergechroma of the interpolated frame onto the original.

This is very very advanced stuff. If what I just said doesn't help you, you'll have to study a LOT the infinite possibilities of the masktools (actually, if you manage to understand how srestore truly works, it'll be a good step towards creating the filter chain you want). Only a few on this forum would know how to do this (if it's even doable), so you'll have to wait or learn. I, of course, don't have the required experience to go beyond hypothesis, so good luck.

EuropeanMan
7th May 2009, 06:43
Appreciate the tips - I guess I have homework cut out for me this weekend.

MOmonster
7th May 2009, 21:49
Bumping two times the same day you wrote your post is really unnecessary.
But to your sample.
Like thetoof said, with some complex scripting the source can be improved alot. But looking at the chroma only, some things aren't restoreable (f.e. frame 5/6 and 21/22/23).
And imho the quality of your source is so bad, that it's not worth to invest so much time for a 'piecewise' restoring.

EuropeanMan
9th May 2009, 03:57
In MY opinion it is worth restoring, even if it is piecewise...I'd really love help please. :( For me, speed of encoding is not an issue...thanks in advance.

SPiKA
15th May 2009, 21:33
Is there a way to properly restore this source? because nothing I've tried seems to work at all...

http://www.sendspace.com/file/z8as85

manono
15th May 2009, 23:05
Is there a way to properly restore this source? because nothing I've tried seems to work at all...

It's pretty much hopeless. When the majority of the fields are blended, as is the case for much of that sample, there's not much you can do.

Yadif(Mode=1,Order=1)
SRestore(Frate=23.976)

About all you can hope for is to get the framerate right and for it to play smoothly. Maybe someone else has more encouraging advice.

martinfrombern
23rd May 2009, 01:55
tried srestore, but unfortunately no success. source is galapagos vc-1 bluray.
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\MaskTools2.0.a36\mt_masktools-26.dll")
Load_Stdcall_plugin("C:\Program Files (x86)\AviSynth 2.5\plugins\yadif\yadif.dll")

Import("C:\Program Files (x86)\AviSynth 2.5\plugins\srestore\srestore.avsi")

DirectShowSource("D:\encoding\current3\comparison-vc.grf",audio=false)
ConvertToYV12()

#deinterlace (bobber)
yadif(mode=1)

#NTSC ---> PAL reconversion
srestore(frate=25, speed=-25)
however, i got blended frames like this one in bunch of places.
http://hdimage.org/images/qggrbni75gfzw7f4dac_blending.png
am i missing something obvious?

lansing
23rd May 2009, 18:38
with FILM -> PAL playing on actual speed + ghosting, how do I restore it back to 23.976fps + unblend the ghosting.

I tried srestore(frate=23.976), but it doesn't seen to work correctly

manono
24th May 2009, 04:19
with FILM -> PAL playing on actual speed + ghosting, how do I restore it back to 23.976fps + unblend the ghosting.

I tried srestore(frate=23.976), but it doesn't seen to work correctly

Without a sample, no one can do anything but guess what you have. Is this a PAL DVD? Did you forget to add in the bobber before the SRestore line:

Yadif(Mode=1,Order=1)#or your favorite bobber
SRestore(FRate-23.976)

lansing
25th May 2009, 18:20
Without a sample, no one can do anything but guess what you have. Is this a PAL DVD? Did you forget to add in the bobber before the SRestore line:

Yadif(Mode=1,Order=1)#or your favorite bobber
SRestore(FRate-23.976)

it's a Pal DVD, i uploaded the sample here:
http://www.mediafire.com/download.php?3njuezxnjjq

manono
26th May 2009, 04:23
Did you forget to add in the bobber before the SRestore line:

Yadif(Mode=1,Order=1)
SRestore()

works reasonably well. When you see residual blending, both fields of the original frame were blended and nothing can be done to completely remove it.

Leinad4Mind
29th May 2009, 17:58
Hi there, I have made a script using restore24 and that works in AVSP, but when I import the avs script to megui and click on queue, it give me some error memory.

I have already try with
setmemorymax(340)
setmemorymax(512)
setmemorymax(1024)
setmemorymax(2048)

I have 4Gb (I think just 3Gbs are in used), and Windows Vista, and my machine it's a portable.

Any help?

The error says that the attempt to write/read in memory was protected... something like that

EuropeanMan
29th May 2009, 18:08
Unfortunately for many people, there is a memory leak issue (still). It might be preferable for you to encode to a lossless file via huffy/lagarith. Then source that into megui for your rip output. Depending on the length of the movie, you might need upwards of 80GB free space (80 referring to aprox 3+ hour film)....shorter films would require less space in the huffy/lag codec.

Since you have a laptop like mine...4GB; 3GB actually 'seen' by Vista...I'd suggest using 1024 or 1/2 of your available (3GB) in the setmemorymax line...

Good luck

Arshad07
30th May 2009, 18:49
Is question on mrestore still being answered?

stej4u
5th June 2009, 00:15
I got a problem, every time I use a script with srestore/mrestore and CCE SP2. this error comes up after a few hours. I can successfully use m/srestore with CCE SP1 but SP2 gives me an error: http://img4.imageshack.us/img4/3547/31917630.png

Arshad ^ recommended http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en , will this solve the problem?

jmartinr
5th June 2009, 00:48
Arshad ^ recommended http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en , will this solve the problem?

Why don't you try it?

stej4u
5th June 2009, 02:55
Why don't you try it?

It takes a few hours and then it crashes, so I'll try it tonight but I wanted some opinions here.

edit: I tried it overnight, the error continues... :(

EuropeanMan
30th June 2009, 23:50
Is there a way to "decimate" the chroma field ONLY by one frame?
I've used SRestore on a video, but it 'seems' like the chroma is still off by one frame...sample is on previous page here...so I guess I need an advanced person to help me deinterlace that "correctly" or at good as possible..thanks so much. I just am failing in finding a 'solution'.

martinfrombern
24th July 2009, 12:15
I need help with this source (sample here (http://www.sendspace.com/file/j6l1x2)). I tried something like this
DirectShowSource("sample.mkv", audio=false)
bob() # for start, will replace later with better one
srestore(frate=25, speed=-25)
Unfortunately, I still get a bunch of blended frames. Any help, please? :)

Nightshiver
24th July 2009, 16:27
Why is your sample an .mkv? We need unprocessed video.

martinfrombern
25th July 2009, 01:47
Why is your sample an .mkv? We need unprocessed video.no processing was done here, just remuxing m2ts -> mkv with eac3to

Arshad07
13th September 2009, 23:51
Well, as srestore has memory issues, its better to split the video and then encode it. Correct me if i'm wrong here...

I was trying this yesterday but counldnt get it to work;

Load_Stdcall_plugin("D:\Encode\yadif16\yadif.dll")
DGDecode_mpeg2source("D:\three.d2v", cpu=6, info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
a=Trim(0,100000)
Yadif(Mode=1,Order=1)
SRestore()
b=Trim(100001,180000)
Yadif(Mode=1,Order=1)
SRestore()
a+b

Getting error that framerate doesnt match :confused:

Any help appreciated!

Gavino
14th September 2009, 00:04
You're setting b by trimming the result of the first SRestore.
Try this:
a=Trim(0,100000).Yadif(Mode=1,Order=1).SRestore()
b=Trim(100001,180000).Yadif(Mode=1,Order=1).SRestore()
a+b
Better still would be:
Yadif(Mode=1,Order=1).SRestore()
Trim(0, ...)+Trim(..., ...)
but you would then need to use different frame numbers, relative to the result of SRestore.

But why split in two if the two parts are consecutive?

manono
14th September 2009, 00:08
You want to split the encoding into 2 parts and then join the 2 parts later:

Trim(0,100000)#part 1
#Trim(100001,0)#part 2
Yadif(Mode=1,Order=1)
SRestore()

elguaxo
14th September 2009, 00:10
there are probably hundreds of ways to do this. I do it like this:

Script A:
DGDecode_mpeg2source("I:\sample.d2v")

SomeBobber
SRestore()

Trim(0,37968,false)

Script B:
DGDecode_mpeg2source("I:\sample.d2v")

SomeBobber
SRestore()

Trim(37969,75937,false)

I encode A and then B to lossless AVIs. And then I use this script for joining all parts for the final encode:

a=AVISource("sample.part1.avi")
b=AVISource("sample.part2.avi")

f=a+b
return f

edit: already answered by manono :)

Arshad07
14th September 2009, 00:19
You're setting b by trimming the result of the first SRestore.
Try this:
a=Trim(0,100000).Yadif(Mode=1,Order=1).SRestore()
b=Trim(100001,180000).Yadif(Mode=1,Order=1).SRestore()
a+b

Tried that. Works fine but running time has gone down dramatically. Like movie was ~ 2hrs, it came down to 1hr 40 mins. :confused:

Better still would be:
Yadif(Mode=1,Order=1).SRestore()
Trim(0, ...)+Trim(..., ...)
but you would then need to use different frame numbers, relative to the result of SRestore.

Works fine. Will see if it encodes without crashing. Thanks


But why split in two if the two parts are consecutive?

Because everytime i'm encoding, its crashing at like 60%. I'm guessing thats because Srestore cannot be used on a certain length of a movie.

You want to split the encoding into 2 parts and then join the 2 parts later:

Trim(0,100000)#part 1
#Trim(100001,0)#part 2
Yadif(Mode=1,Order=1)
SRestore()

Dont understand what you're trying to do here.

there are probably hundreds of ways to do this. I do it like this:

Script A:
DGDecode_mpeg2source("I:\sample.d2v")

SomeBobber
SRestore()

Trim(0,37968,false)

Script B:
DGDecode_mpeg2source("I:\sample.d2v")

SomeBobber
SRestore()

Trim(37969,75937,false)

I encode A and then B to lossless AVIs. And then I use this script for joining all parts for the final encode:

a=AVISource("sample.part1.avi")
b=AVISource("sample.part2.avi")

f=a+b
return f

edit: already answered by manono :)

Cheers. :thumbup:

Will see how it turns out! ;)

Gavino
14th September 2009, 00:31
Tried that. Works fine but running time has gone down dramatically. Like movie was ~ 2hrs, it came down to 1hr 40 mins. :confused:
Probably the movie is more than 180000 frames.
Replace 180000 by 0 (meaning up to the end).
Because everytime i'm encoding, its crashing at like 60%. I'm guessing thats because Srestore cannot be used on a certain length of a movie.
If there's a memory leak within SRestore, it probably won't be cleared until you unload the entire script, so calling it in two halves within the same script wouldn't help.
That's why manono and elguaxo are suggesting to do two separate encodes (to lossless files) and then join the results (in a third script).

Guest
14th September 2009, 00:35
Why don't we (you!) fix the memory leak in Srestore?

Arshad07
14th September 2009, 00:44
Why don't we (you!) fix the memory leak in Srestore?

Sorry man! Didnt mean to hurt either you or the developper of this amazing plugin! :)

Gavino
14th September 2009, 00:49
Why don't we (you!) fix the memory leak in Srestore?
I don't use SRestore myself, so I've never looked at it in detail.
Has anyone tried investigating this and localised the problem?

Guest
14th September 2009, 00:55
Sorry man! Didnt mean to hurt either you or the developper of this amazing plugin! :) Nobody is hurt; I'm just thinking we could make it even more awesome.

Arshad07
15th September 2009, 16:54
@elguaxo and others

Thanks you. It works like a charm.

By the way, can i use TempGaussMC instead of Yadiff (as a bobber)? If yes, how?

Didée
15th September 2009, 17:08
Hurdy-Gurdy: Do not use mo-comp'ed bobbers on fieldblended input.

The motion search can't match a clean field/frame with a blended field/frame. With TGMC in particular, there is danger that some of the blending gets weighted into the clean fields/frames.

For fieldblended stuff, I'd rather go with traditional filters like tdeint or YadifMod for bobbing, using NNEDI2 as the interpolator.

Arshad07
15th September 2009, 17:15
Hurdy-Gurdy: Do not use mo-comp'ed bobbers on fieldblended input.

The motion search can't match a clean field/frame with a blended field/frame. With TGMC in particular, there is danger that some of the blending gets weighted into the clean fields/frames.

For fieldblended stuff, I'd rather go with traditional filters like tdeint or YadifMod for bobbing, using NNEDI2 as the interpolator.

Thx!

If i wanted to ask on how to use NNEDI2 as the interpolator, do i need to create a new thread or can it be in this thread itself?

Plus, are there any "good" bobbers except the likes of mcbob and mvbob?

Didée
15th September 2009, 17:30
c = last
edi = c.NNEDI2(field=-2)

YDM = c.YadifMod(mode=1,edeint=edi)
TD = c.tdeint(mode=1,edeint=edi)

What's the excuse that you couldn't figure *that* by yourself? ;)

Gavino
16th September 2009, 11:08
Why don't we (you!) fix the memory leak in Srestore?
I have tracked down the memory leak, and ultimately its source lies within Avisynth itself, being a limitation of ScriptClip. :(

Most of the work in SRestore is done inside a large run-time script executed by ScriptClip. Because ScriptClip compiles the run-time script on every frame, it uses up space in Avisynth's string table (for variable names, etc). Most of the time, this is not significant, but for large scripts like SRestore, coupled with lots of source frames, it can add up. A rough test suggests SRestore eats up about 8Kb per frame, which for 100,000 frames amounts to 800Mb.

The solution is to move the code inside the run-time script to another function, reducing the run-time script itself to a simple function call. Result: goodbye memory problems, and noticeably increased speed too. :cool:

Here is a new srestore.avsi that fixes the problem:
# SRestore - modified version by Gavino 16/09/2009 to fix memory leak problem.
# Derived from SRestore 2.7c 12/11/2008

function srestore(clip source, float "frate", "omode", float "speed", float "blocks", int "mode", float "thresh", int "cache", clip "dclip")
{
###### parameters & other necessary vars ######
srad = isfloat(speed) && abs(speed)>=1 ? sqrt(abs(speed))*4 : 12
cache = default(cache,-1)
irate = framerate(source)
bsize = isfloat(speed) && speed>0 ? 16 : 32

global dm = default(mode,2)
global om = default(omode,6)
global bom = isstring(om)
global thr = abs(default(thresh,16))+0.01
global frfac = bom || abs(om-3)<2.5 ? 1 : isfloat(frate) ? frate*5<irate || frate>irate ? 1 :
\ abs(frate)/irate : round(irate*10010)%30000==0 ? 1001./2400. : 480./1001.

global numr = abs(frfac*1001-round(frfac*1001))<0.01 ? round(frfac*1001) :
\ abs(1001/frfac-round(1001/frfac))<0.01 ? 1001 : round(frfac*9000)
global numr = isfloat(frate) && abs(irate*numr/float(round(numr/frfac))-frate) >
\ abs(irate*round(frate*100)/float(round(irate*100))-frate) ? round(frate*100) : numr
global denm = round(numr/frfac)


###### source preparation & lut ######
global out = source
global mec = abs(dm)<2 || bom ? nop() : mergeluma(mergechroma(out,out.trim(1,0),0.5),out.trim(1,0),0.5)
global det = default(dclip,source).killaudio.converttoyv12
global det = det.pointresize(srad==4 ? det.width : int(det.width/2/srad+4)*4, srad==4 ? det.height : int(det.height/2/srad+4)*4).trim(2,0)
global det = dm<0 ? stackvertical(stackhorizontal(det.utoy,det.vtoy),det) : det
global det = bom ? det.mt_lut("x 0.5 * 64 +",y=3,u=1,v=1) : det

code0 = "x 128 - y 128 - * 0 > x 128 - abs y 128 - abs < x 128 - 128 x - * y 128 - 128 y - * ? x y + 256 - x y + 256 - * ? 0.25 * 128 +"
code1 = "x y - 2 ^ 3 * x y + 256 - 2 ^ - 128 +"
diff = mt_makediff(det,det.trim(1,0),y=3,u=1,v=1)
global bclp = bom==false ? mt_lutxy(diff,diff.trim(1,0),expr=code0,y=3,u=1,v=1).bilinearresize(bsize,bsize) :
\ mt_lutxy(diff.trim(1,0),mt_adddiff(diff,diff.trim(2,0),y=3,u=1,v=1),expr=code1,y=3,u=1,v=1).bilinearresize(bsize,bsize)
global dclp = diff.trim(1,0).mt_lut("x 128 - abs 1.1 ^ 1 -",y=3,u=1,v=1).bilinearresize(bsize,bsize)


###### POSTPROCESSING ######
unblend1 = bom ? average(out.loop(2,0,0), -1.0, out, 2.0) : nop()
unblend2 = bom ? average(out.trim(1,0), 2.0, out.trim(2,0), -1.0) : nop()

qmask1 = bom ? mt_makediff(unblend1.removegrain(mode=19,modeU=-1,modeV=-1),unblend1,y=3,u=1,v=1) : nop()
qmask2 = bom ? mt_makediff(unblend2.removegrain(mode=19,modeU=-1,modeV=-1),unblend2,y=3,u=1,v=1) : nop()
diffm = bom ? mt_makediff(out.loop(2,0,0),out,y=3,u=1,v=1).mt_lut("x y - abs",y=3,u=1,v=1).mt_expand() : nop()
bmask = bom ? mt_lutxy(qmask1,qmask2,expr="x y - == 128 x 128 - 2 ^ x 128 - 2 ^ y 128 - 2 ^ + / 255 *",y=3,u=1,v=1) : nop()
dmask = bom ? mt_lutxy(diffm,diffm.trim(2,0),expr="x 2 * y < x 4 < & 0 y 2 * x < y 4 < & 255 x x y + / 200 * 28 + ? ?",y=3,u=1,v=1) : nop()
pmask = bom ? mt_lutxy(dmask, bmask, expr="y 0 > y 255 < & x 0 == x 255 == | & x y ?",y=3,u=1,v=1) : nop()

pp0 = bom ? average(out.loop(2,0,0), -0.5, out, 1.0, out.trim(1,0), 1.0, out.trim(2,0), -0.5) : nop()
pp1 = bom ? mt_merge(unblend1,unblend2,dmask.removegrain(mode=12,modeU=-1,modeV=-1).greyscale(),y=3,u=3,v=3) : nop()
pp2 = bom ? mt_merge(unblend1,unblend2,bmask.removegrain(mode=12,modeU=-1,modeV=-1),luma=true) : nop()
pp3 = bom ? mt_merge(unblend1,unblend2,pmask.removegrain(mode=12,modeU=-1,modeV=-1),luma=true).removegrain(mode=0,modeU=12,modeV=12) : nop()

global fin = bom ? eval(om) : nop()


###### initialise variables ######
global lfr = -100
global offs = 0
global ldet = -100
global lpos = 0


###### evaluation call & output calculation ######
scriptclip( source, "srestore2(current_frame)")


###### final decimation & caching ######
cache<0 ? last : last.RequestLinear(8, cache, 5, false, false)

temp = frameratenumerator(det)*float(numr)>2147483600. ? det.assumescaledfps(numr,denm) : nop()
isclip(temp) ? last.changefps(temp,linear=true) : last.changefps(frameratenumerator(source)*numr,frameratedenominator(source)*denm,linear=true)


return last
}

function srestore2(clip c, int current_frame) {

### preparation ###
cfr = current_frame
jmp = lfr+1==cfr
cfo = (((cfr%denm)*numr*2+denm+(versionnumber()>2.575 ? numr : 0))%(2*denm))-denm
bfo = cfo>-numr && cfo<=numr

global lfr = cfr
global offs = bfo && offs<=-4*numr ? offs+2*denm : bfo && offs>=4*numr ? offs-2*denm : offs

pos = frfac==1 ? 0 : bfo ? -round((cfo+offs)/(2.*numr)) : lpos
cof = cfo+offs+2*numr*pos

global ldet = cfr+pos==ldet ? -1 : cfr+pos

## diff value shifting ##
d_v = yplanemax(dclp)+.015625
d43 = jmp ? d32 : d_v
global d32 = jmp ? d21 : d_v
global d21 = jmp ? d10 : d_v
global d10 = jmp ? d01 : d_v
global d01 = jmp ? d12 : d_v
global d12 = jmp ? d23 : d_v
global d23 = jmp ? d34 : d_v
global d34 = d_v

## diff value shifting ##
m_v = isfloat(om) && abs(om)>5 ? lumadifference(det,det.trim(2,0))+.015625 : 1
m53 = jmp ? m42 : m_v
global m42 = jmp ? m31 : m_v
global m31 = jmp ? m20 : m_v
global m20 = jmp ? m11 : m_v
global m11 = jmp ? m02 : m_v
global m02 = jmp ? m13 : m_v
global m13 = jmp ? m24 : m_v
global m24 = m_v

## get blend and clear values ##
b_v = 128-yplanemin(bclp)
b_v = b_v<1 ? .125 : b_v
c_v = yplanemax(bclp)-128
c_v = c_v<1 ? .125 : c_v

## blend value shifting ##
bp3 = jmp ? bp2 : bom ? b_v-c_v : b_v
global bp2 = jmp ? bp1 : bp3
global bp1 = jmp ? bn0 : bp3
global bn0 = jmp ? bn1 : bp3
global bn1 = jmp ? bn2 : bp3
global bn2 = jmp ? bn3 : bp3
global bn3 = bom ? b_v-c_v : b_v

## clear value shifting ##
cp3 = jmp ? cp2 : c_v
global cp2 = jmp ? cp1 : c_v
global cp1 = jmp ? cn0 : c_v
global cn0 = jmp ? cn1 : c_v
global cn1 = jmp ? cn2 : c_v
global cn2 = jmp ? cn3 : c_v
global cn3 = c_v

## used detection values ##
bb = select(pos+2,bp3,bp2,bp1,bn0,bn1)
bc = select(pos+2,bp2,bp1,bn0,bn1,bn2)
bn = select(pos+2,bp1,bn0,bn1,bn2,bn3)

cb = select(pos+2,cp3,cp2,cp1,cn0,cn1)
cc = select(pos+2,cp2,cp1,cn0,cn1,cn2)
cn = select(pos+2,cp1,cn0,cn1,cn2,cn3)

dbb = select(pos+2,d43,d32,d21,d10,d01)
dbc = select(pos+2,d32,d21,d10,d01,d12)
dcn = select(pos+2,d21,d10,d01,d12,d23)
dnn = select(pos+2,d10,d01,d12,d23,d34)
dn2 = select(pos+2,d01,d12,d23,d34,d34)

mb1 = select(pos+2,m53,m42,m31,m20,m11)
mb = select(pos+2,m42,m31,m20,m11,m02)
mc = select(pos+2,m31,m20,m11,m02,m13)
mn = select(pos+2,m20,m11,m02,m13,m24)
mn1 = select(pos+2,m11,m02,m13,m24,.01)


### basic calculation ###
bbool = .8*bc*cb>bb*cc && .8*bc*cn>bn*cc && bc*bc>cc
blend = bbool && bc*5>cc && dbc+dcn>1.5*thr && (dbb<7*dbc || dbb<8*dcn) && (dnn<8*dcn || dnn<7*dbc) &&
\ (mb<mb1 && mb<mc || mn<mn1 && mn<mc || (dbb+dnn)*4<dbc+dcn || (bb*cc*5<bc*cb || mb>thr) && (bn*cc*5<bc*cn || mn>thr) && bc>thr)

clear = dbb+dbc>thr && dcn+dnn>thr && (bc<2*bb || bc<2*bn) && (dbb+dnn)*2>dbc+dcn && (mc<.96*mb && mc<.96*mn && (bb*2>cb || bn*2>cn) &&
\ cc>cb && cc>cn || frfac>.45 && frfac<.55 && .8*mc>mb1 && .8*mc>mn1 && mb>.8*mn && mn>.8*mb)

highd = dcn>5*dbc && dcn>5*dnn && dcn>thr && dbc<thr && dnn<thr

lowd = dcn*5<dbc && dcn*5<dnn && dbc>thr && dnn>thr && dcn<thr && frfac>.35 && (frfac<.51 || dcn*5<dbb)

res = d43<thr && d32<thr && d21<thr && d10<thr && d01<thr && d12<thr && d23<thr && d34<thr ||
\ dbc*4<dbb && dcn*4<dbb && dnn*4<dbb && dn2*4<dbb || dcn*4<dbc && dnn*4<dbc && dn2*4<dbc


### offset calculation ###
odm = blend ? denm : clear ? 0 : highd ? denm-numr : lowd ? 2*denm-numr : cof
odm = odm+round((cof-odm)/(2.*denm))*2*denm
odr = (blend ? denm-numr : clear ? numr : highd ? numr : frfac<0.5 ? 2*numr : 2*(denm-numr)) * .9

cof = ldet<0 ? cof : cof>odm+odr ? cof-offs-odm-odr>denm && res ? odm+2*denm-odr : odm+odr : cof<odm-odr ?
\ offs>denm && res ? odm-2*denm+odr : odm-odr : offs<-1.15*denm && res ? cof+2*denm : offs>1.25*denm && res ? cof-2*denm : cof

global offs = frfac==1 ? 0 : cof-cfo-2*numr*pos
global lpos = pos
opos = frfac==1 ? 0 : -round((cfo+offs+(bfo && offs<=-4*numr ? denm : 0))/(2.*numr))
pos = opos<-2 ? -2 : opos>2 ? 2 : opos


### frame output calculation - resync - dup ###
dbb = select(pos+2,d43,d32,d21,d10,d01)
dbc = select(pos+2,d32,d21,d10,d01,d12)
dcn = select(pos+2,d21,d10,d01,d12,d23)
dnn = select(pos+2,d10,d01,d12,d23,d34)

## dup_hq - merge ##
dup = opos!=pos || abs(dm)<2 || abs(dm)==3 ? 0 : dcn*5<dbc && dnn*5<dbc && (dcn<1.25*thr || bn<bc && pos==lpos) ||
\ (dcn*dcn<dbc || dcn*5<dbc) && bn<bc && pos==lpos && dnn<.9*dbc || dnn*9<dbc && dcn*3<dbc ? 1 :
\ (dbc*dbc<dcn || dbc*5<dcn) && bb<bc && pos==lpos && dbb<.9*dcn || dbb*9<dcn && dbc*3<dcn ||
\ dbb*5<dcn && dbc*5<dcn && (dbc<1.25*thr || bb<bc && pos==lpos) ? -1 : 0
mer = bom==false && opos==pos && dup==0 && abs(dm)>2 && (dbc*8<dcn || dbc*8<dbb || dcn*8<dbc || dcn*8<dnn || dbc*2<thr ||
\ dcn*2<thr || dnn*9<dbc && dcn*3<dbc || dbb*9<dcn && dbc*3<dcn)

## deblend - doubleblend removal - postprocessing ##
add = bp1*cn2>bn2*cp1*(1+thr*.01) && bn0*cn2>bn2*cn0*(1+thr*.01) && cn2*bn1>cn1*bn2*(1+thr*.01)
dup = bom ? (bn0>bp2 && bn0>=bp1 && bn0>bn1 && bn0>bn2 && cn0<125 ? (d12*d12<d10 || d12*9<d10) ? 1 :
\ (d10*d10<d12 || d10*9<d12) ? 0 : 4 : bp1>bp3 && bp1>=bp2 && bp1>bn0 && bp1>bn1 ? 1 : 0) :
\ dup!=0 ? dup : om>0 && om<5 ? (bbool==false ? 0 : om==4 && bp1*cn1<bn1*cp1 || om==3 && d10<d01 || om==1 ? -1 : 1) :
\ om==5 ? (bp1*cp2>bp2*cp1*(1+thr*.01) && bn0*cp2>bp2*cn0*(1+thr*.01) && cp2*bn1>cn1*bp2*(1+thr*.01) && (add==false || cp2*bn2>cn2*bp2) ?
\ -2 : add ? 2 : bn0*cp1>bp1*cn0 && (bn0*cn1<bn1*cn0 || cp1*bn1>cn1*bp1) ? -1 : bn0*cn1>bn1*cn0 ? 1 : 0) : 0


### output clip ###
oclp = mer && dup==0 ? mec : out
opos = opos + dup - (dup==0 && mer && dbc<dcn ? 1 : 0)
dup==4 ? fin : opos<0 ? oclp.loop(1-opos,0,0) : oclp.trim(opos,0)
}
Although I have done some simple tests, I don't have any material to exercise it properly, so I urge SRestore enthusiasts to try it out and see how it compares to the original in results, memory usage, and speed.

elguaxo
16th September 2009, 11:34
:eek:

I'll start testing it right away! :thanks:

thewebchat
16th September 2009, 13:55
Perhaps this is some nuance of AVS that I don't understand, but the function SRestore2() doesn't appear to return anything.

Gavino
16th September 2009, 14:08
function SRestore2() doesn't appear to return anything.
There is an implicit return on the last line.
('return' is optional if the last statement is an expression, just as in a script).

elguaxo
16th September 2009, 17:52
Thanks again Gavino! I just tried your fixed version on a movie that needs to be restored from NTSC to PAL. The restoration works fine, like the original SRestore, and I don't get memory leaks! :)

mavinashbabu
16th September 2009, 18:23
sorry dumb question, we should call it as Srestore() or SRestore2() ?

Gavino
16th September 2009, 18:28
Call SRestore as before. The interface is completely unchanged.
SRestore2 is an additional function called internally by SRestore. You don't need to know about it, except that it must be there for SRestore to work.

mavinashbabu
16th September 2009, 18:38
^^ Thanks Gavino, will try to encode a 150 minutes of DVD without splitting and will provide the update here.

MOmonster
16th September 2009, 20:35
Thanks Gavino,

If I had more time I would work on a newer version of this function, but at the moment there are just too much other things todo.

I tried the same approach in Mrestore 1.6 and srestore 2.65, but the AverageLuma call and so on was still inside scriptclip, maybe that was the reason, why it didn't worked for me at that time.

I will test it later. :thanks:

Gavino
17th September 2009, 14:22
By the way, the change I made to SRestore also solves another problem with the original version.
Try this with the old SRestore:
...
out = SRestore()
return out
It dies horribly, leaving you thinking "What the ...?"
Change 'out' to 'out2' and it works fine. What on earth is going on?, you may ask.

The reason is the old problem of ScriptClip and variable binding. (See here (http://avisynth.org/mediawiki/The_script_execution_model/Scope_and_lifetime_of_variables#Runtime_scripts), and see GRunT for a solution.)
SRestore includes code like this:
global out = source
...
ScriptClip("""
... code which derives a clip from 'out' ...
""")
The problem is the global variable 'out' designed to be used by the ScriptClip call may be inadvertently hidden by a variable in the user's script, causing it to use the user's variable instead. A variable 'out' used anywhere in the script will stop SRestore working properly, but the example here has particularly bad consequences, since it sets up a loop in the filter graph - something otherwise impossible to do in the script language - where the output of SRestore is derived from itself. So when Avisynth tries to fetch a frame from the graph, an infinite recursion occurs ... :eek:

Similarly, problems could occur if you have a variable in your script with any of the following names:
dm, om, bom, thr, frfac, numr, denm, mec, det, bclp, dclp, fin, lfr, offs, ldet, lpos.

Now, in the new version, the code in SRestore's run-time script has been moved into its own function, so any user variables with the same names are hidden and the correct global variables will be used.

Of course, it can still go wrong if you use a global variable called 'out' (or any of the other names) in your script, but that is less likely (especially now you've all been warned... ;)).

canuckerfan
18th September 2009, 04:12
good stuff! I can now use this script on a >2hr movie without having to chop it up:)

mavinashbabu
21st September 2009, 15:38
@Gavino.. your "fix" worked perfectly... on a 2hr 34mn 57sec movie with 234847 frames X264 lossless encode it did not break at all .. :thanks:

@ Legionstar: Telugu Movie - Nuvvostanante Nenodantana @25fps

legionstar
21st September 2009, 18:24
What dvd were you encoding mavinash

pdadi
23rd September 2009, 02:29
Thanks Gavino. It works now. Bye bye to Mem leak

MOmonster
24th September 2009, 21:43
Thanks for the fix. Everything works well.

I replaced the srestore.avs in the zip file (now 2.7d). A new version will maybe come later.

AlanHK
28th September 2009, 19:17
Thanks for the fix. Everything works well.

I replaced the srestore.avs in the zip file (now 2.7d). A new version will maybe come later.

Could I suggest you put a comment line in the AVS with the version number and date at least; if you're not intimately acqainted with the code there is no way to tell which version a particular "srestore.avs" file is.

cretindesalpes
15th October 2009, 21:20
Hello,

I have a telecined video with a weird kind of progressive blending between frames (I suppose it is intended to smooth transitions when displayed on cathodic screens). Is it possible to restore the original frames, and how ?

http://img386.imageshack.us/img386/7369/testp.th.jpg (http://img386.imageshack.us/img386/7369/testp.jpg)

AlanHK
16th November 2009, 09:27
A.avi and B.avi are 29.97 fps.

This script works:

AVISource("A.avi")
LanczosResize(720,576)
A=last

AVISource("B.avi")
LanczosResize(720,576)
B=last

A++B
Srestore(frate=25)


But I get an error with this script:

AVISource("A.avi")
Srestore(frate=25)
LanczosResize(720,576)
A=last

AVISource("B.avi")
Srestore(frate=25)
LanczosResize(720,576)
B=last

A++B
If A.avi and B.avi are different sizes, I get:
"ScriptClip: Function did not return a video clip with the same width as the source clip!"

But if they're the same size, it works fine.
Or if I replace "Srestore(frate=25)" with "ChangeFPS(25)", it also works.

So I guess a scoping error in SRestore.

Gavino
16th November 2009, 09:52
So I guess a scoping error in SRestore.
Because of its use of global variables, SRestore cannot be used more than once in a script.

AlanHK
17th November 2009, 00:06
Because of its use of global variables, SRestore cannot be used more than once in a script.

Well it can be used, and gives no obvious errors in some cases, presumably when the source videos are the same spec.

But is it actually giving correct results? It gives an output video of the right fps at least. It's worrying if it gives a wrong result without an error message.

Gavino
17th November 2009, 00:50
When I said it can't be used, I meant it cannot be relied on to work if called more than once. Even when it appears to work (ie no error is produced), the results are not necessarily correct, although you might get away with it under some circumstances.

Normally, I would be quite critical about a function (ab)using global variables (one of my pet peeves :)), but in the case of SRestore (and others of the same type), it is necessary for performance reasons.

Even so, the documentation should make clear that it should only be called once in a script.

AlanHK
17th November 2009, 05:43
Well, if it has to use global variables, could one be set so it knows if it has been called more than once, then exits with a error more informative than the one I mentioned earlier?

Gavino
17th November 2009, 15:14
Good idea.
How about it, MOmonster?

MOmonster
18th November 2009, 19:03
Is done!
Also version number is now documented inside the avs file.

Sorry, currently I really don't have much time for support.

@cretindesalpes
Yours source is theoretical restorable. Maybe srestore will have some problems with the particular blends.
After decimating (1of5) the pattern should be like this:
cbcbcbcbcbcb...
I don't see a reason reduce the framerate to ~12fps.

SweetDream
19th November 2009, 20:44
Thank you Momonster. :)

Boulder
24th November 2009, 15:29
What is the proper way to use SRestore for restoring DEFT conversions, i.e. is setting frate=25 enough? I'm working on the PAL Star Trek TNG DVDs.

MOmonster
25th November 2009, 14:08
Short answer: Yes, frate=25 is enough!
You can improve the quality of your bobbed source for example this way:
tdeint(mode=1,tryweave=true,full=false)
srestore(frate=25)

Boulder
14th December 2009, 08:28
I never got SRestore working well enough for that crappy TNG PAL conversion, but I suddenly remembered that I once asked for help when I used to capture the series when it was broadcast on TV.

Scharfis_brain eventually came up with this function which seems to work quite well:
function repairPAL_TNG_DVD(clip i, bool "show")
{

ord = getparity(i) ? 1 : 0

show = default(show,true)
global h=i.leakkernelbob(order=ord,threshold=5)

global he = show ? " even " : ""
global ho = show ? " odd " : ""
tele = show ? " fieldmatched" : ""
auto = show ? " deblended" : ""


# create analysis-clip for blend-detection

j=h.reduceby2()
# create edgemask of analysis-clip
global k=logic(j.DEdgemask(0,255,0,255,"5 0 -5 10 0 -10 5 0 -5",setdivisor=true,divisor=6,y=3,u=1,v=1),
\ j.DEdgemask(0,255,0,255,"5 10 5 0 0 0 -5 -10 -5",setdivisor=true,divisor=6,y=3,u=1,v=1),"max",y=3,u=1,v=1)
\ .greyscale().levels(0,0.5,160,0,255,false).bicubicresize(80,80)


# create some fwd & bwd clips. syntax:
# e=even | o=odd
# c=current | n=next | p=prev
# nn=next+1 | pp=prev-1

global kec=k.selecteven()
global ken=kec.deleteframe(0)
global kenn=kec.deleteframe(0).deleteframe(0)
global kep=kec.duplicateframe(0)
global kepp=kec.duplicateframe(0).duplicateframe(0)

global koc=k.selectodd()
global kon=koc.deleteframe(0)
global konn=koc.deleteframe(0).deleteframe(0)
global kop=koc.duplicateframe(0)
global kopp=koc.duplicateframe(0).duplicateframe(0)

global ko=h.selectodd() #.subtitle(ho)
global ke=h.selecteven()#.subtitle(he)
global kb=ko.mergeluma(ke,0.5).mergechroma(ke,0.5)

global th=1.02

# deblend the video
#k0 = ScriptClip(blankclip(ko), "(x>0) ? ko.subtitle(string(x)) : (x<0) ? ke.subtitle(string(x)) : kb.subtitle(string(x))")
k0 = ScriptClip(blankclip(ko), "(x>0) ? ko : (x<0) ? ke : kb")

k1 = FrameEvaluate(k0, "")


k2 = FrameEvaluate(k1, "x=(konl /th > kenl ) ? x+1 : (kenl /th > konl ) ? x-1 : x")
k3 = Frameevaluate(k2, "x=(kocl /th > kenl ) ? x+1 : (kenl /th > kocl ) ? x-1 : x")
k4 = Frameevaluate(k3, "x=(kocl /th > kecl ) ? x+1 : (kecl /th > kocl ) ? x-1 : x")
k5 = FrameEvaluate(k4, "x=(kopl /th > kecl ) ? x+1 : (kecl /th > kopl ) ? x-1 : x")
k6 = Frameevaluate(k5, "x=(kopl /th > kepl ) ? x+1 : (kepl /th > kopl ) ? x-1 : x")
k7 = FrameEvaluate(k6, "x=(koppl/th > kepl ) ? x+1 : (kepl /th > koppl) ? x-1 : x")
k8 = Frameevaluate(k7, "x=(koppl/th > keppl) ? x+1 : (keppl/th > koppl) ? x-1 : x")
k9 = FrameEvaluate(k8, "x=(konl /th > kennl) ? x+1 : (kennl/th > konl ) ? x-1 : x")
k10= Frameevaluate(k9, "x=(konnl/th > kennl) ? x+1 : (kennl/th > konnl) ? x-1 : x")

k17 = Frameevaluate(k10, "x=0")

k18 = FrameEvaluate(k17, "kopl=averageluma(kop)")
k19 = Frameevaluate(k18, "konl=averageluma(kon)")
k20 = Frameevaluate(k19, "kocl=averageluma(koc)")
k21 = FrameEvaluate(k20,"kepl=averageluma(kep)")
k22 = Frameevaluate(k21,"kenl=averageluma(ken)")
k23 = Frameevaluate(k22,"kecl=averageluma(kec)")
k24 = Frameevaluate(k23,"kennl=averageluma(kenn)")
k25 = Frameevaluate(k24,"keppl=averageluma(kepp)")
k26 = Frameevaluate(k25,"konnl=averageluma(konn)")
k27 = Frameevaluate(k26,"koppl=averageluma(kopp)")

result=k27


# try to telecide the video
tel=telecide(i,order=1,post=0)
tel0=tel.greyscale()
tel1=tel #.subtitle(tele)
tel2=result#.subtitle(" deblend")
flag1=blankclip(tel)
flag2=flag1.invert()

# if this fails (combing remains), then do fallback to deblend
flag=conditionalfilter(tel0,flag1,flag2,"iscombed(7)","==","false").crop(0,0,64,64)
flaga=flag.temporalsoften(2,255,255)
conditionalfilter(flaga,tel1,tel2,"averageluma()","<","62")
#conditionalfilter(flaga,last,last.subtitle("o"),"averageluma()","<","62")

}

The original thread is here: http://forum.doom9.org/showthread.php?t=82214. I don't know if the solution will work with all DEFT-conversions, but it is worth a try at least :) For my purposes, I did change the bobbing part of the function to YADIFMod + NNEDI2 compared to LeakKernelBob in that original version. Also note that the show parameter is "true" by default, you might want to change that to false.

aand
14th December 2009, 17:59
Some suggestions:
-change the name of the thread to "Srestore"
-adding a link to http://avisynth.org/mediawiki/Srestore in the first post

(haven't used the forum since 8 months ago, glad you're still here :D)

osgZach
14th December 2009, 18:16
Random question.

What does "DEFT" stand for?

thetoof
14th December 2009, 21:22
http://www.snellgroup.com/documents/brochures-conversion/alchemist/filmtoolsdata.pdf

MOmonster
16th December 2009, 10:17
@Boulder
Maybe you could upload some samples where srestore doesn't perform good. I could use them to improve srestore when I find the time for this.

@aand
I edited the first post. For the moment I'm happy with the title. Who knows when I will change the name again;).
The project srestore isn't really finished yet, but I just don't have time for this at the moment.

@thetoof
Nice PDF. If the DEFT-conversion would always work like it should do there would be no need for a restoring function.

Boulder
18th December 2009, 21:37
@Boulder
Maybe you could upload some samples where srestore doesn't perform good. I could use them to improve srestore when I find the time for this.Sure, I'll try to get a good sample for you when I have the time. It shouldn't be too hard as I got stuttering in the special FX parts and there's quite a few of them.

Boulder
23rd December 2009, 21:11
@Boulder
Maybe you could upload some samples where srestore doesn't perform good. I could use them to improve srestore when I find the time for this.
It seems that I owe you an apology..in fact SRestore performs better than scharfis_brain's function. For some weird reason, the test scene I used when I compared the few DEFT repairing methods, the function performed much better than the others.

I think the problem was that I didn't set the speed parameter low enough. I set it now to -1 and the cgi scenes and the film scenes look quite good. In fact it is possible that they cannot be improved ;) Though, I only checked one episode of the first season so it might be that the later seasons have their own problems..

Here's three testclips to use. The one which has both cgi and film is an interesting one. See how the material changes between frames 806 and 807..

http://www.mediafire.com/?sharekey=9b19b691e7eb0ac9ab1eab3e9fa335ca04cb3d5388e2d538

Boulder
23rd December 2009, 21:42
Also, should I exclude the SRestore part from multithreading (with SetMTMode) - if it uses global variables, there might be problems?

thetoof
26th December 2009, 09:36
Personally I'd multithread any decimation operation by splitting the clip to use multiple single threaded processes w/ trim + splice to encode.
and I don't think you'll get any problem with the global variables since they'd be called in different scripts/processes... but that'd have to be checked.

crasus
5th January 2010, 02:13
Any ideeas towards the removal of the ghosting in this sample? If anything can be done that is...

http://www.mediafire.com/?dyzymxmqinz

I tryied different settings and fps via srestore but no good. Main target is the original 20fps, and a simple tfm().tdecimate() should be enough if it wasn't for the damn ghosting.

Suggestions will be greatly appreciated. Thank you!

manono
5th January 2010, 05:50
I fooled around with it for awhile and tried a bunch of different things but couldn't come up with anything better than a basic:

Yadif(Order=1,Mode=1)
SRestore(FRate=20)

There's just too much ghosting in the source.

jmac698
19th January 2010, 10:11
Hello MO*,
I am trying to use srestore for ntsc->pal, to eliminate objectionable blending. Using the default works better than anything I tried before, and I even made my own filter based on a pattern I discovered.
However, there's some color artefacts left over and it's time to get into more advanced options.
However, I couldn't get it to work with the options and didn't know how to fix the results.
I am continuing this chore from some months ago, in case some bug was fixed.
I'll work on putting up a sample shortly.
If you have any parameter suggestions for this case, let me know in the meantime and I can try them.
thanks.

jmac698
19th January 2010, 10:19
ps
I had a thought, do you account for the different color subsampling when converting? ntsc 4:2:2 pal 4:2:0
I wonder if the conversion was done from 4:2:0 color. You should be able to do a better conversion from a better master if any pro formats use better color sampling? I can't remember right now.

MOmonster
25th January 2010, 06:12
@crasus
As manono said you can't do anything against the blending. You will get a pretty similar result with this:
Yadif(order=1,mode=1)
BlendBob(badFrames=0)
TDecimate(Mode=2,rate=20)

@jmac698
I really can't tell you the reason for this. Please upload a sample. I will have a look on it.

Floatingshed
26th January 2010, 14:33
Hello,

I'm getting an old problem rearing it's ugly head again.
"I don't know what d32 means".
It is difficult to work out why this is written across the video sometimes and not others. If it appears I simply abort virtualdub and save the file again and it will be fine. This means that I can never use fast recompress mode as I need to see the video!

Any thoughts most welcome...

lokie538
4th February 2010, 16:39
Not sure if this is the right place to post, but I am trying to get this script working as I have some weird source issues going on atm.

Im currently getting returned the error: "Script error: there is no function named "mt_makediff"" I presume masktools.dll is not being accessed properly?

Im trying with
LoadPlugin("C:\Program Files (x86)\megui\tools\avisynth_plugin\MaskTools.dll")
import("c:\srestore.avs")
mpeg2source("C:\tester1.hand.waving temp files\tester1.hand.waving.d2v",cpu=4,iPP=true)
srestore(frate=25)

I only added in the top line because I thought it wasn't loading properly.

Any ideas on how to get it functioning guys?

Cheers.

Didée
4th February 2010, 18:09
Get the up-to-date version of MaskTools: http://manao4.free.fr/masktools-v2.0a36.zip
From that package, import "mt_masktools-25.dll" (*not* the -26 one!).

yantei
4th February 2010, 22:36
Hi guys,

I'm looking for a suitable restoration function for my material:

progressive 23.976 fps material converted to progressive 25 fps PAL without any blends - 3 duplicate frames every second and one missing frame (?) between them

the pattern is something like this (duplicated frames):

1 3 5
26 28 30
51 53 55
76 78 80
99 101 103
124 126 128
149 151 153
172 174 176
197 199 201
222 224 226
247 249 251
270 272 274

...and so on...

the best would be to remove all duplicates and artificially generate this one missing frame every second - am I thinking right? is that possible? what would you suggest to try?

manono
5th February 2010, 00:28
Wrong thread for this, but how about a sample showing the problem?

yantei
6th February 2010, 12:01
okay - I've opened a new thread here: http://forum.doom9.org/showthread.php?p=1371516#post1371516 (the same post with a link to sample)

Dogway
16th February 2010, 06:11
I fooled around with it for awhile and tried a bunch of different things but couldn't come up with anything better than a basic:

Yadif(Order=1,Mode=1)
SRestore(FRate=20)

In this case, can't we use better deinterlacers? like McBob or TGMC? and then Decimate?

lapinot
22nd February 2010, 19:46
Hi.
I use srestore to transcode&decimate from ntsc dvd to silent movie speeds, works not bad, but I get color artifacts with tinted prints on everything moving fast enough.
is there a way to "store" color info with avisynth to save before transcoding/re-apply after ?

edit : just found a way : invert().srestore().invert(). no more uninvited colors :)

Dogway
1st March 2010, 19:13
Well, here I come at last. I had hard time trying to figure out the problematic filter. I would like to know why this filter makes crash my encoding, strange thing is I can preview on Avsp:

tempgaussmc_beta2(2,2,3,EdiMode="NNEDI2")
SRestore(FRate=23.976)

tempgauss outputs 59.94fps right? cant I set srestore to 23.976? If i set it to 25fps or leave it blank (outputs 25fps) it works, so... how can I revert 29.970 material back to original 24 frames per second?
Is my script correct? If not the only thing left would be something with my filters in the plugin folder because I have heavily checked everything else.

Didée
1st March 2010, 20:01
Can't tell you about the crashing, but ... do you know at all what your source really is about? You can't just set the frate to your liking, it has to match the original framerate of the buried progressive content. In particular for blended 29.97 NTSC, destination 25.0 and destination 23.976 are two *completely different* scenarios (and should toggle different codepaths in Srestore!). 29.97->25.0 means restoring a *field*blended normconversion. 29.97->23.976 means restoring blended telecine, i.e. a 3/2 pulldown that has been *frame* blended by blur(0,1), or by progressive resize, or similar. Also, and perhaps most importantly ... if it really IS blended telecine (and 29.97->23.976 therefore is the right way), then you must not bob before Srestore ...

Dogway
1st March 2010, 20:47
Source is the anime piece I uploaded (http://forum.doom9.org/showthread.php?p=1375464#post1375464) a few days ago. I dont have a clue to identify what kind of source it is (would like tho), but manono said it was 23.976 so I trust. He recommended me yadif, which is in the same boat as TGMC right? Now he must have mistaken, and source is actually 25fps. I tested it and it didnt crash, but output was jerky with some dups.

When you say normconversion you mean PAL<->NTSC?
So always if it is blended telecine, like 3:2 pulldown, I would have to use TFM or... (dunno more)

Thanks for the help, it is very much appreciated. In the end if I could only know how to detect those scenarios...

Boulder
1st March 2010, 21:09
There is the function AnimeIVTC created especially for anime restoration. You might want to try that instead of SRestore.

Didée
1st March 2010, 21:12
Aaaahh ... THAT one, now I remember. Well, that is - animation ...

Quickly browsing through the long sample, it mostly looks like "progressive telecine with fieldblending interrupted by duplicates".

Impossible? No, not impossible. It's animation!

Sorry to have bothered, but from such weirdness I stay away as far as I only can.

Dogway
1st March 2010, 21:19
lol sorry Didee, Im a thick head but not because I want it so badly to restore, it has to be more the I want to learn no matter what (through this kind of projects).
About AnimeIVTC isnt that some kind of filters conglomeration? or does it have specific algorithms? I like kind of seeing what I do through steps...


btw. long story short "progressive telecine with fieldblending interrupted by duplicates"= blended telecine?

Boulder
1st March 2010, 21:51
About AnimeIVTC isnt that some kind of filters conglomeration? or does it have specific algorithms? I like kind of seeing what I do through steps...

http://forum.doom9.org/showthread.php?t=138305

Dogway
2nd March 2010, 06:01
(...)It is not as versatile as doing everything externally(...)
.....
I will give it a try although I dont like installing 100+ filter for the sake of it

Boulder
2nd March 2010, 08:06
You could extract all contents into a separate folder and load the plugins from there. Create a base script with the appropriate LoadPlugin lines and then just copy-paste the section whenever you need them.

manono
2nd March 2010, 09:39
Now he must have mistaken, and source is actually 25fps. I tested it and it didnt crash, but output was jerky with some dups.
I wasn't mistaken. The 'base' framerate is 23.976fps. If you got missing frames and residual dupe frames then most likely you got the field order wrong (as I also said in that other thread).

And you can use whatever bobber you like. I used the bobbing form of Yadif for testing because it's fast, and also agreed that a better bobber was called for with that particular video.

AnimeIVTC can't do anything for that video (based on the samples provided) that a simple SRestore can't already do.

Dogway
2nd March 2010, 10:57
Now this is funny. I encoded this script with default x264-scratchpad, and no-problemo.
I set some parameters and it crashes at second stage.

Makes me think srestore doesnt like some x264 parameters.
This is my preset file: http://www.sendspace.com/file/v2frao

edi=NNEDI2(field=-2)
YADIFMod(Order=1,mode=1, edeint=edi)
SRestore(FRate=23.976)

manono: Im with you, bobber+ 23.976 gives me best results(as preview), but it crashes like in this example. Order is 1, no mistake here. Although I read that when using it with nnedi2, you shouldnt really define it.

Dogway
2nd March 2010, 18:15
maaaan, what stupid. I thought I was using Avisynth 2.5.7 and it actually was 2.5.8. That was messing up my MT. Now I could encode TGMC with srestore, no problem, so just forget about my last post.
I installed v.2.5.7 everything clean and neat, but the encoded video has a message hard coded in many frames saying:

Evaluate: System exception - Acces Violation (<Ļo", line 96) ([ScriptClip], line 1)

Im not sure srestore is the cause, but looks like so.

tested with yadifmod and then this:

global MeGUI_darx = 257
global MeGUI_dary = 200

setmemorymax(768)
SetMTmode(5)
DGDecode_MPEG2Source("almostthere.d2v")
SetMTmode(2)
ColorMatrix(dest=2,hints=false,interlaced=true)

crop(10,0,-18,0)
tempgaussmc_beta2(2,2,3,EdiMode="NNEDI2")
SRestore(FRate=23.976)
Lanczos4Resize(704,height)
trim(10450,10575)

Distributor()

Boulder
3rd March 2010, 06:51
Try this:

global MeGUI_darx = 257
global MeGUI_dary = 200

setmemorymax(768)
SetMTmode(5)
DGDecode_MPEG2Source("almostthere.d2v")
SetMTmode(2)
ColorMatrix(dest=2,hints=false,interlaced=true)

crop(10,0,-18,0)
tempgaussmc_beta2(2,2,3,EdiMode="NNEDI2")
SetMTMode(5)
SRestore(FRate=23.976)
SetMTMode(2)
Lanczos4Resize(704,height)
trim(10450,10575)

Distributor()


Also I'm not sure if you need Distributor. At least encoding with x264 using a command line does not require it..

Dogway
3rd March 2010, 10:37
Yep, thank you guys, stephen "ghost" too. I remember a post talking to deal with srestore in mt (actually previous page), but I will fiddle with that in later episodes. I just want to encode this so badly lol
I use meGUI which Im not sure it needs Distributor, although HEnc seems to need it. I use it just in case.

EDIT: I made another test encode with the full script, and it appeared again in the first frames, so its not SetMode

Boulder
3rd March 2010, 11:58
Adding Distributor "just in case" is very dangerous...

Dogway
3rd March 2010, 14:50
Other experienced users recommended me to use it. I investigated on the meGUI avs script creator, and the help web, and they didnt mention anything about distributor. So lets check if thats the reason now...

Caroliano
3rd March 2010, 15:54
Quickly browsing through the long sample, it mostly looks like "progressive telecine with fieldblending interrupted by duplicates".

Impossible? No, not impossible. It's animation!
If I undertood it correctly, AnimeIVTC(mode=1, blend=true) seems to have an nice trick to counter this:

#Remove duplicates (like a safe selecteven/odd) for further processing before final decimation (hybrid
#decimation (except blend decimation to prevent having 2 calls of tdecimate) or blend telecine IVTC)
#Once bobbed, in mode=1 (tdecimate(1,3,5), in mode=1 + blend = back to 30fps for further deblending,
#in mode=2 srestore will do the job, in mode=3 tdecimate(1,3,5), in mode 4 VFR needs 30, CFR can do it (personal notes)
debprep = chrfix ? mode==1 && blend || mode==4 && omode==2 ? chrdeb.tdecimate(1,1,2) : chrdeb : i
and then it does: debprep.srestore(omode="pp3")

It seems to improve SRestore detection and error correction in my source


BUT I have an problem.

SRestore is artfacting on me in places that even tfm() works perfectly:

animeivtc(mode=1) on the left, animeivtc(mode=1, blend=true) on the right. Simple srestore(omode="pp3").Decimate() also produces the same artfacts.

http://img641.imageshack.us/img641/9505/animeivtcsimples.th.png (http://img641.imageshack.us/my.php?image=animeivtcsimples.png)http://img717.imageshack.us/img717/5143/srestorefudendo.th.png (http://img717.imageshack.us/my.php?image=srestorefudendo.png)

http://img695.imageshack.us/img695/5482/animeivtc.th.png (http://img695.imageshack.us/my.php?image=animeivtc.png)http://img203.imageshack.us/img203/9558/srestoredestroando.th.png (http://img203.imageshack.us/my.php?image=srestoredestroando.png)

But if I use Spline64resize(720, 240).SRestore(omode="pp3").Decimate().Spline64resize(720, 480) I have plain blends instead of those artfacts. Is SRestore suposed to produce such artfacts? IF yes, how can I detect them to fall back to standard IVTC?

I already managed to detect the combed frames that SRestore outputs with IsCombedTIVTC(), and if I dodge this type of artfact, then I will have an almost perfect output. I noticed that there is an increase in brightness or contrast on the affected areas. But I don't know how use masktools or something like that to generate an boolean value for conditionalfilter().

An sample specific of this problem: http://www.mediafire.com/?4jzzm5jjtod
Further samples not so adequated for this specific issue in this thread: http://forum.doom9.org/showthread.php?t=153095

GMJCZP
15th April 2010, 02:16
Hello,

I'm getting an old problem rearing it's ugly head again.
"I don't know what d32 means".
It is difficult to work out why this is written across the video sometimes and not others. If it appears I simply abort virtualdub and save the file again and it will be fine. This means that I can never use fast recompress mode as I need to see the video!

Any thoughts most welcome...


Hello everyone:

When by chance I tried the option with AnimeIVTC chrfix = true I got exactly the same error that Floatingshed. I'm using version 2.7e SRestore, compared it with the version 2.65 (yes I work, well, the error message I don't see) and I see this line in 2.7e:

d43 = jmp ? d32 : d_v
global d32 = jmp ? d21 : d_v

At 2.65 it looks:

global d43 = jmp ? d32 : d_v
global d32 = jmp ? d21 : d_v

Missing global statement before d43 in 2.7e.

I'm not familiar with this language, but perhaps there is achieved a solution. Greetings.

Gavino
15th April 2010, 09:09
Missing global statement before d43 in 2.7e.
d43 does not need to be global, as its value (unlike d32, etc) does not need to be retained between successive calls to 'srestore_inside'.

The logic of the function should ensure d32 is set the first time it is called (jmp will be false), so I can't see why the "don't know what d32 means" error should occur.

Gavino
15th April 2010, 13:22
When by chance I tried the option with AnimeIVTC chrfix = true I got exactly the same error that Floatingshed.
Looking at the source of AnimeIVTC (which uses SRestore), I see that when chrfix=true, it calls a function chroma_rep - this function writes to a global variable 'lfr' inside a ScriptClip call. Now, SRestore also uses a global variable lfr for its own purposes, controlling the correct initialisation of variables like d32.

I suspect the "I don't know what d32 means" error is a result of interference between the two functions using the lfr global. If I'm right, the fix is to use a different (and unique) variable name in AnimeIVTC's chroma_rep function. (Has anyone come across this error when not using AnimeIVTC?)

Note that (as I warned here) problems with SRestore can occur if you have a global variable in your script (or in a function called by your script) with any of the following names:
dm, om, bom, thr, frfac, numr, denm, mec, det, bclp, dclp, fin, lfr, offs, ldet, lpos.

Boulder
15th April 2010, 17:01
Are those global variables one reason why SRestore shouldn't be used when multithreading the script (that is, you should use SetMTMode(5) before the call) ?

Dogway
15th April 2010, 17:07
I havent had any issues using SetMTMode(2) with srestore so far.

Floatingshed
15th April 2010, 22:51
I get the d32 error with the very simplest of scripts. Something like:

avisource("...etc")
tdeint(mode=1, order=1)
Srestore(frate=25)

Gavino
15th April 2010, 23:05
@Floatingshed

Which version of SRestore are you using?
Are you using vanilla Avisynth (no MT)?

Floatingshed
16th April 2010, 02:41
@Floatingshed

Which version of SRestore are you using?
Are you using vanilla Avisynth (no MT)?


Yes, vanilla avisynth 257.

I have tried SRestore 2.7c & 2.7e.
2.7c gives me "I don't know what d32 means" (can't remember which line it points to at the moment.)

2.7e gives me "I don't know what bp2 means" ([scriptclip] line 46)

I hope we can resolve this, SRestore does a superb job, when I can get it to work! Thanks.

Gavino
16th April 2010, 11:02
2.7c gives me "I don't know what d32 means" (can't remember which line it points to at the moment.)
2.7e gives me "I don't know what bp2 means" ([scriptclip] line 46)
That's puzzling. In 2.7e, the scriptclip part only has one line.
However, bp2 does occur on line 46 of 2.7c's scriptclip section, so maybe you got these the wrong way round?

This is quite a strange problem, so every bit of information helps in tracking it down.
Can you say (for each SRestore version):
- does the error message appear on every frame, or only certain frames?
- have you tried with Avisynth 2.58?

BTW In case anyone is wondering, I am not the author of SRestore and I don't even use it myself, but I have a technical interest in its implementation after fixing the memory leak in version 2.7c.

Boulder
16th April 2010, 17:59
Is there any way to fix this kind of video automatically (i.e. without trimming the video into different parts treated differently)?

http://www.mediafire.com/download.php?xnmnwqonj1g

The beginning can be repaired using SRestore(speed=-1) but the outdoor shots leave some blending behind. Or is the source just FUBAR regarding the outdoor shots? I recall the second season was shot using different equipment so I'll need to check that out too. I'd very much like to get both seasons on my Popcorn Hour with better video quality than the DVD can offer.

Floatingshed
17th April 2010, 00:35
That's puzzling. In 2.7e, the scriptclip part only has one line.
However, bp2 does occur on line 46 of 2.7c's scriptclip section, so maybe you got these the wrong way round?

This is quite a strange problem, so every bit of information helps in tracking it down.
Can you say (for each SRestore version):
- does the error message appear on every frame, or only certain frames?
- have you tried with Avisynth 2.58?

BTW In case anyone is wondering, I am not the author of SRestore and I don't even use it myself, but I have a technical interest in its implementation after fixing the memory leak in version 2.7c.

Hello again, It is possible that I got it the wrong way around. I am away from home and working mostly from memory. I get home this weekend so will let you have concrete info then.
I haven't used avisynth 2.58, I've always had a strict policy with software, if it works for me don't risk upgrading! I'll try it though.
As regards the error message it appears on every frame.
Thanks for your continuing help.

18fps
17th April 2010, 10:42
Can you say (for each SRestore version):
- does the error message appear on every frame, or only certain frames?
- have you tried with Avisynth 2.58?


I've seen this error mainly when in AvsP I'm trying filters and I uncomment srestore and press F5 to refresh. Then the message appears for every frame. But usually I don't care, because when processing the script with virtualdub the error doesn't appears anymore. So I had assumed it had to do with unsequencial access in the timeline.

Floatingshed
18th April 2010, 12:12
OK. bp2 error occurs with version 2.7c, d32 error is with version 2.7e, so yes I got confused there!
The error message is always burned-in to every frame.
I tried Avisynth 2.58 and got cavisynth stream errors! I now recall that I tried 2.58 once before and found it very unstable.
I should point out that these problems occur on more than one machine.
Any further help much appreciated...
Thanks.

Boulder
18th April 2010, 13:05
What are the contents of your Avisynth plugins folder?

Floatingshed
19th April 2010, 01:23
What are the contents of your Avisynth plugins folder?


It would be tedious to list. Do you have a suspect in mind?

Boulder
19th April 2010, 03:30
You can output the contents by using MS-DOS prompt and typing dir "c:\program files\avisynth 2.5\plugins" > list.txt . Replace the path inside the quotes with your Avisynth plugins folder if needed. The output of the dir command can then be found in the list.txt file which is created in the directory where you ran the command.

I don't have any specific suspect in mind, but the problem you described is often caused by a single plugin. One thing to try is to empty your plugins folder and put in there only the files that you need to run the script.

EDIT: Also, what is your OS and what is the name of your Masktools v2.0 dll?

Sub-zero
21st April 2010, 14:00
Hi, I have a problem with a blended anime source.
It is 24fps telecined to 30fps. However after a applied IVTC on the source (simple tfm()+tdecimate()) i noticed too much residual combing. I invistigated more with a script like this:

DGDecode_Mpeg2source("kaichou01.d2v", cpu=0)
tfm()
tdecimate()
Separatefields()
Levels(85, 0.092, 219, 0, 255)

I used Levels instead of histogram(mode="luma") because the blends were easier to investigate this way, after all I still a newbie.
I'm not very sure about these blends, they are strange, they are blends, yet not very visible, I noticed them by chance.

I took a sequence of frames and tried to find a pattern for blends, I succeeded in a pattern like this: (each char stands for a field, c=clear, b=blend, note that this pattern defining was post-ivtc, and the first field is top field)
c c b b c c b c
this pattern repeated for more than 5 cycles (ccbbccbc ccbbccbc ccbbccbc ccbbccbc ... etc )

I tried Srestore(omode=3,speed=-26) but the result wasn't very satisfying for me. so i thought of applying the filter on top fields and bottom fields separately with something like this:
a=Separatefields().SelectEven().Srestore(omode=3,speed=-26)
b=Separatefields().Selectodd().Srestore(omode=3,speed=-26)
interleave(a,b)
forgetting that Srestore's vars are global, which caused the script to fail.
here is a link to 4 seconds from the source: http://www.mediafire.com/?mumdiy3tujz
I'm a complete newb at IVTC, so guide me if i'm doing it wrong. Thanks.

Episodio1
26th April 2010, 16:29
Hi!

I'm new to AviSynth. I have to use it now cause I got this movie DVD: ntsc 29.97fps interlaced with ghosting. DVD cover even shows "remastered from HD" xD

I dont know if I have to use only "Srestore" or more filters. What filters should I need to use?

Sample: http://www.sendspace.com/file/gexrro (12 Mb)

Or here: http://www.megaupload.com/?d=B2U23NPS


Thank you.

manono
27th April 2010, 01:21
Hi, I have a problem with a blended anime source.
It's not blended, at least the sample you provided isn't blended.
However after a applied IVTC on the source (simple tfm()+tdecimate()) i noticed too much residual combing.
I noticed no residual combing in the sample provided. If something's wrong, you'll have to provide a sample that demonstrates it.

manono
27th April 2010, 01:37
I have to use it now cause I got this movie DVD: ntsc 29.97fps interlaced with ghosting.
You should be using AviSynth anyway, with easy or difficult sources. The blending in the beginning is intentional. Your DVD isn't blended and just needs a standard IVTC (Decomb, TIVTC, whatever).

Episodio1
27th April 2010, 02:14
MANONO, thanks. I meant with "I have to use it now" that "I have to tweak it manually for 1st time" :) :)

Sub-zero
29th April 2010, 00:23
It's not blended, at least the sample you provided isn't blended.

I noticed no residual combing in the sample provided. If something's wrong, you'll have to provide a sample that demonstrates it.

Levels(85, 0.092, 219, 0, 255)

http://img441.imageshack.us/img441/5683/cleanfield02.th.png (http://img441.imageshack.us/i/cleanfield02.png/)
http://img3.imageshack.us/img3/3655/blendedfield02.th.png (http://img3.imageshack.us/i/blendedfield02.png/)

http://img63.imageshack.us/img63/2439/cleanfield.th.png (http://img63.imageshack.us/i/cleanfield.png/)
http://img90.imageshack.us/img90/3429/blendedfield.th.png (http://img90.imageshack.us/i/blendedfield.png/)

http://img171.imageshack.us/img171/2489/blendedfieldframe.th.png (http://img171.imageshack.us/i/blendedfieldframe.png/)
http://img140.imageshack.us/img140/5179/blend01.th.png (http://img140.imageshack.us/i/blend01.png/)

or i shouldn't care about such minor (not visible until you look for them) artifacts?

manono
29th April 2010, 10:26
And what's the point of wrecking the luma levels to see something that's unnoticeable otherwise?
or i shouldn't care about such minor (not visible until you look for them) artifacts?
Yes, I think what you're doing is a complete waste of time. If it were I, I'd focus my energies on something else, like removing that annoying logo. Maybe others think differently about what you 'discovered'.

MOmonster
29th April 2010, 11:47
@Sub-zero
I can also see no blending on my display. There is no function that would detect this. Imho it makes no sense try to remove this, because it's not visible. It's caused by a temporal filter that let gleam the last frame a little bit. Srestore is no option here.
The residual combing is also hardly visible. But when it's really that annoying for you, you can use for example yadif(mode=1).blendbob()
instead of tfm.

lapinot
2nd May 2010, 22:47
Hi.

Some will say I didn't probably try hard enough, and you can throw me the rotten tomatoes if the sample I propose is a piece of cake for you guys, but I spent some time trying in vain to get a proper output of this :
http://demo.ovh.net/fr/ca197199e611e028467cfe7aa1beee13/


this is probably the same story as Shaw Bros dvd, ntsc stuff transcoded from Pal masters (4 clean frames + 5th/6th blended), except it seems much more tough to make it work

I started with the usual
tdeint(mode=1)
srestore()
which usually was enough for sd sources

doesn't work at all (choppy/ghosting)
then read in doc (at last :cool: ) srestore required negative speeds with hd sources

so I went for srestore(speed=-x) #seems less catastrophic between -2 & -5
although far from any kind of decency. I played with threshold without valuable results either

then I tried yadif(mode=1) -worse- , then tfm+changefps(60000,1001), which gave me something a bit less crappy than deinterlacers but yet very far from being proper

I played a bit with blockx/blocky too within tfm in case hd required different values, didn't find any worthwhile value.

in the end, nothing that looks like a proper ghosting-free pal output,... I'm open to all suggestions that don't require math degrees :)
thanks

Didée
3rd May 2010, 01:57
Just tried this:
AVCSource("F:\Downloads\sample_(lapinot).dga")
crop(0,128,-0,-128,true)
bob(.0,.5) # yadif(mode=1) # ... or whichever bobber that fits your needs ...

x2 = reduceby2().reduceby2() # downsize for analyzing (probably needed)
x1 = spline36resize(1024,440) # downsize for actual output (not needed, it's just to get a result QUICKLY

x1.SRestore(frate=24.975,dclip=x2)
return(last)

and got this: KLICK (http://www.mediafire.com/file/jk2xokmmqvy/SRestoreTest.avi) (MediaFire, 5 MB)


Perhaps it's because I'm more asleep than awake, but ... I don't see a problem?

lapinot
3rd May 2010, 09:34
Just tried this:
AVCSource("F:\Downloads\sample_(lapinot).dga")
crop(0,128,-0,-128,true)
bob(.0,.5) # yadif(mode=1) # ... or whichever bobber that fits your needs ...

x2 = reduceby2().reduceby2() # downsize for analyzing (probably needed)
x1 = spline36resize(1024,440) # downsize for actual output (not needed, it's just to get a result QUICKLY

x1.SRestore(frate=24.975,dclip=x2)
return(last)

and got this: KLICK (http://www.mediafire.com/file/jk2xokmmqvy/SRestoreTest.avi) (MediaFire, 5 MB)


Perhaps it's because I'm more asleep than awake, but ... I don't see a problem?

I don't either :thanks:
didn't think of using the donwsizing for analyzing, seems it helps a lot :cool:

edit : tried same part on the movie with same script, doesn't work at all at home, I guess there's a problem with my install somewhere (upgraded to lucid yesterday, maybe the wine install + avisynth 258 goes berzerk for some reason. )
At least now I know it's a local problem, nothing to do with srestore or even the source...

...oh, and just switched from dgavcdec/avcsource to ffms2/videosource and it works like a treat now. maybe I'll have to reinstall dgavcdec (or just stick with ffmpegsource2)

levi
3rd May 2010, 21:27
Any of you guys able to help recommend some settings for this one?

http://www.mediafire.com/download.php?ej40e0zzjtn

Great Dragon
12th May 2010, 17:44
@live, I believe this:
s=DGDecode_mpeg2source("my2.d2v")
s.yadifmod(mode=1, edeint=s.nnedi2(-2))
srestore(23.976)
will do the job pretty well.

x1.SRestore(frate=24.975,dclip=x2)

I wonder how you determine that such a strange frame rate is right?
Maybe for this (33 MB) (http://a.imagehost.org/download/0963/xmen_sample2_pal_demuxed) kind of video I need custom frame rate too? I've used srestore() default for it and frames rate become 11.988 and still there are some blended frames left. Then I need to blend resulting video to 23.976 to remove some jerkiness on horizontal/vertical panning.
Can you or anyone take a look at it and give some advices?

MOmonster
19th May 2010, 14:31
@Great Dragon
It is not the exact framerate but 11.25fps is close to it. Use this:srestore(frate=11.25,speed=1)
or for example this:
last.srestore(speed=-1,omode=3,mode=-1).blendbob().tdecimate(mode=1,cycle=10)

You can't remove the left blendings. Some parts are just overblended.

Great Dragon
19th May 2010, 17:37
@MOmonster, it kills to much good frames for me.
I've done some more test and found this
srestore(frate=21.976, speed=-25, thresh=12, mode=3)
preserve good frames better especially in intro. There are still blended frames left but not so much.

Here are other samples
xmen_sample3_pal_demuxed.m2v (20 MB) (http://j.imagehost.org/download/0110/xmen_sample3_pal_demuxed) xmen_sample4_pal_demuxed.m2v (9.6 MB) (http://a.imagehost.org/download/0389/xmen_sample4_pal_demuxed)

txporter
8th July 2010, 17:25
There has been some discussion (starting here (http://forum.doom9.org/showthread.php?p=1413769#post1413769)) in the TGMC thread about the proper way to rebuild PAL source from PAL=>NTSC DVDs while still using TGMC for the actual deinterlace. Initially, I had been simply using a TGMC bob'd stream to feed srestore. der_groschi brought it to my attention that this was not proper, so I did a bit of searching and found some threads on exactly this subject. It was suggested to use a detection clip that was not processed through TGMC to pick out the blends.

I am trying to figure out how to determine which bobber to use for the dclip. I have attempted a few difference approaches but still see different frames chosen depending on what I use for the dclip. I have a copy of my source clip + 2 different stacked videos here (http://txporter.tonidoid.com:10001/app/websharepro/share/dclip/) to compare the various methods.

key for dclip:
bob1: bob(0,0.5)
bob3 (suggestion from Didee in another thread, I couldn't get reduceflicker=false to work though): bob1 = o.bob(0,0.5)
bob2 = bob1.clense(reduceflicker=false).merge(bob1,0.5)
bob3 = bob2.mt_adddiff(mt_makediff(bob2,bob2.clense(reduceflicker=false),U=3,V=3),U=3,V=3)
yadif: yadif(mode=1, order=1)
tgmc: no dclip, fed with tgmc bob'd video
bob1.crop: same as bob1 + crop(8,16,-8,-24) [based on Srestore wiki (http://avisynth.org/mediawiki/Srestore#Examples)]
bob3.crop: same as bob3 + crop(8,16,-8,-24)
yadif.crop: same as yadif + crop(8,16,-8,-24)

stack.mp4 = stack of bob1 vs bob3 vs yadif vs tgmc + diffs
stack2.mp4 = stack of various bobs vs bobs+crop + diffs

I have included the frame number on each frame so I can see which frame was chosen by Srestore. You can see that various approaches cause different frames to be chosen. It seems that very dark frames are the most likely to be different from dclip to dclip choice. I believe that the only case where duplicate frames were chosen were in the opening credits where the yadif.cropped dclip chosen frame 73 twice. I don't see any case where a blended frame is left over.

Is this something that should be adjusted using the speed parameter in srestore or does it really not matter over much which frame is chosen as long as blends are gone? One of the arguments against using a tgmc stream for srestore was that it was felt that srestore would not be able to pick out the blends. Based on testing with this clip, it seems like srestore does a good job even with a tgmc stream (but it does take longer).

Didée
8th July 2010, 18:02
[clense]
I couldn't get reduceflicker=false to work though)
This implies that

a) most probably you're using the latest v1.0 release of the RemoveGrain package (Amongst others, Clense works differently in 1.0final than in previous versions. I'm always recomending the pre-1.0 build - the official 1.0 comes with additional modes that no-one uses and that aren't even documented, and in exchange, it breaks functionality of previously-working scripts. As you now have experienced.)

and more importantly

b) if you didn't get that part working, then "my proposed" script is not doing what it's supposed to do (simply removing the reduceflicker parameter does not give you the processing method that I intended to be used), and therefore there is no point in evaluating the end result. You broke the chain.

txporter
10th July 2010, 02:00
This implies that

a) most probably you're using the latest v1.0 release of the RemoveGrain package (Amongst others, Clense works differently in 1.0final than in previous versions. I'm always recomending the pre-1.0 build - the official 1.0 comes with additional modes that no-one uses and that aren't even documented, and in exchange, it breaks functionality of previously-working scripts. As you now have experienced.)

and more importantly

b) if you didn't get that part working, then "my proposed" script is not doing what it's supposed to do (simply removing the reduceflicker parameter does not give you the processing method that I intended to be used), and therefore there is no point in evaluating the end result. You broke the chain.

Yeah, I understand that I broke your chain. ;) Was still attempting what I could get to work to see if it made a difference.

Here is what I did to test out your script with clense(reduceflicker=false). I went to the RemoveGrain wiki (http://avisynth.org/mediawiki/Removegrain) and downloaded the v1.0 pre-release Removegrain plugin (this is the one that I was already using). It comes with 12 plugins: RemoveGrain[S/SSE2/SSE3] + Repair & RSharpen of the same flavors. Using these plugins gives me an error that no function Clense is found. The only thing that I found that didn't give me an error about Clense was a RemoveGrainT package that kassandro posted on another forum (can't find link atm).

I just found an old RemoveGrain.dll from 2005 (pre-release were 2007 builds) that seems to have the Clense function and allows Reduceflicker=false (I think that is the v0.9 build). Will see how that goes.

levi
28th July 2010, 16:12
Looking for recommendations on this one. It seems to be 11-12 fps?

http://www.zshare.net/download/787671864e463c69/

:thanks:

EuropeanMan
21st August 2010, 03:47
HI guys, I'm back...with another problem

yadif - mode 3
srestore - frate 25

applied on my dvd9...worked fine EXCEPT for one scene
here is a demuxed m2v file...the problem starts on frame 200 (to 339) for that SCENE only...the guy running up the stairs...the rest is fine...and ONLY that very small section

the problem i have is that after my encode in megui to avi (XviD), i checked the whole avi...and THIS PARTICULAR scene, i still have ghosting here with him
running up the stairs and am bewildered as to the WHY.

i looked at the untouched VOB in vdub...it seems as if the interlacement pattern is different. how do i tackle JUST this portion to output @ 25fps.

thanks in advance

sample (11MB, no audio): http://www.sendspace.com/file/m78abq

manono
21st August 2010, 07:19
how do i tackle JUST this portion to output @ 25fps.
Same as the rest and put up with the blends. As you said, the guy on the steps was done differently and it has way too many blended fields for anything to be able to unblend it properly.

Chainmax
3rd October 2010, 20:32
I apologize for this newbie question, but being the first time I use SRestore I want to make sure. Would this:

d = last.bob(-0.2,0.6).reduceflicker(strength=1)
Interp = nnedi3()
TDeint(type=1,edeint=Interp,emask=TMM())
SRestore(frate=23.976,omode="pp3",speed=-25,dclip=d)

be a correct call?

EuropeanMan
4th October 2010, 05:32
Interp=nnedi3()
TDeint(type=1edeint=Interp,emask=TMM())


=


Tdeint(type=1,edeint=nnedi3(),emaskTMM())


If you're not calling Interp again, no use setting a useless variable.

Chainmax
5th October 2010, 04:18
Good point, blame it on a brain fart. :o

Great Dragon
14th October 2010, 18:39
Hi guys.
I can't manage to deal with some strange NTSC pattern.
I've tried many different IVTC methods I know and none of them can't give me a good result.
Basically it's because of chroma fields has a different pattern than luma.
I've tried to use this updated Chroma_rep() (http://forum.doom9.org/showpost.php?p=1268074&postcount=367) but it just does nothing for me and I'm getting picture with combing artifacts or just blended frames.
Here is a sample. (http://www.mediafire.com/?fo65hl21mv87d15)
Thanks in advance.

nautilus7
15th October 2010, 23:54
Hi, i'm trying to restore original 25p fps framerate of a BBC documentary. Sample (http://www.mediafire.com/?0mau14anuakoirt) is from blu-ray which is conveterd to 29,97i fps with frame blending. I have tried RePAL and ExBlend as well as Srestore, but all of them leave some combing leftovers in the restored frames. Any kind of help will be welcome.

Didée
16th October 2010, 00:36
An example of the combing leftovers, and also the script you used?

RePAL and SRestore both rely on the bobbed stream you feed them with. (Not sure about ExBlend, haven't tried it yet.) It is impossible that any combing is created by these plugins. If at all, the combing is a result of the bob filter that has been used before.

nautilus7
16th October 2010, 00:51
Maybe i didn't said it with the right term but this is what i get:

DGSource("e01.dgi")
TDeint(mode=1)
Srestore(speed=-25, mode=-2)]

http://thumbnails8.imagebam.com/10234/d50292102333190.jpg (http://www.imagebam.com/image/d50292102333190)

Didée
16th October 2010, 01:06
Ah well, okay. However, that is not combing. It's the source that is already broken.

(No idea if that can be fixed.)

nautilus7
16th October 2010, 15:38
Didee, thanks for your answer, although, it seems that those artifacts aren't present in the source. ExBlend gives me artifacts in other places, different than those using srestore or repal.

DGSource("e01.dgi")
TDeint(mode=0, order=-1)
Exblend(mode=0, pal=1, ithresh=100, show=2)
TDecimate(mode=0, cycleR=1, cycle=6, rate=24.975, hybrid=0)
AssumeFPS(25000, 1000)

http://thumbnails29.imagebam.com/10242/5b8463102418433.jpg (http://www.imagebam.com/image/5b8463102418433)

Didée
16th October 2010, 16:56
Looking at:

DGSource("e01.dgi")
bob()
This simple script does not introduce any artifacts.

(bob-) Frame #10: blended
(bob-) Frame #11: blended
(bob-) Frame #12: blended

3 consecutive blended fields is what I consider "broken". Such should not happen with a "clean" blend-normconversion.

None of the available blend-restaurers is able to clean this up sucessfully.


edit: actually, it's the chroma channels that exhibit the additional blending. Seems someone didn't care for the particularities of interlaced YV12 during (or prior to) the conversion process.

See for yourself:

bob()
reduceby2()
stackvertical(last,last.greyscale())

Frames 11+12 of this script show the same frame (a dup from the conversion), but both frames show blended chroma. In effect, there is no clean chroma channel available for this frame.

It is likely that this problem is present throughout the complete source.

Welcome in the world of High Definition, where you can watch decade-old artifacts in unseen clarity! :D :(

nautilus7
17th October 2010, 00:36
I see. So, the source is messed up. Thanks for looking into it.

Monkeylord
20th October 2010, 14:17
I'm having a hell of a time with my PAL [Adult Swim] DVD's, in particular Metalocalypse and the Aqua Teen Hunger Force movie. Both of which end up as incredibly blurry messes when I try and use AnimeIVTC on them.

Wonder if anyone in this thread could give advice.

I'll post a sample once I'm home from work (can anyone recommend a file hosting site?), but in the mean time if anyone's dealt with these before, tips would be appreciated.

Usedocne
20th October 2010, 17:14
File hosting site, try: mediafire.com

Monkeylord
20th October 2010, 17:24
File hosting site, try: mediafire.com

Ta.

I'll be home in a couple of hours and will try to get a sample up ASAP. 10-15secs worth is the norm, right?

Usedocne
20th October 2010, 17:30
Ta.

I'll be home in a couple of hours and will try to get a sample up ASAP. 10-15secs worth is the norm, right?

About rite, yeah. Try to find a scene w/ motion though.

Monkeylord
20th October 2010, 20:46
As promised, here's the samples. Would've been upped sooner, but I had to work late :(

ATHF (15secs)
http://www.mediafire.com/?beubhcv1gcfrd5i

Metalocalypse (25secs)
http://www.mediafire.com/?355rzjbo2bo9ejz

Sorry about the lengths, but I wanted to get a reasonable range of motion.

Usedocne
20th October 2010, 22:28
Had a quick look at your sources, seems that there field-blended, as is a lot of PAL stuff. Just so you know, I don't think you can undo all of the damage done from the NTSC>PAL conversion.

Here's all I could come up with:
interp=nnedi3(-2)
yadifmod(order=-1, mode=1, edeint=interp)
srestore(frate=23.976)
Maybe someone a bit more in the know could do better?

Monkeylord
21st October 2010, 00:17
I appreciate the help. It's certainly a damn sight better than what I've managed to achieve so far.

txporter
22nd October 2010, 21:33
Had a quick look at your sources, seems that there field-blended, as is a lot of PAL stuff. Just so you know, I don't think you can undo all of the damage done from the NTSC>PAL conversion.

Here's all I could come up with:
interp=nnedi3(-2)
yadifmod(order=-1, mode=1, edeint=interp)
srestore(frate=23.976)
Maybe someone a bit more in the know could do better?

I haven't looked at the clip (host sites blocked at work), but was this originally PAL material? You should srestore back to 25fps if that is the case.

I use something like this to unblend PAL material that has been converted to 29.97fps NTSC.
o = MPEG2Source("source.d2v")
y = o.yadif(mode=1,order=1)
qtgmc = o.QTGMC(Preset="Ultra Fast",rep2=4,SLmode=1,SLrad=1)
qtgmc.Srestore(frate=25,dclip=y)

Monkeylord
23rd October 2010, 00:19
I haven't looked at the clip (host sites blocked at work), but was this originally PAL material? You should srestore back to 25fps if that is the case.

I use something like this to unblend PAL material that has been converted to 29.97fps NTSC.
o = MPEG2Source("source.d2v")
y = o.yadif(mode=1,order=1)
qtgmc = o.QTGMC(Preset="Ultra Fast",rep2=4,SLmode=1,SLrad=1)
qtgmc.Srestore(frate=25,dclip=y)

Nope. Both NTSC originals converted to PAL... by all accounts, badly :(

txporter
23rd October 2010, 00:23
Ok. You should be able to use the script that I linked above, but change the frate on Srestore back to 23.976 like Usedocne had. You might like the results of QTGMC a little better than nnedi3/yadifmod as the bob flicker is eliminated.

dansrfe
23rd October 2010, 00:34
So, just to make sure I'm clear on what's happening: yadif is bobbing, QTGMC is interpolating and srestore is droping frames etc to "restore it" based on the frate and pattern detected?

txporter
23rd October 2010, 02:52
correct

Usedocne
23rd October 2010, 07:33
I already tried QTMC(w/ yadifmod+srestore) when I first looked @ ML's vids, but the writing on the fire extinguisher in ATHF looked messed up, and put me off recommending it.

txporter's script looks a bit different than mine though, so maybe that doesn't happen w/ his?

Monkeylord
25th October 2010, 00:19
Ok. You should be able to use the script that I linked above, but change the frate on Srestore back to 23.976 like Usedocne had. You might like the results of QTGMC a little better than nnedi3/yadifmod as the bob flicker is eliminated.

This showed even more improvement. Thanks. There's still a lot of blended frames, but unless you're some kind of superhuman they're barely noticible during playback.

Thanks again!

Usedocne
25th October 2010, 01:20
Monkeylord

I think txporter's suggestion is about as good as you'll likely get. So you can probably move on to your next step now, whatever that may be.

DoctorM
8th November 2010, 06:34
I've run into an interesting issue and I'd like to pick your brains. My source has fair to moderate quantities of compression artifacts. I did tests with both Srestore (with Yadifmod and NNEDI2) and Restore24.

I found that Restore24's internal deinterlacing is somewhat soft in its results. Yadifmod and NNEDI2 produced a much sharper picture. It seems because of the better deinterlacers, more of the original compression artifacts remained and caused SRestore to select more blended frames than Restore24.

Testing Srestore with original Yadif, a faster/softer deinterlacer, clean frame selection was more accurate.
It would appear that a heavily scrubbed source video allows Srestore to be more accurate.

Has anyone else come across this?
I was wondering if there is a way to get SRestore (or even Restore24), to use a strongly filtered source clip as a guide to select which fields to use, but then pull the actual fields from a clip that uses a better deinterlacer and less filtering.

Didée
8th November 2010, 09:01
The inbuild bob-deinterlacer of Restore24 is one big quirk.

For SRestore, there is the "dclip" parameter to feed a separate analysis clip:

a = source.sharpbob
b = source.softbob
a.Srestore(dclip=b)

Could be that Restore24 had a similar option, but .... seriously, I don't remember. :)

dansrfe
8th November 2010, 09:27
so as per above something like:

a = source.qtgmc([bob-double framerate])
b = source.yadif(mode=1, order=1)
a.srestore(dclip=b)

?

Also what parameters should I put in qtgmc for a field-blended PAL -> NTSC type of source to double the framerate for successful pass on to srestore?

DoctorM
8th November 2010, 19:39
The inbuild bob-deinterlacer of Restore24 is one big quirk.

For SRestore, there is the "dclip" parameter to feed a separate analysis clip:

a = source.sharpbob
b = source.softbob
a.Srestore(dclip=b)

Could be that Restore24 had a similar option, but .... seriously, I don't remember. :)

Ooh, sounds good, I'll definitely give that a go.

egrimisu
25th November 2010, 10:06
Back to chrfix.
Can chrfix called externally from srestore or within srestore?
ex animeivtc(mode=2).srestore(chrfix option if available) i checked the srestore function but found nothing
animeivtc(mode2=2).chrfix function()



WRONG THREAD, ADMIN, PLEASE MOVE THIS TO THE ANIMEIVTC THREAD. THANKS IN ADVANCE

Boulder
27th December 2010, 17:29
Regarding the "speed" parameter: how does it affect blended frame detection? That is, if I want to do an exhaustive search for blend artifacts in each frame, I have to use speed=-1. What are the cons of using it?

EuropeanMan
3rd February 2011, 14:02
Quick question.

I have progressive content. However, the pattern seems to be 4P2B...B for BLENDS. not interlaced. seems as there would be ONE clean frame from those 2. would srestore be the right function or should be looking at something like cdeblend/unblend filters? it's been ages since i've seen this sort of content. let's say you see a person walking. in the last 2 frames, you would see the same guy twice, just a few millimeters apart in outline edges...same for the next frame...then to start the next 6 frame cycle, it's just one person again for 4 frames...etc etc.

here's an example...
http://i56.tinypic.com/bis5dk.jpg

manono
3rd February 2011, 14:36
However, the pattern seems to be 4P2B...B for BLENDS. not interlaced.
SRestore doesn't handle that kind, although I don't see any reason it couldn't be modified for it. StainlessS's ExBlend is supposed to be able to do it, but I haven't had much luck. I must be doing something wrong.
The filter will also deal with similarly blended 25 FPS to 30 FPS video in which case
the blending would be as below:-

A B C D E # 25 FPS Source (5 blocks of 5 frames = 25 FPS)

A B cb cd D E # Blended to 30 FPS (5 blocks of 6 frames = 30 FPS)
http://forum.doom9.org/showthread.php?t=157337

Didée
3rd February 2011, 14:42
For those I still use FixBlendIVTC+TDecimate, usually with decent results.

Boulder
3rd February 2011, 14:48
While you pros hang around here, can either of you help with this one: http://www.mediafire.com/download.php?myohy405zyg ? I've not been able to get a clean result, probably because there's two different cycles depending on whether it's an outdoor or indoor shot. In bobbed stream, outdoor repeats CBCD and indoor CBCBC (C for clean, B for blend and D for duplicate of previous frame). It's a long project of mine to get that series cleaned :)

manono
3rd February 2011, 14:54
For those I still use FixBlendIVTC+TDecimate, usually with decent results.
Quoting from the FixBlendIVTC function itself:

## FixBlendIVTC is a blend replacing / frame restoring function for doubleblends, caused by blenddeinterlacing
## of telecined sources.

But something like what EuropeanMan has wasn't telecined, at least not in the usually accepted manner, and is PAL2NTSC followed by a blend deinterlace resulting in the 4/2 pattern he described, rather than the 3/2 pattern for which FixBlendIVTC (and SRestore) work well. Did you modify it somehow to work with deinterlaced PAL2NTSC stuff?

manono
3rd February 2011, 15:14
In bobbed stream, outdoor repeats CBCD and indoor CBCBC (C for clean, B for blend and D for duplicate of previous frame).
I don't quite see that pattern for the outdoor shot, but that car's so far in the distance it's hard to tell. The only real problem I found with the sample is that I had to set the field order or else AviSynth got it wrong and the unblending screwed up. This seemed to work OK for me:

Yadif(Mode=1,Order=1)
SRestore()

But maybe a better outdoor shot might be useful.

Didée
3rd February 2011, 15:24
Well, what I understood is that the pattern is - 4 clean - 2 blends - 4 clean - 2 blends - etc, with one clean progressive frame "hidden" in the 2 blends? Perhaps I misunderstood?
Coincidentially, this very pattern I've seen just a few days back, in some Indian movie samples. FixBlendIVTC worked quite OK there.

manono
3rd February 2011, 15:48
Well, what I understood is that the pattern is - 4 clean - 2 blends - 4 clean - 2 blends - etc, with one clean progressive frame "hidden" in the 2 blends? Perhaps I misunderstood?
No, you didn't misunderstand. Originally it would have been 4 clean/2 interlaced, but after the blend deinterlace it results in 4 clean/2 blended. I remember trying it a while back and it seems to work on a 5-frame cycle, and left behind a whole lot of blends. I ran it twice and it worked somewhat. Maybe I should dig out my DVD with a whole movie like that and try again.

Boulder
3rd February 2011, 17:06
I don't quite see that pattern for the outdoor shot, but that car's so far in the distance it's hard to tell. The only real problem I found with the sample is that I had to set the field order or else AviSynth got it wrong and the unblending screwed up. This seemed to work OK for me:

Yadif(Mode=1,Order=1)
SRestore()

But maybe a better outdoor shot might be useful.

How about this one?

http://www.mediafire.com/?6qotze4u2v4l21o

I did try that earlier on, but there's quite a bit of jerky motion in the output. It is possible that the outdoor car scene is actually the same footage that was used for the first season.

I found out via Wikipedia that the second season was shot on 16 mm film, if that is of any help.

manono
3rd February 2011, 17:28
I see now. The new outdoor scene was shot on video and converted to PAL. Try this:

Yadif(Mode=1,Order=1)
SRestore(Frate=29.97)

So, you have problems. What's the output format? DVD? Can you make an NTSC DVD, or does it have to be PAL? If for PAL DVD you can prepare the different parts separately using trims, reinterlacing the 29.97fps stuff to interlaced 25fps.

Boulder
3rd February 2011, 19:39
My output format is MPEG-4 AVC (encode with x264) so it doesn't matter which framerate I output. So you expect that I should be able to use 29.97fps throughout the whole material? At some point I thought that I would have to go the VFR route which can be a pain since there's 19 episodes to process :(

manono
3rd February 2011, 20:55
Well, VFR is one possibility. I don't guess you can mix progressive and interlaced the way you can with DVD, so I don't know what to suggest as I don't know much about x264. It seems a shame to turn the 23.976fps parts into 29.97fps, either by hard telecining or by adding duplicate frames. Sorry, but I'm not much help there.

EuropeanMan
3rd February 2011, 21:46
Well, what I understood is that the pattern is - 4 clean - 2 blends - 4 clean - 2 blends - etc, with one clean progressive frame "hidden" in the 2 blends? Perhaps I misunderstood?
Coincidentially, this very pattern I've seen just a few days back, in some Indian movie samples. FixBlendIVTC worked quite OK there.

Was there a link/thread to those samples on this forum? Thanks again. I'd like to follow that thread and see what I can do.

Apparently FBIVTC/Tdecimate still resulted in residual blends here & there...

And from what I remember...perhaps I'm wrong (again Lol). 4/2 would go to 23.976, no? Or is always 25? Because 3p2i goes to 23.976...and 5i1p is 25...I'm so confused

Didée
3rd February 2011, 22:27
3p2i is the result of field pulldown from 24p to 30i.

4p2i is the result of field pulldown from 25p to 30i.

1p5i is the result of field pulldown from 25i to 30i.


<source sample (http://www.mediafire.com/?kdaqdfsktx7otmr)> -- <Script (http://www.mediafire.com/?6g6aw5vtga3i81g)> -- <result (http://www.mediafire.com/?e2pgwj4a1n72n8c)>


BTW, you can easily make your own test footage. Take some 25p material, and do

AssumeFPS(25000,1001)
bob()
ChangeFPS(60000,1001)
AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()

# Now perform the "BlendIVTC":
blur(0,1)

Et voilā - there's your test footage with which you can try the cleaning process.

(To make the scenario even more realistic, perform a poor-quality mpeg2-encoding of the script. The poorer the mpeg, the more realistic the scenario.) :D

Gser
3rd February 2011, 23:59
You know you've been here too long when you start laughing at all of Didee's jokes. :D

EuropeanMan
4th February 2011, 00:06
3p2i is the result of field pulldown from 24p to 30i.

4p2i is the result of field pulldown from 25p to 30i.

1p5i is the result of field pulldown from 25i to 30i.


<source sample (http://www.mediafire.com/?kdaqdfsktx7otmr)> -- <Script (http://www.mediafire.com/?6g6aw5vtga3i81g)> -- <result (http://www.mediafire.com/?e2pgwj4a1n72n8c)>


BTW, you can easily make your own test footage. Take some 25p material, and do

AssumeFPS(25000,1001)
bob()
ChangeFPS(60000,1001)
AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()

# Now perform the "BlendIVTC":
blur(0,1)

Et voilā - there's your test footage with which you can try the cleaning process.

(To make the scenario even more realistic, perform a poor-quality mpeg2-encoding of the script. The poorer the mpeg, the more realistic the scenario.) :D

Didee...thanks boss!

Next ? - IF film is shot @ 24fps, then why would the REAL SOURCE be 25fps for the above 2 examples you gave for pulldowns?

EuropeanMan
4th February 2011, 02:26
Didee...I ran your script on the sample you have provided. There are still blends left in the output. I didn't change anything at all. I will then assume this is the 'best' that can be done with this particular source? Will wait to hear from you tomorrow...thanks again.

Boulder
4th February 2011, 04:34
Well, VFR is one possibility. I don't guess you can mix progressive and interlaced the way you can with DVD, so I don't know what to suggest as I don't know much about x264. It seems a shame to turn the 23.976fps parts into 29.97fps, either by hard telecining or by adding duplicate frames. Sorry, but I'm not much help there.I could always bob the whole stream and encode as progressive. In fact, that's what is recommended if the source is interlaced.

Didée
4th February 2011, 17:16
IF film is shot @ 24fps, then why would the REAL SOURCE be 25fps for the above 2 examples you gave for pulldowns?
It's an Indian movie. India is PAL country with 50Hz electricity. Therefore it's no surprise if their movies start out being 25p.


I ran your script on the sample you have provided. There are still blends left in the output. I didn't change anything at all. I will then assume this is the 'best' that can be done with this particular source?
That's to be expected. When blend-removal is involved, better don't do [too much of] single-frame examination. There will always be errors and misses ... simply because real-world scenarios usually don't strictly follow the theoretical models on which the deblending-scripts are based on. Theory is clean, practice usually is polluted with all kinds of additional oddities.

The top question is whether the result is sufficiently free of judder during playback. If playback is "smooth", then it's OK. The occasional blending here and there should be accepted.

For the perfection nerds, there's always the possibility to put several days/weeks/months into manual single-frame-editing of such a mistreated source. Do so if you've no better use for your time. :p

EuropeanMan
4th February 2011, 21:38
I could have sworn up and down and sideways that all film was shot @ 24fps irrespective of geography :( Thanks for your help...much appreciated.

Mark Regalo
4th February 2011, 21:50
Yeah, I thought it was this way as well.

Didée
4th February 2011, 22:00
Depends on the camera with which it's shot. But in PAL countries, speedup is as common as telecine is in NTSC regions. You can't broadcast 24p on TV (traditionally, from pre-HDTV era), only 25p/50i. Same for DVD releases, which obviously are 50Hz based in PAL regions. Playing a 24p movie on a 50Hz analog TV is not funny, but true horror.

Hence, the question is not so much whether the material originally was shot at 24 or 25 fps. For what is relevant here (i.e. this thread), the only important thing is: how many unique pictures-per-second have there been before the blending-process did its work. And if it's a Bollywood movie, you can be pretty sure that it's 25fps.

EuropeanMan
4th February 2011, 22:33
Would it make sense then to get back to 25fps for said sources, then keep going to 24fps? Just to get BACK the original?

manono
5th February 2011, 01:58
I could have sworn up and down and sideways that all film was shot @ 24fps irrespective of geography.
It is. Film, as shown in a movie theater, runs at 24fps. (actually it usually runs at 48fps, with each frame duplicated). The problem with Indian films on NTSC DVD is that a 25fps master was prepared first, perhaps for broadcast, maybe for PAL DVD. And rather than prepare a new NTSC master for NTSC DVD (which costs money), they run the 25fps PAL master through a cheap standards conversion box which just ruins it.

This is also the reason why maybe 99% of Indian classic films are fieldblended on NTSC DVD - the original 15-20 year old 25fps PAL VHS tape (or even worse, the 25fps PAL VCD) was used as a source.

This isn't to say that there aren't progressive 25fps cameras out there, just that the Indian film with that ugly 4/2 pattern you described started out life as 24fps before being speeded up to 25fps, that 25fps master being used as the source for that ugly DVD of yours.

EuropeanMan
5th February 2011, 07:07
I hate Bollywood...simple.

Didée
5th February 2011, 11:13
The funniest thing is when you run across a PAL version which was blendconverted from a NTSC version. :rolleyes:

EuropeanMan
9th February 2011, 04:36
Please help!!!

http://www.sendspace.com/file/7s9z85
Sample above

I've done anything I can using yadif & srestore to all sorts of framerates..and still I get the blends!!! 25, 23.976, 24
What more can I do?

Didee master & others...PLEEEEEEEEEEASE. Thanks :)

manono
9th February 2011, 08:55
Get a different version. Mine only needed an IVTC, but I don't know who made it now. Here's a review with pics:

http://memsaabstory.wordpress.com/2008/05/16/jheel-ke-us-paar-1973/

And here's a song:

http://www.youtube.com/watch?v=f1GaH0ycAuc

I can probably find out from memsaab who made her DVD if you like. Or you can ask her yourself in the comments section.

To answer your question, though, it's 24.975/25fps and there's no way it can be properly unblended. Just count the percentage of blended fields. It looks doubly blended to me, NTSC2PAL followed by PAL2NTSC.

EuropeanMan
9th February 2011, 14:58
Well, I had already done the lag for restoration @ 25fps and will just work with that. Thanks Manono...i'm sure you know these DVDs don't come cheap. We didn't even have this movie in our area stores...I had to special order this movie from India...and this is what I got. Just have to deal with it :(

I'm hoping Didee will have an opportunity to check this thread out as well and give his input...

(just glad I didn't delete my lag files!)


Hmmm...wait a second. Mine is progressive blended material now...wouldn't his script above now take care of the blends I have left over???

Didée
9th February 2011, 15:41
Store that movie in a safe place.

Six feet under should be safe enough.

EuropeanMan
9th February 2011, 16:54
^ THAT is the answer I was waiting for :) LOL heheheheh

I love you man! YOU are great!

bin_ch
22nd March 2011, 12:10
Hi,
http://www.mediafire.com/?7qbjsg4ccaq8ecx (~10MB, 10 seconds)

I see a pattern of 3 clean 2 blended, so probably telecined material blend-deinterlaced.
I used srestore(frate=23.976) but had no luck, maybe I did something wrong.

Any suggestions? Thanks.

Didée
22nd March 2011, 12:33
To have Srestore doing double-blend removal, you need to specify something for "omode".

Though, I've tried it a few times in the past ... and everytime I reverted back to FixBlendIVTC. Dunno if that mode is half-broken in Srestore, or if I did something wrong (quite possible). In any case, FixBlendIVTC does exactly what it's supposed to do.

manono
22nd March 2011, 13:20
I don't know. While I like FixBlendIVTC also, this seems to work OK on the sample after it locks on after the first few frames:

SRestore(omode="pp3")
TDecimate()

bin_ch
23rd March 2011, 13:05
Thanks manono and Didée, both FixBlendIVTC and SRestore with omode work fine.

DoctorM
23rd March 2011, 20:01
Does SRestore actually deblend frames like FixBlendIVTC? I thought it just discarded blends.

dragon_warrior
26th March 2011, 10:44
Hi, I need some help from you guys to restore this video

10-sec sample: http://www.multiupload.com/AR1CXA39BH

It was shot at 24p, then mastered to 25i before framerate converted again to 29.97i to be fit on the NTSC DVD. For it is BFF interlaced, I decided to give it a try with QTGMC, so this is the script I used

assumefps(30000/1000)
AssumeBFF().QTGMC( Preset="Slow")
Srestore(24)

Is there anything wrong with it? Thanks

DoctorM
26th March 2011, 20:48
Hi, I need some help from you guys to restore this video

10-sec sample: http://www.multiupload.com/AR1CXA39BH

It was shot at 24p, then mastered to 25i before framerate converted again to 29.97i to be fit on the NTSC DVD. For it is BFF interlaced, I decided to give it a try with QTGMC, so this is the script I used



Is there anything wrong with it? Thanks
Any reason to believe they used speed up from 24p to 25i?

Edit: Assuming there IS speed up, I get best results with this --
yadif(mode=1) #or favorite smartbobber
restorefps(50,-1) #-1 is true for this clip. 1 may be needed for the full video
srestore(frate=25)
assumefps(23.976) #I guessing there was speed up, but the audio might have been pitch corrected.

Anyone else?

kws53
26th March 2011, 21:15
Folks,

I'm recoding Madonna Sticky and Sweet Blu-Ray. From dga feed to avs with Yadif bobber thorugh VDmod, after careful analysis [rope jumping segment] I get the following field sequence indicating double blending:

F838 - EDIT ? ? ? ? AAB AAB B BC C CCD CDD D
F850 - E E E E F F G GH H H I I
F862 - J J JK K KKL KKL L LM M MMN MNN N
F874 - O O OP P PPQ PPQ Q Q R RRS RSS S
F886 - T T TU U UUV UUV V VW W WWX WXX X
F898 - Y Y YYZ YZZ ZZa ZZa a ab b b bcc ccd
F910 - d d dde dee eef eef f fg g g ghh hhi
F922 - i i iij ijj jjk jjk k kl l llm lmm m
F934 - n n no o oop oop p pq q qqr qrr r
F946 - s s st t ttu ttu u u v v w wwx
F958 - x x xy y yyz yyz EDIT ? ? ? ?

So 5 new frames in each 12 field segment except for Set5/6 with an overlap and hidden frame. What is the recommended treatment?

The problem includes a different start point at each edit.

Cheers,
Kurt

manono
27th March 2011, 02:05
Any reason to believe they used speed up from 24p to 25i?

Anyone else?
I saw no evidence it had been first converted to PAL before then converting it back to NTSC. It looks to me like it was field-blended from film directly to 29.97fps.

dragon_warrior
27th March 2011, 02:06
Any reason to believe they used speed up from 24p to 25i?


I got it from an encoder at mv-detox. He said most of Alexandra Burke's video were shot at 24p -> 25i -> 29.97i, the rest were 25p -> 25i -> 29.97i.
It is his encodes that make me believe him :)

manono
27th March 2011, 02:08
What is the recommended treatment?

None of what you wrote meant anything to me. Maybe it does to others. When asking for help the usual procedure is to post a short 10 second sample, not pictures, not a description.

dragon_warrior
27th March 2011, 02:35
I saw no evidence it had been first converted to PAL before then converting it back to NTSC. It looks to me like it was field-blended from film directly to 29.97fps.

Assuming what you said is correct, is this the right way to restore it
assumefps(30000/1000)
AssumeBFF().QTGMC( Preset="Slow")
Srestore(24)

Thanks

manono
27th March 2011, 03:20
Assuming what you said is correct, is this the right way to restore it
Sure, that's one way, although I don't quite understand the AssumeFPS(30000,1000) line as you'll then have to stretch the audio. I think I'd do it more simply:

QTGMC( Preset="Slow")#if you want to use QTGMC on it
Srestore(FRate=23.976)

Up to you, though. Maybe you have your reasons for changing the framerate a little bit.

DoctorM
27th March 2011, 04:52
As I said before, not knowing if there was any speed up or pitch correction of the audio, I stand by what I said before:
yadif(mode=1) #or favorite smartbobber (QTGMC isn't a bad idea)
restorefps(50,-1) #-1 is true for this clip. 1 may be needed for the full video
srestore(frate=25)
Although I've dropped the final assumefps line here. If the pitch is correct for any reason, be happy with 25p and add pulldown flags to 29.97.

Try it and see how you like the output.

kws53
31st March 2011, 14:56
None of what you wrote meant anything to me. Maybe it does to others. When asking for help the usual procedure is to post a short 10 second sample, not pictures, not a description.

Apologize for that - here is an link to the segment posted.
http://www.mediafire.com/file/g72m5tk4xekd9r4/madonna.demuxed.264

Cheers,
Kurt

Didée
31st March 2011, 15:52
Interesting. Can't remember to have seen a BR source f**ed-up like that.

What is the recommended treatment?
Return the disc and claim your money back. Point out that the content gives proof of ridiculous technical incompetence.

kws53
31st March 2011, 23:36
Interesting. Can't remember to have seen a BR source f**ed-up like that.

Return the disc and claim your money back. Point out that the content gives proof of ridiculous technical incompetence.

After bobbing [YADIF TFF]. it looks to me like it follows a repeatable [after the first 5 or so frames] sequence of 12 frames like this:

AAAA AAAA AABB BBBB BBBC BBBC CCCC CCDD DDDD DDDE DEEE EEEE [5 fields]

and then 2 middle sequences like:

AAAA AAAA AAAB ABBB BBBC BBBC CCCC CCDD DDDD DDDD DEEE EEEF [5 plus part of 6th field]

Wouldn't this indicate that we started at 25 [24.976]? And perhaps went through 24 on our way to 30? Any suggestions? Besides complaining to the purveyor of the disk, that is...

Kurt

Vector13
3rd May 2011, 03:22
Hello everyone

I have looked through this thread the passed few days to try and find the best sollution to remove some ghosting from a clip. It was hard to figure out for me because i am new to this but i did my best anyway.

I became the best result with:

yadif(mode=1,order=1)
srestore()
TDecimate()

But i still get some additional "ghosting" or "dirty... things" in some frames. Some nasty leftovers from the previous frame in the next frame... I don't know how to call it. You can download a sample + script here: http://www62.zippyshare.com/v/57018655/file.html . I'm quite sure the source is bad ntsc => pal conversion as i read here a lot.

Is there any way i can get completely rid of the ghosting and/or the "dirty things" in the frames? Can anyone help me suggest anything? Thx in advance!

manono
3rd May 2011, 03:48
I'm also seeing leftover blending and other 'dirty stuff'. I'm not sure you can entirely get rid of it. One thing though. By default SRestore gives you 23.976fps (for PAL sources) or 25fps (for NTSC sources). You don't need the 'TDecimate' at the end, and it will cause the framerate to become 19.181fps, which you don't want. Leave off that line.

And welcome to the forum!

Vector13
3rd May 2011, 12:30
Thx for the welcome manono.

I put TDecimate() in at the end because i felt it removed more ghosting, but i didn't know it would affect framerate. Thx for that.

I'm hopeing there is something that can remove the blend leftovers and "dirty stuff", else this will have to do it i think.

Overdrive80
20th July 2011, 00:06
Hi, somebody help me with dvd source of this topic http://forum.doom9.org/showthread.php?t=161968

Thanks

egrimisu
24th August 2011, 07:36
hey guys,
i have a r2 japan anime dvd that have some blends i i try to remove it with srestore, ivtc was made with qtgmc because it has a more stable image than animeivtc.
how do i use srestore for deblend and bring the framerate back to 23.976? the script that i used and kept the framerate to 59.94 was:

qtgmc("fast")
srestore(frate=23.976,omode="pp3")

also in the srestore manuale dmode is not explained, what does dmode do?

Thanks.

manono
24th August 2011, 08:28
You bring it back to 23.976fps if the 'base' framerate really is 23.976fps. The field blended Japanese DVDs I've seen were made from PAL masters and the framerate was 24.975/25fps. You have to figure out the 'real' framerate first, before deciding what framerate to set SRestore for. You use SRestore's omode only if you have deinterlaced hard telecine, and not field blending. If you see interlacing, you don't want to use the omode.

For more advice a sample would be useful.

egrimisu
24th August 2011, 08:58
hi manono,
here is the sample http://www.megaupload.com/?d=CCB5L7J0

manono
24th August 2011, 09:20
You don't want to use omode with that one. I can't figure out what the framerate's supposed to be as there's not enough frames with movement every frame. I suppose you could make it 23.976fps, but to be sure you'd have to find a few seconds where every frame is unique and not a duplicate. Much of the sample is 8 or 12fps.

Oh, and I don't think you can unblend it completely as there are just too many blended fields.

FlimsyFeet
24th August 2011, 11:37
Hi,
Regarding this sample (http://www.sendspace.com/file/erjt15) I posted preiously in this thread (http://forum.doom9.org/showthread.php?t=161991), I found that
Bob()
Srestore()
was reasonably successful in restoring progressive 23.976fps, but if you have any recommendations for a different bob filter or tweaking the srestore parameters to get improved results I'd be interested to hear them.

EuropeanMan
29th August 2011, 09:48
i'm at wit's end with this source :(
here is a sample: http://www.sendspace.com/file/8pr90h

tried to restore to 23.976/25. with 23.976 i get tons of dupe frames, with 25 i get a dupe frame almost every 6/7 frames or so...
basic yadiff/srestore.

what else can you folks suggest? thanks in advance.

manono
29th August 2011, 10:23
It's definitely supposed to be 23.976fps. This works reasonably well:

Yadif(Mode=1)#or your favorite bobber
CDeblend()
BlendBob()
TDecimate(Mode=0,Cycle=15,CycleR=3)

Didée
29th August 2011, 11:07
Just tried a basic "bob(0,0.5).Srestore(frate=23.976,speed=-1)", and the result seems okay to me. I don't get anything like "tons of dup frames", the result is mostly smooth.

EuropeanMan
29th August 2011, 19:52
^ Didee, I had used yad/mod3 + sres/fr23 which gave me more dupes than sres/fr25...

Thanks manono...will check it out. Also will have to read on what speed=-1 would accomplish in the above setting.

edit: detail function for speed. thanks Didee :)

EuropeanMan
29th August 2011, 20:11
Ran both of the offered suggestions...thanks for that. I find that Didee's solution works better, especially where scene changes occur. However, manono's is QUITE fast, encoding wise :) Ran a lag w/ both against 2,001 frames and D's came out with one extra frame (1601 v 1600). OFF the top of your heads, 'why' could/did this happen? Would it be due to the bobbers used? or...

EuropeanMan
30th August 2011, 02:00
Off the top of my head, could something like this ALSO work?

tdeint(mode=1)
srestore()
tdecimate()
assumefps(23.976)

manono
30th August 2011, 02:49
Off the top of my head, could something like this ALSO work?
No. Your script after the third line gives you 20fps, and then you speeded it up to 23.976fps. The result will be a jerky video that plays much too fast. Not to mention the out-of-synch audio.

When using standard SRestore, even with Speed=-1 added, I was getting duplicate frames and missing frames about 11 seconds in with the two men in the scene. That's why I suggested what I did, something that sometimes works when the field-blending is in an unusual pattern.

The one extra frame isn't anything to be concerned over. Even for the entire movie, at most there will be a single frame difference in the final framecount, nothing to worry about.

kws53
1st September 2011, 16:38
I have the Jimi Hendrix Live at Monterey documentary. And like virtually all documentaries that use old video or TV footage, I have a blend of scenes with telecined material and other scenes with simple interlaced.

For example after bobbing with Yadif, the historical scenes will be the AABBBCCDDD scenario of telecining and the new interivews will be ABCD.

Is there some "easy" way of handling this? Or do I need to do a scene by scene conversion?

Thanks in advance.

Kurt

StainlessS
23rd September 2011, 01:16
FixBlendIVTC_v091a.avs supplied in R_Pack (18/11/2009) is broken:-

http://forum.doom9.org/showthread.php?t=95924

Seems that it has been left in editing/testing mode, does not work and leaves a metric
on the clip. v0.9b in the wiki works fine.

http://avisynth.org/mediawiki/FixBlendIVTC

EDIT: the problem is in lines 135,36
ScriptClip(source, " source.subtitle(string(rvc0)) ")
#ScriptClip(source, " counter==0 ? final : counter==1 ? source.trim(1,0) : source ")
Commenting out the first line and uncommenting the second will fix the problem.

cobo
12th November 2011, 20:10
Is there a way to set srestore or adapt it so that it recognizes and replaces blends that use a unique frame - that is where one of the frames making up the blended frame is neither the previous or next? That's where it seems to be failing for me no matter what settings I try.

Zep
17th December 2011, 23:53
Normally I just throw srestore or FixBlendIVTC at this stuff and it works well with defaults but not this time. It appears the video is 1p5i/b. All i have ever seen before is 3p2i/b and 4p2i/b. Could some else please try their hand at it? I made a clip of three different areas of the video that clearly show the crappy blends.

here is the link. it is a 11 megabyte file.

http://www.fileserve.com/file/s8yjuBD/blended.avi



thanks :)


.

Didée
18th December 2011, 00:26
That's a 25p->30p normconversion in convertFPS()-style. Use RestoreFPS (http://avisynth.org/mediawiki/RestoreFPS) for this. Also, see here (http://forum.doom9.org/showthread.php?p=1534977#post1534977).

Zep
18th December 2011, 19:49
That's a 25p->30p normconversion in convertFPS()-style. Use RestoreFPS (http://avisynth.org/mediawiki/RestoreFPS) for this. Also, see here (http://forum.doom9.org/showthread.php?p=1534977#post1534977).

really I always thought the 4p2i/b was 25p FPS. This 1p5i/b didn't come from 25i? interesting...

Really really sad at how bad they convert stuff.

Anyway, thanks I will check it out.

Didée
18th December 2011, 20:05
The pattern is 1 clean, 5 blends, aso. The stretch is +20%, i.e. 5 input frames have become 6 output frames. 25*1.2 = 30.

Take some random 25p source, apply "ConvertFPS(30)", and compare the result to this source here. You'll see it's the very same pattern.


Just because it's HD/BluRay it isn't necessarily good quality. Over time, I've seen numerous documentations on BD that just have been blend-normconverted.
Embarrassing? Yes, embarrassing.

Zep
18th December 2011, 20:35
The pattern is 1 clean, 5 blends, aso. The stretch is +20%, i.e. 5 input frames have become 6 output frames. 25*1.2 = 30.

Take some random 25p source, apply "ConvertFPS(30)", and compare the result to this source here. You'll see it's the very same pattern.


Just because it's HD/BluRay it isn't necessarily good quality. Over time, I've seen numerous documentations on BD that just have been blend-normconverted.
Embarrassing? Yes, embarrassing.


It is as if they do it on purpose it is so bad.

Anyway the hard part here is gonna be locking the phase down since it am getting drift. Too bad restroreFPS doesn't have a parm for that. i.e. an amount to gradually shift by the time you get to the last frame. it appears i will need .68 at start, about .74 in the middle and about .80 near the end.


again thanks

looney
30th March 2012, 04:23
I try to make 50.000->23.976fps conversion. If i left sRestore defaults (in fact explicitly say frate=23.976, mode=6) everything works perfectly.
But when I try to use post-processing omodes weirdness begun:
a) "pp0" : if i use Trim() on a clip it doesnt start at actual let say 9000th frame as it did when omode is omitted
b) "pp1" : nags for RemoveGrain.dll (which is required) i had v.0.9 (http://home.pages.at/kassandro/RemoveGrain/RemoveGrain.zip) which doesnt have required mode=19, so i replace it with v.1.0 prerelease (http://home.arcor.de/kassandro/prerelease/RemoveGrain-1.0.rar). After that nags stop. But as i don't know which of RemoveGrain is required i start to renaming them but they still loads?
Later I tried different approach, by removing all RG.dlls and adding and removing one-by-one into plugins starting with SSE3 to the plain one and all behaves same as bad just plain and SSE introduces more luma highlight artifacts in some parts of frame. Plus motion shimmering is unavoidable.
c) "pp1"/"pp3" ("pp2" i didn't test) gave me some weird shimmering artifacts, or even nice chroma removal

Q: How to know which RemoveGrain is used or sRestore always uses plain nonSSE version?
A: sRestore w/ RemoveGrain call uses whatever RemoveGrain.dll it finds in plugins. But i still question how it prioritize them when you have them all into plugins

I use K10 processor, so is it maybe some of RemoveGrainSSEx.dlls broken for them?

Why when omode="pp0" is enabled Avisynth Trim() function doesn't work properly?

Jawed
30th March 2012, 09:37
For the sake of your sanity I recommend processing this clip in two passes:

1. srestore and nothing else
2. everything else

You can create an ultra-high quality x264 encode setting for the intermediate encoding. Just create an x264 profile with --qp 0 or --qp 1. Truthfully you would hardly see the difference if you used --qp 10, but I don't want to start an argument on that subject. Basically you want to use a fast encode setting here, you're not too worried about the file size.

Then use this intermediate encoding as the input for your second script. You should use FFMS2:

http://code.google.com/p/ffmpegsource/

to load the high quality srestored clip into the avisynth script for the 2nd pass.

This is what I normally do for srestore. It saves a lot of grief.

Didée
30th March 2012, 09:58
Also, note that pp=[undefined] and pp="something" will cause two completely different processing chains. The former does (single) blend removal including framerate change. This is the "NTSC<>PAL normconversion" mode. As soon as pp is used, Srestore switches to "double blend removal" mode with no framerate change, for undoing blended telecine. (Which needs to be followed by an additional decimator, for that purpose.)

Srestore is not "throw clip at it and see what happens". Srestore is "you need to know what you are doing".

looney
1st April 2012, 09:57
Srestore is not "throw clip at it and see what happens". Srestore is "you need to know what you are doing".

I hoped for second but not in those words :grin: But in fact it seems that i unconsciously followed them myself.

You're right i still cannot differentiate real meaning between one blend and double blend but that's probably for some deeper research (with all the links i should learn). But still what is double blend and when it occurs in practice?

So as far as i could get if I use pp0-pp3 omodes then i suppose to use mode 1-5, and not default mode 6 which is used video decimation?


For the sake of your sanity I recommend processing this clip in two passes:
1. sRestore and nothing else
2. everything else

Thx it's appreciated. But the bad thing is that in fact i don't use nothing else, well except my favorite fft3dgpu, but even with it disabled i get same chroma artifacts/shimmering.

If you refer to AviSynth builtin Trim() i thought that shouldn't collide with anything because after all it's on source.output and it's just there so i could test behave of sRestore (SR) on particular part of video clip but seems that ain't possible when SR is bothered with.

At least I learnt that fft3dgpu should be down the chain after SR if i want to avoid random implanting of subliminal frames taken from same video being processed :D Which i believe is side effect of non-linear frameserving to SR which is pretty sensitive to it (not even max cache=10 option doesn't help). So with that filtering order everything works flawlessly. Only artifact i have are from original stream, which resembles to some weird memory/buffering issues original stream had. ntm, I've resolved the same thing some few years back but i simply forget it.

With mentioning .mkv intermediate file you raised an issue bothering me and was thinking about lately for quite some time. Well, in fact in my mind there's an obstacle when i need to create large raw x264 file which afterwards needs to be muxed into .mkv stream for further processing and that requires secondary hdd to get reasonably sane muxing time of large raw stream. And that impose additional obstacle for hobbyist use like myself in this case. So some x264_cli build (which i still seek) which could directly mux raw x264 stream into .mkv during x264 encoding would be of much help So it could be avoided time-hardware consuming job that should be done afterwards.

I'd rather use lossless x264 mode than lossless huffyuv (which require avi multiple containers) if encoding+muxing could be done at the same time but i didn't found anywhere that this is possible and how. I believe you when you said that -qp 10 shouldn't show any difference from -qp 0, especially with 10bit encoder, but i'd rather use lossless x264 which is still quite computing expensive as i read about. And another bug. I shouldn't use 10bit but 8bit because i dont know how to open it for further editing later (i use ffdshow).

I'm using ffms2 (http://code.google.com/p/ffmpegsource/) (FFVS tbe) to open my huffy_intermediate.avis (though i'm well aware how old-school that is :D) as it's way more memory friendly than AviSynth's DDS. But could it open raw x264 also when you mentioning it?

I've problem comprehend all the features ffms2 gives to me thru FFVS thou i read ffms2 readme file (ffms2-avisynth.html) quite few times but don't recollect noticing any point out how to open raw stream with FFVS. Although I think I did read, few weeks back, a warning for inexperienced users somewhere that opening .mkv thru FFVS should be done only as a last resort because something is broken. So for that reason i still use DDS. I read it again and in Video support there still no mention of any raw file support nor how to open it. (I'm still using obsolete 2.16 version even thou i downloaded 2.17 more than month ago). I know that libav is contemporary holy grail for video encoding and decoding.

But to avoid further confusion: How to open raw x264 thru ffms2-avisynth? Because answer is eluding me.

And that intermediate encodes should be 8bit? Because ffdshow that i used to open x264/mkv files still doesn't support 10bit encodes? (I know i still use obsolete r3984 official but i dont like to upgrade to newer just to find that it has some major bug that affect decoding i'm using it for)

dragon_warrior
16th May 2012, 15:32
Hi there, anyone can help me with this clip : http://www.mediafire.com/?0qc3gvbat45tai6
The video was originally shot at 24p but it was then converted to 25i, plus some horrible blends. Could someone tell me how to figure out the suitable settings for srestore from the pattern? Thanks

wonkey_monkey
18th May 2012, 23:28
I've just used srestore for the first time on a 60i blu-ray that was converted from 25p, and wow - it's an almost perfect restoration without even tweaking any parameters. All I'd like to know is... how the heck does it work?! :D I had a look at the .avsi but I can't make head or tail of it...

David

Didée
19th May 2012, 01:39
All I'd like to know is... how the heck does it work?!
1) Identify the (bob) frames that are blends of prev+next
2) Replace the blended bob frames with a duplicate of one neighbor
3) Decimate

That simple.:)

The next question is about 1) - how to figure that a frame is a blend of its neighbors? This brings up ...
I had a look at the .avsi but I can't make head or tail of it...
Since the time of making Restore24, I have an idea and a few how such identification can be done. But I have no idea how Momonster did it in Srestore. The code is ... well, it's hard to follow, to say the least. A dozen of nameless 2-letter-variables, and miles and miles of and-and-or-or-or-and-or- logic-juggling and compairing with arbitrary thresholds. You want to reverse engineer? Me not.

It works, and that's about it. :)

wonkey_monkey
19th May 2012, 21:23
1) Identify the (bob) frames that are blends of prev+next

The next question is about 1) - how to figure that a frame is a blend of its neighbors?

I guess as a start, if a frame is a duplicate, it's pixel values will be partway between the values of its two neighbours, and that will be a constant ratio across the whole frame... so far my experiments aren't going so well though :)

David

wonkey_monkey
19th May 2012, 21:27
Hi there, anyone can help me with this clip : http://www.mediafire.com/?0qc3gvbat45tai6
The video was originally shot at 24p but it was then converted to 25i, plus some horrible blends. Could someone tell me how to figure out the suitable settings for srestore from the pattern? Thanks

That sample was fixed pretty well for me just by


bob
srestore


But use a better bobber :)

David

dragon_warrior
26th May 2012, 10:32
That sample was fixed pretty well for me just by


bob
srestore


But use a better bobber :)

David

Yeah, thanks!

Elvellon
1st June 2012, 08:54
I need to restore a PAL > NTSC field-blend, but the PAL was progressive since there are 5 motion phases in 12 fields.
(6 clean and 6 blended fields, c c b c b c b b c b c b)
Should I use a smart bobber or just Bob(0,1).SRestore()?
Thanks in advance!

EuropeanMan
22nd June 2012, 05:01
i've tried tvitc, m/srestore, tdeint...and for some reason, i don't think i'm deinterlacing this source "properly"...i still get either skipped frames, or blends still remaining...

now trying clense/knockout/tdeint (nnedi)/restore...will see what happens. what do you folks suggest, because i'm quite quite certain this goes to 25fps. thank you in advance!

http://www.sendspace.com/file/fwgd6u

EuropeanMan
22nd June 2012, 05:05
(well, with what i was trying above lastly...i get better scene changes; still 2 blends in first 5 frames, but clean the rest of the way)

atra dies
22nd June 2012, 05:48
LoadCPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\yadif.dll")

yadif(mode=1,order=0)
srestore(speed=-5)

This is what I used on a ntsc to pal field blend. You have to bob and get the field order right. On this one I was getting repeats so I checked the bob and there was motion judder so I changed the field order and all was well. The field order is the order parameter in yadif, so set it to 1 for top field first and check for smooth motion. For srestore I set speed to negative for better quality.

I am using the masktools for dither and it worked. Of course you need srestore.avsi too.

manono
22nd June 2012, 11:14
I get decent results with a simple:

Yadif(Mode=1)
SRestore(Frate=24.975)

What trouble are you having, EuropeanMan bhai? :)

EuropeanMan
23rd June 2012, 07:48
^ we'll find out in about 21 hours (left on my encode)...my problems were mainly stagnant blends here & there... :( will send you my script once i find success. additionally, manono BHAI :), i don't settle for DECENT...you should know this about me by now! hehehe. i want to make sure it's the best that i can do with all of your folks' help! lastly, why is it that i NEVER think of 24,975?!!!

@ atra - ty...will look into that once this encode finishes & fails :)

martin53
28th October 2013, 21:46
Updated v2.7e from AviSynth wiki to v2.7f, to allow multiple calls from the same script, especially to compare optimum parameter settings.
For the script design to allow that, see this thread (http://forum.doom9.org/showthread.php?p=1650250#post1650250).

EDIT Nov. 12, 2013: updated to v.27g which has a one line ScriptClip() call again. Initiated by Gavino's post that every line of a ScriptClip() string is re-evaluated for each frame and all identifiers fill the AviSynth heap space up until script crashes, if clip does not end before.
Tested by comparison of two johnmeyer clips v2.7e against v2.7g (settings: frate=23.976, omode=1). All >1200 frames processed same.

ChiDragon
8th December 2013, 21:22
Can someone add 2.7g from the post above to the Wiki (http://avisynth.nl/index.php/Srestore)? I would do it myself but I can't figure out how to become an Autoconfirmed User.

Reel.Deel
8th December 2013, 21:46
Can someone add 2.7g from the post above to the Wiki (http://avisynth.nl/index.php/Srestore)?.
Done. (Srestore page needs a makeover :/)

ChiDragon
9th December 2013, 00:16
Thank ya!

martin53
9th December 2013, 07:41
Done. (Srestore page needs a makeover :/)
Thank you from my side too - the Wiki didn't allow me to upload it at first, then I didn't find the time.

Cyn you point out please about the makeover? More than updating the version text? Aside from being multi-callable form the same script now, 2.7g should behave same as 2.7e

Boulder
9th December 2013, 08:09
After these changes, is it safe to use multithreading with SRestore?

Reel.Deel
9th December 2013, 15:07
Thank you from my side too - the Wiki didn't allow me to upload it at first, then I didn't find the time.

Cyn you point out please about the makeover? More than updating the version text? Aside from being multi-callable form the same script now, 2.7g should behave same as 2.7e

Regarding the "makeover" I simply just want to reformat the wiki page to something less cluttered. Something like this (http://avisynth.nl/index.php/BlindDeHalo3) or this (http://avisynth.nl/index.php/TComb).
I would like to add a changelog and add additional links (from d9) where Srestore has been successfully used in other ways not mentioned in the documentation. Along with other small things.

Anyways, thanks for the Srestore updates. :)

martin53
10th December 2013, 19:20
After these changes, is it safe to use multithreading with SRestore?
No more or less than before. I changed 'just' two things.

- GScriptClip(local=true) secludes all RTE from other RTE scripts. This is the first condition to be able to run multiple RTE scripts without mutual interference. However as a consequence, all local RTE script variables are now forgotten after a frame is processed.

- When the script graph is made, an individual instance counter is created in advance of inserting an instance of the RTE script into the graph. Then the script string gets a string replace treatment, so instance-specific scripts are made. All variables which are needed longer than the lifetime of one frame must be global variables, and they all have an instance-specific suffix. This is the second condition to have two or more instances work independently.

real.finder
23rd March 2014, 17:26
srestore v2.7h

update to use new Average http://github.com/AviSynth/Average

to make omode="pp1" work

pastebin (http://pastebin.com/sQw9CrMi) and attachment

Motenai Yoda
18th April 2014, 18:02
update to use new Average http://github.com/AviSynth/Average

https://github.com/tp7/Average/releases

btw on my setup (2.6 Set's MT) with more than 2 threads doesn't work well on vertical pan...
either 2.7 or 2.7g or 2.7h

Neilho777
2nd May 2014, 23:41
great thanks need to restore some videos !

Oline 61
23rd May 2014, 09:24
srestore v2.7h

update to use new Average http://github.com/AviSynth/Average

to make omode="pp1" work

pastebin (http://pastebin.com/sQw9CrMi) and attachment

Does this work for anyone?
Average refuses to load with error 0x7e for me.
Using SEt's 2.6 MT.

StainlessS
23rd May 2014, 11:40
Run this against Average.dll to see what it is dependant upon (probably C++ runtime).
http://www.dependencywalker.com/

MS usually supplies it with Visual Studio.

Oline 61
23rd May 2014, 19:38
Thanks StainlessS. I needed msvcr110.dll and msvcp110.dll. Everything is working now.

StainlessS
27th June 2014, 10:11
It should be noted that the script function StrReplace() used in srestore v2.7g is bugged under Avisynth v2.58 and v2.6Alpha3
(alpha4 and alpha5 OK).
There is a fixed script version (link below), fixed script uses RT_Stats RT_StrAddStr() function which fixes the string concatenation bug,
or better still use RT_Stats RT_StrReplace() which does not create any temporary (and un-freed) strings during string replacement.
You can just replace the 'StrReplace' function call with 'RT_StrReplace' in SRestore_27g.avsi, and delete the script version of StrReplace.

It is OK to use the Script version StrReplace on short strings, but anything approaching 4KB string length should avoid usage.

http://forum.doom9.org/showthread.php?p=1596053 (http://forum.doom9.org/showthread.php?p=1596053&highlight=strreplace#post1596053)

There are a number of other scripts using StrReplace, with the same problems.

EDIT: Also affects srestore v2.7h as in post #668 by Real.Finder.

EDIT: Martin53, uses RT_StrReplace() in his thread "Runtime variables scope and lifetime" but unfortunately
used StrReplace script function in the SRestore script:- http://forum.doom9.org/showthread.php?p=1650202#post1650202

EDIT: Thread:- Concatenation failure on 4096 byte boundries, http://forum.doom9.org/showthread.php?t=164212

wea00
8th July 2014, 22:58
Hi, I have some questions regarding srestore. I'm using a basic script like this:

MPEG2Source("VTS_01_1.d2v")
o=GetParity()?1:0
LeakKernelBob(o,4,true,true)
Crop(6,98,-6,-94)
srestore(dclip=last.Crop(4,4,-4,-4))

Is the positioning of Crop in this script correct?

When starting from a source running at 25fps srestore outputs 23.976fps. My feeling tells me that the original should not be NTSC but 24fps film. I realize I can set the desired framerate using the frate parameter, but is there a simple test I can perform to find out whether the true original framerate was 23.976fps or 24fps?

I don't understand the description of the speed parameter. What is the value to use for the highest output quality? Is it 25/-25? Or 1/-1? What is the real difference between positive and negative values?

I am also confused about what bobber to use? In general it seems that QTGMC is considered to be one of the highest quality bobbers available and I saw a few people in this thread talking about using it with srestore. On the other hand I have seen a statement by Didée that motion compensated filters are bad for this task. What's the deal here?

Continuing from the previous question: If I use QTGMC, what settings should I use? (I'm not asking about the general quality settings. Mostly I am interested in what to use for SourceMatch and Lossless.) If not, what would be a recommendation for a very high quality bobber to use?

When using a computationally expensive bobber it seems to be recommended to set up a separate detection clip. What to use as the basis for that? Plain old stupid bob? Or something that's a bit smarter but still reasonably fast?

foxyshadis
8th July 2014, 23:46
I'm assuming you have a source that's field-blended to hell and back. If you think about how smart bobbing works, it's obvious why it's a waste of time with field-blending: neighboring fields can't be matched up to each other, except near the end of the cycle when the fields are near-100%. Even the exact same object from two fields away will look different and be difficult to match and even more difficult to merge in, not to mention changing the blending and therefore wrecking the blend detection and smoothness of deblending.

If you're out for maximum quality, a dumb but high quality bobber like NNEDI3 is a decent choice, or a fairly smooth smart bobber like TDeint with edeint set to NNEDI3 and thresholds set conservatively.

Now, QTGMC does a fair amount of denoising as well, making it look a bit better, but it'd be better yet to run SMDegrain on it yourself after removing the blending.

manono
8th July 2014, 23:50
realize I can set the desired framerate using the frate parameter, but is there a simple test I can perform to find out whether the true original framerate was 23.976fps or 24fps?
No. About all I do is make it the default 23.976fps and only if I get too many blends in the output will I try 24fps to see if the result is any better.
If I use QTGMC, what settings should I use?
I usually just use everything at default unless, for some reason, I want it to go faster in which case I might change to a faster preset. I also like that it does some denoising by default and will sometimes even increase the denoising as many of my sources are noisy VHS tapes. Others will do things differently and I have no interest in the sourcematch and lossless settings. I'd even go further and say if you have a field-blended source there's no point in using those settings anyway as the DVD is already a disaster needing a whole lot of work. It's almost always okay to use QTGMC as the bobber. Otherwise you might try YadifMod with NNEDI3, something like:

YadifMod(mode=1, order=1, edeint=NNEDI3(field=-2))

hello_hello
8th October 2014, 02:04
I've only recently started playing around with srestore and it certainly seems like an effective script, but I have a couple of issues with artefacts. I'm just wanting to know if this sort of thing is normal. I'm trying to un-blend some film which was de-interlaced rather than ITVC'd (I assume). I'm using the following in a script.

srestore(mode=-4,omode="pp3")
tdecimate(cycleR=1)

99.99% of it looks pretty good. There's the odd blend which isn't undone (usually around a scene change) but that's not the end of the world. Every so often though, I notice artefacts. Mostly where there's fast motion. The artefacts in the first pic are easily reproducible each time. Most of the frame is nice and clean (the pic is only of around a quarter of the frame) but where there's fast movement you can see the artefacts.

http://s7.postimg.org/6e2w2t2nf/image.jpg

The second pic shows four frames in a row. That sort of problem is easily repeatable where there's a similar fade-in.
http://s15.postimg.org/z6ls21cx7/fade_in.jpg

Every so often I've seen an artefact, but after repeating the encode it's not happened a second time, but mostly if it's occurred once, it occurs if I encode the video again. I've tried different versions of all the plugins srestore requires, and I've tried srestore versions 2.7e, 2.7g and 2.7h, and the results are pretty much the same each time, so I figure the occasional artefact is just a necessary evil. Still I thought I'd ask, in case I'm missing something. Thanks....

DoctorM
8th October 2014, 02:49
@hello_hello- What you're trying to repair doesn't sound like something srestore is meant to handle.
If your source was really deinterlaced by removing comb artifacts, I'm not aware of much you can do. The original fields and frames are probably beyond restoration.

If, on the other hand, it was deinterlaced by blending fields, which it sounds like might be the case, try FixBlendIVTC(). http://avisynth.nl/index.php/FixBlendIVTC

hello_hello
8th October 2014, 04:12
DoctorM,
Thanks for the reply. I've tried FixBlendIVTC() and it produces pretty much the same result as I get from strestore, only it's much slower for some reason. Unfortunately though, it also produces the same artefacts on occasion.

Maybe I didn't describe it well, but if I open the video in question (29.970fps progressive) and step through the frames where there's motion (someone moving across the screen while the camera remains still makes it easy to see) there's a definite 3/2 pattern. Three "clean" frames, then two frames which appear to have frame blending. I live in PAL-land so NTSC isn't something I work with a lot, but I'd assumed it means the video was originally film with pulldown, but instead of the pulldown being removed it was de-interlaced. After adding srestore to a script like this:
srestore(mode=-4,omode="pp3")
I end up with one in five frames repeated which I then remove with tdecimate(cycleR=1) and the output is 23.976fps.

Mostly it looks pretty good. Motion is fairly smooth. There seems to be the odd frame on a scene change which isn't unblended and a very occasional "skip" in movement, which looks like a missing frame, but I guess it can't be perfect. On the whole though, it looks pretty good. If I'm doing any of that wrong, please let me know. It's the artefacts I'm still trying to fix, although I'm thinking they're just a necessary evil, so to speak.

hello_hello
8th October 2014, 04:48
What exactly is the definition of "double-blend-removal"? I ask because using srestore's double blend removal seems to give me the result I want, but I can't quite get my head around why it's called 'double blend".

While I'm thinking about it, there's an example of srestore usage on the srestore page here (http://avisynth.nl/index.php/Srestore).

srestore(dmode=-4,omode="pp0")
decimate(cycle=5,quality=0) #recommed decimating

Am I missing something or is "dmode' a typo? I think it should be mode=-4.
And recommend has a missing "n". :)

hello_hello
8th October 2014, 06:13
I'm still playing around a little, but it would appear when srestore does something odd to a frame, it's a frame which didn't need restoring. For example, here's a section of three frames in a row from the original video, then the same again with srestore(mode=-4,omode="pp3") in the script.

As you can see, the first frame of the original is a "blended" frame, while the next two are "clean".

For the srestore version, frames 1 and 2 are now identical. I assume one of them would be decimated. But frame 3 has lots of artefacts, despite it being a "clean" frame to begin with. I only notice that sort of thing very occasionally, but when I do it's quite repeatable. It occurs on the same frame every time.

http://s27.postimg.org/tnnd9677n/comparison.jpg

Once again the problem "fade in". The original frame is "clean".
srestore with pp0 and pp3.

http://s30.postimg.org/wxheqaan5/comparison2.jpg

The screenshots were taken while using srestore 2.7e, but the newer versions produced a similar result.

ChiDragon
8th October 2014, 16:37
You may want to try ExBlend (http://forum.doom9.org/showthread.php?t=157337), but I think a lot of the artifacts are inherent to subtracting and sharpening frames that have already been compressed.

StainlessS
8th October 2014, 18:42
For any real kind of assistance the obligatory sample clip might be a good idea.

foxyshadis
8th October 2014, 23:36
Artifacts usually appear on areas where there's less motion and editing has made the pattern drift, or it's overcompressed enough that the matching fails. Fades done after blending are rare but do happen, and that'll break the detection. It's not possible to tell if that's the case without a sample, but overall video quality with this kind of damage is always going to be pretty rough, so you can't hope for perfect.

hello_hello
9th October 2014, 07:42
Thanks guys. For the moment, I'm playing with ExBlend, which seems to be doing quite a good job (no artefacts), so I've migrated over to the ExBlend thread (http://forum.doom9.org/showthread.php?p=1696343#post1696343), as I have a few questions regarding it's usage. Depending how I go there, I'll make some small samples to upload. My internet connection is slow at the best of times and running particularly badly today, but I'll upload some later if need be.

Cheers.

wonkey_monkey
9th October 2014, 23:26
Every so often I've seen an artefact, but after repeating the encode it's not happened a second time

For what it's worth, srestore doesn't behave consistently if you jump around in the clip. Only after playing a number of sequential frames does it settle down to consistent results.

hello_hello
10th October 2014, 02:48
For what it's worth, srestore doesn't behave consistently if you jump around in the clip. Only after playing a number of sequential frames does it settle down to consistent results.

Yeah I worked that out eventually....... :)
Actually, initially I thought srestore wasn't working at all (I tried it a while back for a different type of unblending) because I didn't see an instant change when adding it to a script and reloading the preview. Now I realise it needs to "settle down" while the video runs. It's probably why occasionally I was getting artefacts I couldn't repeat, but I have found frames where they always happen (as per the screenshots in post #682).

At the moment I'm trying FixBlendIVTC again as I think maybe it's even less "jumping around" tolerant, so I'm trying a few encodes from beginning to end to see what happens.

Boulder
10th October 2014, 07:27
The cache parameter should help with nonlinear access, but nowadays I use RequestLinear(clim=100) right before the SRestore call instead (and never use any multithreading in scripts with SRestore).

Can anyone verify whether it makes sense to use speed=-1 instead of speed=1? And also can anyone explain the actual differences between the three modes (1, 2 and 3)? I'm having problems interpreting the code :)

Motenai Yoda
16th October 2014, 23:26
Can anyone verify whether it makes sense to use speed=-1 instead of speed=1? And also can anyone explain the actual differences between the three modes (1, 2 and 3)? I'm having problems interpreting the code :)
speed goes from -25 to 25 I think difference between -1 and 1 are negible.
this change only bsize to 16 if positive and to 32 if negative.

real.finder
9th February 2017, 09:09
new update

pastebin (http://pastebin.com/BWyDV5xE) and attachment

FranceBB
11th February 2017, 03:20
new update

pastebin (http://pastebin.com/BWyDV5xE) and attachment

Thank you for the update!
It hasn't been updated since March 2014.

real.finder
1st April 2017, 13:52
srestore v2.76

pastebin (https://pastebin.com/3y9xj8Ya) and attachment

real.finder
25th May 2017, 12:35
srestore v2.77

pastebin (https://pastebin.com/0Eqv56dP) and attachment

the only change is fix high bit depth, I hope I did it well and didn't forget something this time

hello_hello
25th May 2017, 18:07
Thanks!

real.finder
15th June 2017, 01:28
srestore v2.78

pastebin (https://pastebin.com/PgnSUB2E) and attachment

some fix

real.finder
23rd November 2017, 03:53
srestore v2.791

pastebin (https://pastebin.com/0bKmyuV8) and attachment

some edit in speed parameter (in avs26 or avs+ will get different result now)

basically it's faster now in some cases, and more flexible

hello_hello
23rd November 2017, 15:53
some edit in speed parameter (in avs26 or avs+ will get different result now)

basically it's faster now in some cases, and more flexible

Thanks for the update.
To clarify, I assume you mean avs26 and avs+ will give different speed results, or does that refer to the video output?

real.finder
23rd November 2017, 17:09
Thanks for the update.
To clarify, I assume you mean avs26 and avs+ will give different speed results, or does that refer to the video output?

both, in fact there were some limit in resize for Chroma subsampling that was used even for 444 I did remove in none needed cases

real.finder
16th March 2018, 07:49
srestore v2.792

pastebin (https://pastebin.com/M1XYE3Jk) and attachment

Sharc
26th March 2018, 18:07
Can a mod approve the attachment, please?

real.finder
10th June 2018, 20:53
srestore v2.793

pastebin (https://pastebin.com/sDXQM8mL) and attachment

fix bug in 12bit thanks to StainlessS, maybe it will be the last edit by me since StainlessS work on update for srestore

StainlessS
10th June 2018, 23:34
maybe it will be the last edit by me since ...
Absolutely not, no, you dont get out of it that easily. :)
I am only reformatting and moving stuff around, I've never used high bit depth stuff at all and dont even know what functions / filters are available.
Martin53 did a convert to an early form of the Multi-instance style developed by himself and Gavino, I am also converting to a later style of same.
[EDIT: also making possible to run under either Avs Std with GScript, or Avs+ without GScript, the real reason for my mods]

I look forward to many years of updates by the master himself, Real.Finder, https://www.cosgan.de/images/more/bigs/i117.gif

All Hail Real.Finder https://www.cosgan.de/images/smilie/musik/k015.gif https://www.cosgan.de/images/more/bigs/i040.gif https://www.cosgan.de/images/midi/figuren/h040.gif

StainlessS
11th June 2018, 16:57
Further to above, Adding GScript functionality can make it possible speed stuff up a bit, consider,

current script

### frame output calculation - resync - dup ###
dbb = select(pos+2, Srestore_d43%%%, Srestore_d32%%%, Srestore_d21%%%, Srestore_d10%%%, Srestore_d01%%%)
dbc = select(pos+2, Srestore_d32%%%, Srestore_d21%%%, Srestore_d10%%%, Srestore_d01%%%, Srestore_d12%%%)
dcn = select(pos+2, Srestore_d21%%%, Srestore_d10%%%, Srestore_d01%%%, Srestore_d12%%%, Srestore_d23%%%)
dnn = select(pos+2, Srestore_d10%%%, Srestore_d01%%%, Srestore_d12%%%, Srestore_d23%%%, Srestore_d34%%%)


The above Selects, are implemented (I think) as functions within Avisynth (rather than in the script parser), each of the possible
selections are evaluated before calling the Select() function to pick out the required one.
Each of the above Srestore_xxx%%% style names are Global variables, and so each of them is slower than local variable access,
and each select call accesses five such slow Globals.
(The '%%%' bit is replaced by some unique name for Function Multiple Instancing, we also replace these in our mod to '@@@' as there
is potential for problems with current '%%%').

With GSCript can use instead eg

### frame output calculation - resync - dup ###
if (pos+2==0) { dbb = Srestore_d43@@@ dbc = Srestore_d32@@@ dcn = Srestore_d21@@@ dnn = Srestore_d10@@@ }
else if(pos+2==1) { dbb = Srestore_d32@@@ dbc = Srestore_d21@@@ dcn = Srestore_d10@@@ dnn = Srestore_d01@@@ }
else if(pos+2==2) { dbb = Srestore_d21@@@ dbc = Srestore_d10@@@ dcn = Srestore_d01@@@ dnn = Srestore_d12@@@ }
else if(pos+2==3) { dbb = Srestore_d10@@@ dbc = Srestore_d01@@@ dcn = Srestore_d12@@@ dnn = Srestore_d23@@@ }
else { dbb = Srestore_d01@@@ dbc = Srestore_d12@@@ dcn = Srestore_d23@@@ dnn = Srestore_d34@@@ }

Only 1 of the above lines is processed, and so with each local var setting only a single Global access is required.

NOTE for Real.Finder only, for eg 'Srestore_d43%%%', the 'Srestore_' is purely ornamental, d43%%% would uniquely identify
the var even with multiple instances, so 'Srestore_' part is totally superfluous.

Reading the values of Global variables is slower than local variable access (locals are scanned first before Globals list).
AVS+, uses a hash table to access Local and Global variables, but Avs Std does not, and so for Avs Std the impact may be
somewhat higher than avs+.

See here thread on slow access to Global Variables Names, in particular those defined early in Avisynth system, eg False and True.
Informational: Compare with Bool literal is SLOW!:- https://forum.doom9.org/showthread.php?p=1650952#post1650952
[EDIT: Above link really no more than an interesting read, not really related to the slower Global access in this case]

I have not done any speed tests so far, comparing original prev version SRestore with my mod, but it should at least be a little
faster I think, I'll post when more complete. There will likely be no mod to the algorithm used, only shuffling stuff about.

StainlessS
12th June 2018, 00:45
Sorry, Real.Finder, I added a second suspect bug via EDIT to my post in your other thread, seems you did not see the EDIT before posting the fix.

Here, https://forum.doom9.org/showthread.php?p=1844187#post1844187

EDIT: Not sure but think maybe this line also screwed up (was not sure what it was supposed to be).

sscalva = sdoscal ? shbdbpc == 10 ? 4 : shbdbpc == 12 ? 8 : shbdbpc == 14 ? 64 : 256 : 1

Looks like it might be supposed to be 12 : 16, where something like for 12 bit, 128 * 8 = 1024,
and should (maybe be) 128 * 16 = 2048.


I'm not sure that above is a bug, only suspect that it may be.

real.finder
12th June 2018, 02:55
yes, it's bug, it has relation with the previous one

srestore v2.794

pastebin (https://pastebin.com/wG2Sus1y) and attachment

fix another bug in 12bit thanks to StainlessS

manolito
12th June 2018, 06:09
Just a quick question about using the latest version 2.794 on an ancient computer (WinXP, CPU without SSE2 capability).

Right now I still use srestore 2.7e because at the time when I installed it this was the last version which worked on my machine. Probably because I have to use masktools-v2.0a48, all later versions do not run on my computer.

Now I just gave v. 2.794 a quick whirl (using the same old masktools version under AVS 2.6), and to my surprise it worked. I just used the frate param though. As you might guess I do not care for high bitdepth or high colors. So my question is if it is safe to switch to the current version of srestore, or am I playing with fire? Does the new version have any advantages over the old 2.7e on my ancient system?


Cheers
manolito

real.finder
12th June 2018, 06:51
Just a quick question about using the latest version 2.794 on an ancient computer (WinXP, CPU without SSE2 capability).

Right now I still use srestore 2.7e because at the time when I installed it this was the last version which worked on my machine. Probably because I have to use masktools-v2.0a48, all later versions do not run on my computer.

Now I just gave v. 2.794 a quick whirl (using the same old masktools version under AVS 2.6), and to my surprise it worked. I just used the frate param though. As you might guess I do not care for high bitdepth or high colors. So my question is if it is safe to switch to the current version of srestore, or am I playing with fire? Does the new version have any advantages over the old 2.7e on my ancient system?


Cheers
manolito

it's not safe since there are scale functions in almost every lut line, which make it give wrong output in old masktools2, you can go back to some older mods from v2.7i and down

manolito
12th June 2018, 06:59
:thanks: for the quick reply...

real.finder
12th July 2018, 02:17
srestore v2.795 pastebin (https://pastebin.com/DDk5W6T9) and attachment

srestore v2.796 (need SMDegrain.avsi (v3.1.2.101s or up)) pastebin (https://pastebin.com/JYBjMBvx) and attachment

Katie Boundary
30th August 2018, 01:51
Should this be applied before bob-deinterlacing? After? Does it replace a bob-deinterlacer? Where in my workflow should I put this filter?

johnmeyer
30th August 2018, 03:36
Should this be applied before bob-deinterlacing? After? Does it replace a bob-deinterlacer? Where in my workflow should I put this filter?It depends on your source. You might want to read this part of the Wiki:

http://avisynth.nl/index.php/Srestore#Examples

It shows one example where SRestore is placed after the bob deinterlacing. I don't think I've ever used it that way. My advice is to try it out and experiment a bit.

Boulder
30th August 2018, 04:09
I'd say that if working with non-animation type of material, at least 95% of the time, SRestore is applied after bob-deinterlacing the source.

Katie Boundary
30th August 2018, 04:14
I'd say that if working with non-animation ...

What if I'm working with animation? Specifically Transformers Armada and The Real Ghostbusters

Boulder
30th August 2018, 04:16
I don't have any experience with that, but I think that there are better alternatives for processing those than SRestore. SRestore works wonders for standard screwed up PAL->NTSC/NTSC->PAL conversions but animation is a very different beast.

manono
30th August 2018, 09:26
Should this be applied before bob-deinterlacing? After? Does it replace a bob-deinterlacer? Where in my workflow should I put this filter?

Do you understand what its purpose is?

As Boulder mentioned, it's designed to fix field-blended videos resulting from bad standards conversions - PAL to NTSC or NTSC to PAL. If that's what you intend to do, you first bob the video followed by the use of SRestore. As usual, an untouched sample should be provided if you'd like more informed help.

Sharc
30th August 2018, 11:22
srestore v2.795

pastebin (https://pastebin.com/DDk5W6T9) and attachment
With v2.795 I am getting the error
mt_lutxy does not have a named argument "use_expr"
(SRestore_avsi, line 105)

There was no problem with v2.794

I am on Avisynth 2.60

ChaosKing
30th August 2018, 11:47
Update your masktools plugin

Sharc
30th August 2018, 12:03
Update your masktools plugin
Yep, that helped. Thanks.

Katie Boundary
30th August 2018, 20:47
I don't have any experience with that, but I think that there are better alternatives for processing those than SRestore. SRestore works wonders for standard screwed up PAL->NTSC/NTSC->PAL conversions

it's designed to fix field-blended videos resulting from bad standards conversions - PAL to NTSC or NTSC to PAL.

So what's best to use for a botched NTSC -> NTSC conversion?

SaurusX
30th August 2018, 21:12
What if I'm working with animation? Specifically Transformers Armada and The Real Ghostbusters

Some of those Real Ghostbusters episodes have 3+ frames blended. Nothing is going to undo that.

manono
30th August 2018, 22:00
So what's best to use for a botched NTSC -> NTSC conversion?
Still SRestore. But rather than allowing SRestore to set the default framerate (25fps for PAL sources poorly converted to NTSC and 23.976 for film sources poorly converted to PAL), you have it set for 23.976. An example:

Bob ###use your favorite bobber
Srestore(Frate=23.976)

A sample will still prove useful. However, if it's as SaurusX says you might get vastly improved, but still far from perfect results. For Srestore to work well, for every field pair you need at least one of the fields 'clean' (unblended). Depending on how much work you're willing to do, you can go through it afterwards manually to fix it with interpolation or freezeframing (since it's animation).

wonkey_monkey
30th August 2018, 23:19
So what's best to use for a botched NTSC -> NTSC conversion?

Post. A. Sample.

Katie Boundary
30th August 2018, 23:56
Still SRestore. But rather than allowing SRestore to set the default framerate (25fps for PAL sources poorly converted to NTSC and 23.976 for film sources poorly converted to PAL), you have it set for 23.976. An example:

Bob ###use your favorite bobber
Srestore(Frate=23.976)

Will it still de-blend if I need 60hz output?

For Srestore to work well, for every field pair you need at least one of the fields 'clean' (unblended). Depending on how much work you're willing to do, you can go through it afterwards manually to fix it with interpolation or freezeframing (since it's animation).

By field pair, do you mean frame? Both shows were edited on tape, so they have things like natively 60hz effects and sometimes orphaned fields around scene changes. What's the best solution for deblending such content?

manono
31st August 2018, 00:24
Will it still de-blend if I need 60hz output?

It'll do the best it can, yes. But the output won't be 60fps, not with the script I posted earlier.

By field pair, do you mean frame?
I meant field pair, the top and bottom fields that made up the original frames before bobbing. After bobbing, yes, it would be the frame pairs - the even and odd frames each forming a pair. One from each pair has to be clean for SRestore to do its job properly.

If you want 59.94fps, then you might bob it followed by trying CDeblend (http://avisynth.nl/index.php/Cdeblend). No promises, though. In the absence of a sample, neither I nor anyone else can try out different ideas.

hello_hello
31st August 2018, 00:31
Will it still de-blend if I need 60hz output?

It's generally used to deblend PAL converted to NTSC with field blending, or NTSC field blended from PAL, so you end up with 23.976fps or 25fps progressive.

By field pair, do you mean frame? Both shows were edited on tape, so they have things like natively 60hz effects and sometimes orphaned fields around scene changes. What's the best solution for deblending such content?

It's usually converted by blending fields, not frames, and due to the way it's done, when the top fields have blending the bottom fields don't and vice versa, so after bob-interlacing and the fields are interpolated to frame height, there should always be unblended frames to keep.

This field blends NTSC to PAL, although you'd probably want to use a better bobber..

AviSource("NTSC_clip.avi")
Bob(height=576)
BicubicResize(720,576)
ConvertFPS(50)
SeparateFields()
SelectEvery(4,0,3)
Weave()

If SRestore has a hard time with animation due to it having lots of duplicate frames (it works very well for video), you can try deblending with one of these functions, but it requires some trial and error to find the best "select" value, and if the blending pattern changes (it usually doesn't), you'll have to adjust it where it breaks.
https://forum.doom9.org/showthread.php?p=1848202#post1848202

Edit: Damn! manono beat me to it. :(

Katie Boundary
31st August 2018, 01:36
It'll do the best it can, yes. But the output won't be 60fps, not with the script I posted earlier.

I mean if I set frate=59.94, will it still de-blend?

I meant field pair, the top and bottom fields that made up the original frames before bobbing. After bobbing, yes, it would be the frame pairs - the even and odd frames each forming a pair. One from each pair has to be clean for SRestore to do its job properly.

That sounds like a very elaborate way of saying "yes".

What I'm getting out of this is that Srestore is built upon the assumption that the content was originally 100% progressive, and it should not be applied to anything that was originally edited on tape and therefore has orphaned fields around scene changes, 60hz effects, etc. Is that accurate?

If you want 59.94fps, then you might bob it followed by trying CDeblend (http://avisynth.nl/index.php/Cdeblend). No promises, though.

:thanks:

In the absence of a sample, neither I nor anyone else can try out different ideas.

I just got done digging through my TF Armada episodes. I still had some un-converted VOBs in there from last year, so I had to index them all and open them in Vdub to see if they were affected. They weren't. Only episodes 27-40 are blended, but the leftover Vobs were all from 41+, so I'll have to re-rip some stuff. Give me a few hours.

EDIT: oh, this is interesting. For The Real Ghostbusters, it looks like the ABC episodes and the syndicated episodes each have their own set of "wipes". Only the ABC episodes use the 60 hz wipes, but they're also the episodes that were transferred correctly. As for the syndicated episodes, Saurus is correct; they look like they've gone through multiple rounds of blending and should probably be written off as a lost cause. Ironically, the syndicated episodes have perfectly preserved openings. I'll give you an Armada episode.

EDIT 2: here's the blended version of the TF Armada opening www.sendspace.com/file/3ldeo2

manono
31st August 2018, 04:48
Ordinarily one wouldn't post an anime opening as a sample as they're often different from the body of the episodes. However, it's far from perfect but it's a definite improvement:

Yadifmod(mode=1, edeint=nnedi3(field=-2))
SRestore(Frate=23.976)

https://www.sendspace.com/file/7m07dp

It's 23.976fps because that's what it is. I see no benefit to making it 59.94FPS, although it can be done with:

SelectEvery(2,0,0,0,1,1)

placed at the end of the script. I didn't have much luck bobbing it and then trying to unblend that, keeping it at 59.94fps. Others might have different ideas and have better luck than I.

What I'm getting out of this is that Srestore is built upon the assumption that the content was originally 100% progressive, and it should not be applied to anything that was originally edited on tape and therefore has orphaned fields around scene changes, 60hz effects, etc. Is that accurate?

It's far and away the best filter when working with field-blended garbage. Only the worst fly-by-night companies take film and then field-blend it to get 29.97fps out of it. Editing as video doesn't mean field-blending afterwards. Not when they could have just hard telecined it. You've worked with all those sci-fi shows before with the 60Hz effects. Those companies didn't feel the need to ruin it by field-blending it. You could just bob those and be done with them. Not this crap.

hello_hello
31st August 2018, 17:34
What I'm getting out of this is that Srestore is built upon the assumption that the content was originally 100% progressive, and it should not be applied to anything that was originally edited on tape and therefore has orphaned fields around scene changes, 60hz effects, etc. Is that accurate?

I'm pretty sure field blending can be applied to both interlaced video and progressive sources, and "orphan fields" would be blended along with the rest. Using the method I posted earlier, interlaced video would be bob deinterlaced first, converted to a new frame rate with blending (50fps progressive for PAL), then fields are decimated to output interlaced video again (25fps or 50i for PAL).

I think it'd be unusual to field blend hard telecined sources, You'd convert them to a new frame rate from their progressive state.

Katie Boundary
1st September 2018, 20:23
Armada DOES have orphaned fields around scene changes and therefore interruptions in the pulldown pattern. They might not be apparent in the opening but they do exist. I can rip one of the clean episodes to prove it.

Editing as video doesn't mean field-blending afterwards. Not when they could have just hard telecined it.

Well, obviously. But that doesn't stop anyone from taking a finished episode with clean 60 hz or otherwise edited-on-tape content and then needlessly blending it anyway. That's the kind of content that I'm interested in de-blending right now.

hello_hello
2nd September 2018, 20:19
Armada DOES have orphaned fields around scene changes and therefore interruptions in the pulldown pattern. They might not be apparent in the opening but they do exist. I can rip one of the clean episodes to prove it.

I believe you. DVDs are an interlaced format intended for CRTs expecting interlaced video. The TV draws the odd scanlines from the first field, then the even lines from the next field, and so on. As far as I know, "orphan fields" don't matter to an interlaced display because it has no concept of frames. It's only when you try to make frames.....

Anyway, I was simply saying the field blending conversion process wouldn't be concerned with orphaned fields.

Well, obviously. But that doesn't stop anyone from taking a finished episode with clean 60 hz or otherwise edited-on-tape content and then needlessly blending it anyway. That's the kind of content that I'm interested in de-blending right now.

Where did your sample come from? If you compare the fields it appears to have been frame blended in places and it's 23.976 progressive, so maybe it was detelecined and the blending is the result blend de-interlacing combed frames, or something....

The original DVD source might be a different story, but I doubt you'll be able to fix that.

Kurogane
28th September 2018, 10:15
I've a problem w ith avs+


SetFilterMTMode("DEFAULT_MT_MODE", 2)
sanimebob()
srestore()
Prefetch(6)


Give me this error "I don't know what ''dm"means. Line 4 (Prefetch)"

- MaskTools2 - v2.7.31
- TIVTC - v1.0.11
- RgTools - v0.97.0
- GRunT - grunt-x64/1.0.1a

real.finder
28th September 2018, 13:48
I've a problem w ith avs+


SetFilterMTMode("DEFAULT_MT_MODE", 2)
sanimebob()
srestore()
Prefetch(6)


Give me this error "I don't know what ''dm"means. Line 4 (Prefetch)"

- MaskTools2 - v2.7.31
- TIVTC - v1.0.11
- RgTools - v0.97.0
- GRunT - grunt-x64/1.0.1a

its known thing, you can't use mt (Prefetch) with any runtime function like srestore

Kurogane
28th September 2018, 19:01
its known thing, you can't use mt (Prefetch) with any runtime function like srestore

Any solution? even outside of MT not work.

real.finder
28th September 2018, 22:09
Any solution? even outside of MT not work.

no solution for now (unless pinterf or anyone find fix for it)

what you mean outside of MT? you must not use Prefetch at all (remove it from the script) to make it work

color
29th September 2018, 12:54
The links does not longer work. Does anyone have this plugin?

color
29th September 2018, 14:45
Thank you Wolfberry

ChaosKing
29th September 2018, 15:11
@real.finder Why not push your scripts to github? It often feels like a quest to find the up to date version. Wouldn't it be easier for everyone?

real.finder
29th September 2018, 21:29
@real.finder Why not push your scripts to github? It often feels like a quest to find the up to date version. Wouldn't it be easier for everyone?

cuz pastebin is easier for me (for now and before), but I was thinking about change to github but because of lack of time and sometimes laziness I didn't

ChaosKing
29th September 2018, 21:36
I can recommend GitKraken (it's free for non commercial projects) One click and it's on github. It's even faster than pastebin :D
It's very easy to use and has a nice gui. https://www.gitkraken.com/

You do not want to go back afterwards.

Kurogane
29th September 2018, 22:10
no solution for now (unless pinterf or anyone find fix for it)

what you mean outside of MT? you must not use Prefetch at all (remove it from the script) to make it work

SetFilterMTMode("DEFAULT_MT_MODE", 2)
.....
Prefetch(6)
sanimebob()
srestore()

Boulder
11th December 2018, 20:05
Does anyone have something to try to restore this video? It's from Dream Theater Live at Budokan Blu-ray.

https://drive.google.com/open?id=11fwcTY9Uc9Rb2HO0lm9noVkd85CbslmV

To me it looks like hard telecined content encoded in a very wrong way but I cannot figure out how to make it look good (enough).

Sharc
11th December 2018, 21:02
Does anyone have something to try to restore this video? It's from Dream Theater Live at Budokan Blu-ray.

https://drive.google.com/open?id=11fwcTY9Uc9Rb2HO0lm9noVkd85CbslmV

To me it looks like hard telecined content encoded in a very wrong way but I cannot figure out how to make it look good (enough).
This looks like a messed up framerate (multiple) conversion. Blended progressive frames, and both fields of the interlaced/telecined sections also blended….
I doubt there is a fix for that…….
Perhaps try to catch the clean frames and interpolate the gaps?

hello_hello
11th December 2018, 22:14
Does anyone have something to try to restore this video? It's from Dream Theater Live at Budokan Blu-ray.

https://drive.google.com/open?id=11fwcTY9Uc9Rb2HO0lm9noVkd85CbslmV

To me it looks like hard telecined content encoded in a very wrong way but I cannot figure out how to make it look good (enough).

The frame rate is a little odd, and there's still a couple of blended frames on scene changes. Maybe the blending pattern changes. I'm not sure. You might be able to tune SRestore's double blend removal a bit. Or maybe drop TDeint or the frame rate conversion to see if they're the cause. This seems to clean it up reasonably well though. If there's still aliasing in places, you might want to try QTGMC(FPSDivisor=2) instead of TDeint. Not perfect yet, but it's a start.

LWLibavVideoSource("D:\dreamtheater.mkv.lwi", fpsnum=30000, fpsden=1001)
TDeint()
Srestore(mode=-4,omode="pp0")
TDecimate()
Gradfun3()

dreamtheater.mkv (https://ufile.io/3ree3)

PS. Where it says dmode in the SRestore wiki (if it still does), it should say mode.

Boulder
12th December 2018, 04:45
Thanks, I'll give that one a go :) The scene changes are not a big problem since it's usually quite hard to make things work around them, especially with this kind of material with lots of flashes etc.

StainlessS
17th December 2018, 14:31
Boulder,
I ran your sample through ExBlend (latest beta Edition), and it seemed to be detecting about 96% of blends.
See this thread first for Didee's Blur inspiration:- https://forum.doom9.org/showthread.php?t=162599&highlight=exblend

And then here:- https://forum.doom9.org/showthread.php?p=1558840#post1558840

NOTE, The ExbFile arg dont work properley on Win7 (think M$ must have broken it, also recently seen similar problems posted about Avs+ paths),
so you need give full path (defaults to "ExBlend", need set eg "D:\ExBlend" to fix on Win7+, & maybe Vista).

ExBlend is definitely not intended for this sort of clip, it does however seem to detect it.
Good luck.

EDIT: It even seems to detect without the blur, but give it a whirl with/without.
I did not try with blur.

EDIT: Path problem, where ExbFile="ExBlend" on XP, works fine writing data file to current dir, on W7, says it wrote ok, but file nowhere to be found, dont know where it gets written (if indeed it does at all, search did not find it).

EDIT:

AVISource("D:\ExB\dreamtheater.264.AVI")
#ExBlend(mode=1,PAL=0,ExBFile="D:\EXB\ExBlend",Debug=true)
ExBlend(mode=2,PAL=0,ExBFile="D:\EXB\ExBlend",Debug=true,Show=5)
Return Last

Dont use directshow.

EDIT: Seems that ChiDragon already reported problems in paths, although I had no idea as to the cause back then.

On my system, the default location for writing "Exbfile" is the Plugin's dir rather than the script dir. This is a problem because it gets written to the VirtualStore and then isn't read back when set to mode=2. (My plugin is located in %PROGRAMFILES(x86)%\AviSynth 2.5\plugins\)

Boulder
17th December 2018, 14:58
Thanks, I'll have to try that one too. There seems to be something seriously wrong with that release, I noticed a section where there were dupes all over the place after the deblending of SRestore. I was already resigned to leaving everything as they are :)

StainlessS
17th December 2018, 15:26
dupes all over the place after the deblending of SRestore
I think you could do worst than give DropDeadGorgeous a try on the dupes [EDIT: After SRestore or ExBlend].
If you do, then please give some kind of feedback, good or bad, thanx.

Incidentally, I think I totally misinterpreted (mis-remembered) JohnMeyer description of the DropDeadGorgeous problem, should have been
dupes followed by eventual drops, but I implemented drops followed by eventual dupes
(John must have decided not to let on, and leave me in suspense, likes a good giggle does john).
Anyways, does a bloody good job even though I fixed the wrong problem, maybe I try fix the right prob when I get time.

StainlessS
18th December 2018, 17:17
Use something like


AVISource("D:\ExB\dreamtheater.264.AVI")
ORG=Last
DC=ORG.Blur(0,1)
#ORG.ExBlend(DClip=DC,mode=1,PAL=0,ExBFile="D:\EXB\ExBlend",Debug=true)
ORG.ExBlend(DClip=DC,mode=2,PAL=0,ExBFile="D:\EXB\ExBlend",Debug=true,Show=5)
Return Last


EDIT: Shows detection of blends @ 95.44% on last frame from of your sample.
92 blend pairs detected out of maximum possible 96.

EDIT:
Hope this works ok, long time since I use ExBlend.

AVISource("D:\ExB\dreamtheater.264.AVI")
DC=Last.Blur(0,1)

#return Last.ExBlend(mode=1,PAL=0,ExBFile="D:\EXB\ExBlend",Debug=true,DClip=DC) # Pass 1

SHOW =0 # 0(off) or 5
DISP_EXBLEND = 1
COMP_UB = 1 # DeBlended frame from DC, Adjacent from Source)
# Combed Clip, Deblended, Decimated
EXB=Last.ExBlend(mode=2,PAL=0,disp=DISP_EXBLEND,CompUB=COMP_UB,ExBFile="D:\EXB\ExBlend",Debug=true,Show=SHOW,dclip=DC)
MC=EXB.MCDegrain(1) # Denoise all frames
ClipClop(EXB,MC,CMD="ExBlend_Decimated.Txt") # ExBlend clip with denoised De-blended frames only
Return Last

Boulder
18th December 2018, 18:05
Is there an x64 version of ExBlend available or will I need to install a 32-bit Avisynth+ environment?

StainlessS
18th December 2018, 18:18
Is there an x64 version

I'll do one now (with fixed "ExbFile" path arg).

StainlessS
18th December 2018, 23:12
Ok, wanna try this

AVISource("D:\ExB\dreamtheater.264.AVI")
#ConvertToYUY2 # CANNOT USE MCDegrain on YUY2
ConvertToYV12
#ConvertToYV16
#ConvertToYV24
#ConvertToY8

#return Last.ExBlend(ver=true) # Version only

DC=Last.Blur(0,1)
Return Last.ExBlend(mode=1,PAL=0,Debug=true,DClip=DC,Show=5) # Pass 1

SHOW = 5 # 0(off) or 5
CLIPCLOPSHOW = False # ONLY used if SHOW=0
DISP_EXBLEND = 1
COMP_UB = 1 # DeBlended frame from DC, Adjacent from Source)
MC = True # Denoise with McDegrain
SHARP = 0.333 # Use McDegrainSharp if > 0.0
#############
MC=IsYUY2 ? False : MC
SHARP=IsYUY2 ? 0.0 : SHARP
CLIPCLOPSHOW=(SHOW==0) ? CLIPCLOPSHOW : False
# Orig Clip, blurred DC, result Deblended, Decimated
EXB=Last.ExBlend(mode=2,PAL=0,disp=DISP_EXBLEND,CompUB=COMP_UB,Debug=true,Show=SHOW,dclip=DC)
#return EXB
# Denoise all frames (BUT NOT IF YUY2, unsupported in MCDeGrain)
DENOISED = (!IsYUY2) ? ((SHARP>0.0) ? EXB.MCDegrainSharp(1,csharp=SHARP) : EXB.MCDegrain(1)) : Last
# ExBlend clip with denoised De-blended frames only (Skipped if YUY2)
(!IsYUY2&&MC) ? ClipClop(EXB,DENOISED,CMD="ExBlend_Decimated.Txt",show=CLIPCLOPSHOW) : EXB
Return Last



Holla if you have probs.

ExBlend v1.04:- https://forum.doom9.org/showthread.php?t=175948

Boulder
19th December 2018, 04:53
Thanks, I'll start working with that and see what comes out :thanks:

a1s2d3f4
26th February 2019, 16:28
Just upgraded from the old AviSynth2.5 (x86) to Avisynth+ from here http://avs-plus.net/.

The claim on the page that it is fully compatible with the old AviSynth.

However, as soon as I tried to test one of my .avs scripts, I got this error.
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
lutxy : invalid yExpr
(C:/Program Files (x86)/AviSynth 2.5/plugins/Srestore.avsi, line 93)
(F:\PRODUCTS\test\VIDEO_TS\VTS_01_1-Cziffra-GGC-srestore1.avs, line 66)
---------------------------
OK
---------------------------


Does anyone know whether or not srestore can be made to work with AviSynth+ or should I downgrade?

Thanks,
a1

poisondeathray
26th February 2019, 18:43
Does anyone know whether or not srestore can be made to work with AviSynth+ or should I downgrade?



Yes it works, but you need updated , matching versions of srestore and dependencies.

(Basically you need newer versions if using avs+, older matching versions if using avs classic)

Groucho2004
26th February 2019, 19:01
Just upgraded from the old AviSynth2.5 (x86) to Avisynth+ from here http://avs-plus.net/.You should use the latest AVS+ from here (https://github.com/pinterf/AviSynthPlus/releases).

manolito
26th February 2019, 20:56
Yeah, version hell again, this time not caused by Microsoft, but by the "AVS Plugins Modernization Effort" which started after the introduction of AVS+.

Basically users cannot mix older and newer versions of the AVSI scripts, the plugins these scripts depend on and the AVS versions. Everything needs to fit, a newer AVSI needs newer plugins plus a newer AVS+ version. No backward compatibility, going back from AVS+ to classic AVS requires to install older script and plugin versions.

I do use AVS+ now, but I do not care for the new High Bitdepth and HiColor features. All I want is MT. And I absolutely need backwards compatibility for my scripts and plugins.

For Srestore I use the last MoMonster version 2.7e together with an older MT_Masktools version. Works nicely under classic AVS 2.6 as well as under the latest AVS+ version. Here is an All-In-One version:
https://files.videohelp.com/u/172211/Srestore_2.7e_AIO.zip


Cheers
manolito

real.finder
26th February 2019, 21:09
Just upgraded from the old AviSynth2.5 (x86) to Avisynth+ from here http://avs-plus.net/.

The claim on the page that it is fully compatible with the old AviSynth.

However, as soon as I tried to test one of my .avs scripts, I got this error.
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
lutxy : invalid yExpr
(C:/Program Files (x86)/AviSynth 2.5/plugins/Srestore.avsi, line 93)
(F:\PRODUCTS\test\VIDEO_TS\VTS_01_1-Cziffra-GGC-srestore1.avs, line 66)
---------------------------
OK
---------------------------


Does anyone know whether or not srestore can be made to work with AviSynth+ or should I downgrade?

Thanks,
a1

I think this is masktools bug, it should not use Expr if the avs+ don't have it (like old avs+ in that link)

real.finder
26th February 2019, 21:15
Yeah, version hell again, this time not caused by Microsoft, but by the "AVS Plugins Modernization Effort" which started after the introduction of AVS+.

Basically users cannot mix older and newer versions of the AVSI scripts, the plugins these scripts depend on and the AVS versions. Everything needs to fit, a newer AVSI needs newer plugins plus a newer AVS+ version. No backward compatibility, going back from AVS+ to classic AVS requires to install older script and plugin versions.

I do use AVS+ now, but I do not care for the new High Bitdepth and HiColor features. All I want is MT. And I absolutely need backwards compatibility for my scripts and plugins.

For Srestore I use the last MoMonster version 2.7e together with an older MT_Masktools version. Works nicely under classic AVS 2.6 as well as under the latest AVS+ version. Here is an All-In-One version:
https://files.videohelp.com/u/172211/Srestore_2.7e_AIO.zip


Cheers
manolito

most if not all edits I did for avsi's don't need newer avs+ (especially the last updates), even avs2.5 still supported in most of avsi's I edits, but most of times they (avsi's) need newer plugins if you using avs 2.6 or avs+

Groucho2004
26th February 2019, 23:15
most of times they (avsi's) need newer plugins if you using avs 2.6 or avs+
And this is really not so difficult:

Avisynth+ (https://github.com/pinterf/AviSynthPlus/releases)

Average (http://avisynth.nl/index.php/Average)
MaskTools (https://github.com/pinterf/masktools/releases)
RGTools (https://github.com/pinterf/RgTools/releases) (includes RemoveGrain)
GRunT (http://avisynth.nl/index.php/GRunT)
TIVTC (https://github.com/pinterf/TIVTC/releases)

AIO MS runtimes (https://repacks.net/viewtopic.php?f=6&t=247)

Some of the plugins in manolito's package are 15 years old. There have been many improvements, especially in Masktools. It makes no sense (to me) to run these ancient versions.

manolito
27th February 2019, 01:26
Some of the plugins in manolito's package are 15 years old. There have been many improvements, especially in Masktools. It makes no sense (to me) to run these ancient versions.

All of these "improvements" only apply if you need to use the AVS+ enhancements like High Bit Depth or the fancy High Color features. If you do not need these features and/or want to continue using the classic AVS 2.60 version then these improvements simply do not mean a thing, they only destroy backward compatibility.

Yes, some of these plugins are old, but they "just work". which cannot be said about some of the newer incarnations of these plugins.

a1s2d3f4
27th February 2019, 02:02
Thanks, everyone. Still not sure what to do, but I like the discussion so far.

The reason I tried AVS+ was because I needed UTF8 support for my subtitles (which the old subtitle() function doesn't support).

AVS+ author also claimed it to be faster/better/stronger on the avs-plus page as compared to the old AVISynth, so I thought, great, why not.

Anyway, after my initial post I found out about this: https://forum.doom9.org/showthread.php?t=172124

I tried it, and indeed, it seems to make changing between versions much easier on my machine (no reinstall, reboot needed), but, again, I still can't use srestore() when I choose one of the AVS+ options in the bat file. So, I used one of the 2.6.0 or 2.6.1 options ( can't remember now, and I don't know how to check, and at least my scripts are loading just fine ).

Anyway, I'll read more about this whole "version hell" at some point and hopefully get my UTF8 subtitle support working by choosing the right version of srestore().

I also rely on the use of svpflow() in my scripts, so, again, would need whatever version to work with that too.

Groucho2004
27th February 2019, 03:17
All of these "improvements" only apply if you need to use the AVS+ enhancements like High Bit Depth or the fancy High Color features.I was not referring to those. I meant pinterf's fixes of some nasty bugs in masktools2. Have a look at the change log.

Anyway, to each his own.

Groucho2004
27th February 2019, 03:22
Anyway, I'll read more about this whole "version hell" at some point and hopefully get my UTF8 subtitle support working by choosing the right version of srestore().There is no version hell. All you have to do is download the plugins to which I linked in post #760 and put them in your auto-load directory. Run the Avisynth Info Tool (from my signature) to check if everything is as it should be. The whole thing takes 5 minutes.

There is no reason to return to the Avisynth stone age unless you're running a CPU from the last millennium (such as Manolito's P3).

manolito
27th February 2019, 14:13
I did have a look at the changelog on pinterf's GitHub page. Looks to me like he mainly fixed the bugs which were introduced by tp and himself, and they were mainly related to the new high bitdepth feature.

I use manao's masktools-v2.0a48 which is the last one to not need SSE2, and I never saw any bugs in this version.

Groucho2004
27th February 2019, 19:27
I did have a look at the changelog on pinterf's GitHub page. Looks to me like he mainly fixed the bugs which were introduced by tp and himself, and they were mainly related to the new high bitdepth feature.I don't want to dig through the whole change log, I just seem to remember at least one long standing, nasty bug that pinterf fixed. Maybe it was mvtools.

Either way, you are free to use any versions you like but don't spread FUD about incompatibilities. The "version hell" you speak of has nothing to do with AVS+ or the newer plugins. AVS+ can load old plugins just fine. It's the modified scripts (smdegrain, srestore, QTGMC) that require certain versions of AVS+ and/or plugins.

Did I mention that AVS+ and the newer plugins are much faster (on a reasonably modern CPU)?

manolito
27th February 2019, 20:27
AVS+ can load old plugins just fine.

According to a1s2d3f4 this is not always true:
The claim on the page that it is fully compatible with the old AviSynth.
However, as soon as I tried to test one of my .avs scripts, I got this error.
it seems to make changing between versions much easier on my machine (no reinstall, reboot needed), but, again, I still can't use srestore() when I choose one of the AVS+ options in the bat file. So, I used one of the 2.6.0 or 2.6.1 options ( can't remember now, and I don't know how to check, and at least my scripts are loading just fine ).

So the combination of scripts and plugins which do work under classic AVS do sometimes NOT work under several versions of AVS+. And in the AVS+ thread a1s2d3f4 even said that reverting back from AVS+ to classic AVS did not fix the failing script:
Because I need this script to work right now, I went into "Uninstall or Change a Program" (Win8.1x64) and selected to uninstall AviSynth+.
It did so quickly, so I tried running my .avs script again and I now got this error

Not all that reliable IMO...

Groucho2004
27th February 2019, 20:50
Again, what you're stating and quoting has nothing to do with AVS+'s plugin backward compatibility. The only plugs AVS+ won't load are ancient 2.0 C/C++ plugins.

I have yet to come across a 2.5 plugin that does not work with AVS+.

What people put in their scripts or which versions of avsi's they use is a different story.

manolito
27th February 2019, 23:01
Sorry, I cannot reproduce your logic... :devil:

a1s2d3f4 reported that Srestore works under classic AVS, after installing AVS+ it did not work any longer. Your point is that AVS+ works with all classic AVS plugins. Only one of the two can be true. Do you accuse a1s2d3f4of making this up?

videoh
27th February 2019, 23:50
It's your logic that is deficient. SRestore is not a plugin.

manolito
27th February 2019, 23:55
AVSI scripts are technically no plugins, but they are treated like plugins by AviSynth. And when Groucho says that AVS+ works just fine with all classic AVS plugins then I take it that this includes all AVSI scripts for classic AVS.

ChaosKing
28th February 2019, 00:26
I'm not sure if this was mentioned, but the the latest srestore version can be downloaded here https://pastebin.com/JYBjMBvx Maybe it helps...

lansing
28th February 2019, 00:30
A solid solution: have someone to make an Avisynth+ plugin repository like Vapoursynth, problem solved. Anytime you want any plugin, just type its name in the repo and it will download all dependencies automatically to save yourself a headache.

There's just no point here to argument why can't your ps1 games play on a ps4 console.

ChaosKing
28th February 2019, 00:36
There is one with some plugins https://github.com/theChaosCoder/vsrepo/tree/AVSRepo/local
But avisynth users don't want to install python.

Groucho2004
28th February 2019, 00:39
AVSI scripts are technically no plugins, but they are treated like plugins by AviSynth.No.

And when Groucho says that AVS+ works just fine with all classic AVS plugins then I take it that this includes all AVSI scripts for classic AVS.If by "AVSI scripts for classic AVS" you mean that they don't include statements that only apply to AVS+ features that are not supported by classic Avisynth then yes, it should work. However, I went through a1s2d3f4's previous posts and could not find any indicator as to which version of srestore he was using when he encountered errors.

Aaanyway, most of this is idle speculation without knowing for sure which versions of plugins and scripts he's using. And, as I pointed out, all he needs to do is download the versions to which I linked.

videoh
28th February 2019, 00:47
And when Groucho says that AVS+ works just fine with all classic AVS plugins then I take it that this includes all AVSI scripts for classic AVS. You took it wrong. He clearly and explicitly distinguished the two.

a1s2d3f4
28th February 2019, 03:51
I downloaded and installed plugins from every link in post #760. I copied the 7z packages (dlls) to my plugins directory, and extracted the x86 dlls to plugins directory.

As I mentioned, I am now using this "Universal Avisynth Repository" with setavs.bat.

I run it as an administrator and choose 6) (AVSPLUS_x86).

It reports

Installing AVSPLUS_x86...

setup for 64bit windows system...

copying AVSPLUS_x86 files to "C:\Windows\SysWow64"...
copy /y "D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\avisynth.dll" "C:\
Windows\SysWow64"
1 file(s) copied.
1 file(s) copied.

Writing "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "" /d "D:\programs-non-setup\Avi
synthRepository\AVSPLUS_x86"
The operation completed successfully.

Writing "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir2_5" /d "D:\programs-n
on-setup\AvisynthRepository\plugins"
The operation completed successfully.

Writing "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir+" /d "D:\programs-non
-setup\AvisynthRepository\AVSPLUS_x86\plugins"
The operation completed successfully.

adding more registry entries (wow64 mode)...
The operation completed successfully.

Press any key to continue . . .

So, from all appearances running .avs scripts now should use this AVSPLUS_x86.

Indeed, this suspicion seems to be confirmed by the following info in Avisynth Info Tool:



[Avisynth info]
VersionString: AviSynth+ 0.1 (r2772, MT, i386)
VersionNumber: 2.60
File / Product version: 0.1.0.0 / 0.1.0.0
Interface Version: 5
Multi-threading support: Yes
Avisynth.dll location: C:\Windows\SysWOW64\avisynth.dll
Avisynth.dll time stamp: 2018-12-20, 13:06:26 (UTC)
PluginDir2_5 (HKLM, x86): D:\programs-non-setup\AvisynthRepository\plugins
PluginDir+ (HKLM, x86): D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins



Well, regardless, when I run the .avs script that uses srestore(), it fails as before.
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
lutxy : invalid yExpr
(D:/programs-non-setup/AvisynthRepository/plugins/Srestore.avsi, line 93)

---------------------------
OK
---------------------------

Interstingly enough, note that while PluginDir+ is set to D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins and I deliberately copied all the dlls and .avsi files in there, just to be sure, this VD error shows that the srestore() that's being used is taken from D:\programs-non-setup\AvisynthRepository\plugins.


Am I forgetting to do something obvious?

poisondeathray
28th February 2019, 05:33
Clean out your plugins directory. All of them. Make sure you don't have some old masktools version (move it to some subfolder if you want to be nostalgic). Check avsmeter log for bad/old conflicting plugins

Groucho2004
28th February 2019, 11:29
@a1s2d3f4
What poisondeathray wrote. We can assist you with this if you post the content of the log file that Avisynth Info Tool produces ("Save Info..." button).

a1s2d3f4
28th February 2019, 13:32
Can't post as a single log because apparently these posts cannot be more than 16000 long.

Splitting into two parts
(note, that this is before I did any kind of "cleaning out of plugins" - this is how it is right now)

Part1

[OS/Hardware info]
Operating system: Windows 8.1 (x64) (Build 9600)

CPU: Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz / Haswell (Core i7)
MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, FMA3, AVX, AVX2
4 physical cores / 8 logical cores


[Avisynth info]
VersionString: AviSynth+ 0.1 (r2772, MT, i386)
VersionNumber: 2.60
File / Product version: 0.1.0.0 / 0.1.0.0
Interface Version: 5
Multi-threading support: Yes
Avisynth.dll location: C:\Windows\SysWOW64\avisynth.dll
Avisynth.dll time stamp: 2018-12-20, 13:06:26 (UTC)
PluginDir2_5 (HKLM, x86): D:\programs-non-setup\AvisynthRepository\plugins
PluginDir+ (HKLM, x86): D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins


[C 2.5 Plugins (32 Bit)]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\AVSInpaint.dll [2008-02-23]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\ffavisynth.dll [1.2.4422.0]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\yadif.dll [1.7.0.0]
D:\programs-non-setup\AvisynthRepository\plugins\AVSInpaint.dll [2008-02-23]
D:\programs-non-setup\AvisynthRepository\plugins\ffavisynth.dll [1.2.4422.0]
D:\programs-non-setup\AvisynthRepository\plugins\yadif.dll [1.7.0.0]

[CPP 2.0 Plugins (32 Bit)]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\avisynthex.dll [2004-05-13]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\LGhost1.dll [0.3.0.1]
D:\programs-non-setup\AvisynthRepository\plugins\avisynthex.dll [2004-05-13]
D:\programs-non-setup\AvisynthRepository\plugins\LGhost1.dll [0.3.0.1]

[CPP 2.5 Plugins (32 Bit)]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\DeBarrel.dll [2011-09-14]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\DeDup.dll [2004-11-08]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\defish.dll [2010-03-07]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\DenoiseSharpen.dll [2005-07-06]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\DGAVCDecode.dll [1.0.9.0]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\DGDecode.dll [1.5.8.0]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\DirectShowSource-old.dll [2.5.8.7]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\exinpaint.dll [0.2.0.0]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\ffms2.dll [2013-05-21]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\FFT3DFilter.dll [2.1.1.0]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\GetSystemEnv.dll [2008-06-09]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\Ghostbuster.dll [2012-03-02]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\GRunT.dll [2008-09-27]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\GScript.dll [2009-12-07]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\immaavs.dll [2008-12-18]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\immaavs1.51.dll [2010-07-03]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\LGhost.dll [0.3.0.1]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\MPEG2Dec3.dll [1.0.1.0]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\mt_masktools-25.dll [2.0.46.0]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\mt_masktools-26.dll [2.0.46.0]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\mt_masktools.dll [2005-08-21]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\QTSource.dll [2011-02-19]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\rawsource.dll [2006-07-28]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\RemoveGrain.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\RemoveGrainS.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\RemoveGrainSSE2.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\RemoveGrainSSE3.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\Repair.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\RepairS.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\RepairSSE2.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\RepairSSE3.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\Rotate.dll [1.3.3.0]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\RSharpen.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\RSharpenS.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\RSharpenSSE2.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\RSharpenSSE3.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\TCPDeliver.dll [1.0.0.6]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\TTempSmooth.dll [0.9.4.0]
D:\programs-non-setup\AvisynthRepository\plugins\DeBarrel.dll [2011-09-14]
D:\programs-non-setup\AvisynthRepository\plugins\DeDup.dll [2004-11-08]
D:\programs-non-setup\AvisynthRepository\plugins\defish.dll [2010-03-07]
D:\programs-non-setup\AvisynthRepository\plugins\DenoiseSharpen.dll [2005-07-06]
D:\programs-non-setup\AvisynthRepository\plugins\DGAVCDecode.dll [1.0.9.0]
D:\programs-non-setup\AvisynthRepository\plugins\DGDecode.dll [1.5.8.0]
D:\programs-non-setup\AvisynthRepository\plugins\DirectShowSource-old.dll [2.5.8.7]
D:\programs-non-setup\AvisynthRepository\plugins\exinpaint.dll [0.2.0.0]
D:\programs-non-setup\AvisynthRepository\plugins\ffms2.dll [2013-05-21]
D:\programs-non-setup\AvisynthRepository\plugins\FFT3DFilter.dll [2.1.1.0]
D:\programs-non-setup\AvisynthRepository\plugins\GetSystemEnv.dll [2008-06-09]
D:\programs-non-setup\AvisynthRepository\plugins\Ghostbuster.dll [2012-03-02]
D:\programs-non-setup\AvisynthRepository\plugins\GRunT.dll [2008-09-27]
D:\programs-non-setup\AvisynthRepository\plugins\GScript.dll [2009-12-07]
D:\programs-non-setup\AvisynthRepository\plugins\immaavs.dll [2008-12-18]
D:\programs-non-setup\AvisynthRepository\plugins\immaavs1.51.dll [2010-07-03]
D:\programs-non-setup\AvisynthRepository\plugins\LGhost.dll [0.3.0.1]
D:\programs-non-setup\AvisynthRepository\plugins\MPEG2Dec3.dll [1.0.1.0]
D:\programs-non-setup\AvisynthRepository\plugins\mt_masktools-25.dll [2.0.46.0]
D:\programs-non-setup\AvisynthRepository\plugins\mt_masktools-26.dll [2.0.46.0]
D:\programs-non-setup\AvisynthRepository\plugins\mt_masktools.dll [2005-08-21]
D:\programs-non-setup\AvisynthRepository\plugins\QTSource.dll [2011-02-19]
D:\programs-non-setup\AvisynthRepository\plugins\rawsource.dll [2006-07-28]
D:\programs-non-setup\AvisynthRepository\plugins\RemoveGrain.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\plugins\RemoveGrainS.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\plugins\RemoveGrainSSE2.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\plugins\RemoveGrainSSE3.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\plugins\Repair.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\plugins\RepairS.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\plugins\RepairSSE2.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\plugins\RepairSSE3.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\plugins\Rotate.dll [1.3.3.0]
D:\programs-non-setup\AvisynthRepository\plugins\RSharpen.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\plugins\RSharpenS.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\plugins\RSharpenSSE2.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\plugins\RSharpenSSE3.dll [2005-08-01]
D:\programs-non-setup\AvisynthRepository\plugins\TCPDeliver.dll [1.0.0.6]
D:\programs-non-setup\AvisynthRepository\plugins\TTempSmooth.dll [0.9.4.0]

[CPP 2.6 Plugins (32 Bit)]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\Average.dll [0.94.0.0]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\ConvertStacked.dll [2018-12-20]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\DePan.dll [2.13.1.3]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\DePanEstimate.dll [2.10.0.2]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\DirectShowSource.dll [2018-12-20]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\ImageSeq.dll [2018-12-20]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\masktools2.dll [2.2.18.0]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\MedianBlur2.dll [2014-02-10]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\mvtools2.dll [2.5.11.22]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\RgTools.dll [0.97.0.0]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\Shibatch.dll [2018-12-20]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\svpflow1.dll [4.2.0.133]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\svpflow2.dll [4.2.0.142]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\TimeStretch.dll [2018-12-20]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\TIVTC.dll [1.0.14.0]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\VDubFilter.dll [2018-12-20]
D:\programs-non-setup\AvisynthRepository\plugins\Average.dll [0.94.0.0]
D:\programs-non-setup\AvisynthRepository\plugins\DePan.dll [2.13.1.3]
D:\programs-non-setup\AvisynthRepository\plugins\DePanEstimate.dll [2.10.0.2]
D:\programs-non-setup\AvisynthRepository\plugins\DirectShowSource.dll [2.6.0.2]
D:\programs-non-setup\AvisynthRepository\plugins\masktools2.dll [2.2.18.0]
D:\programs-non-setup\AvisynthRepository\plugins\MedianBlur2.dll [2014-02-10]
D:\programs-non-setup\AvisynthRepository\plugins\mvtools2.dll [2.5.11.22]
D:\programs-non-setup\AvisynthRepository\plugins\RgTools.dll [0.97.0.0]
D:\programs-non-setup\AvisynthRepository\plugins\svpflow1.dll [4.2.0.133]
D:\programs-non-setup\AvisynthRepository\plugins\svpflow2.dll [4.2.0.142]
D:\programs-non-setup\AvisynthRepository\plugins\TIVTC.dll [1.0.14.0]

a1s2d3f4
28th February 2019, 13:33
Part 2:

[Scripts (AVSI)]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\AddAudio.avsi [2012-12-05]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\AnatolyAVISynthFunctions.avsi [2019-02-28]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\AutoLoadExternalPlugins.avsi [2012-01-08]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\colors_rgb.avsi [2005-07-05]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\dupped.avsi [2011-05-16]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\ffavisynth.avsi [2010-09-08]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\FFMS2.avsi [2013-05-20]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\GScript.avsi [2015-02-28]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\immaavs.avsi [2015-02-28]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\rawsource.avsi [2015-02-28]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\Srestore.avsi [2018-03-15]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\yadif.avsi [2015-02-28]
D:\programs-non-setup\AvisynthRepository\plugins\AddAudio.avsi [2012-12-05]
D:\programs-non-setup\AvisynthRepository\plugins\AnatolyAVISynthFunctions.avsi [2019-02-28]
D:\programs-non-setup\AvisynthRepository\plugins\AutoLoadExternalPlugins.avsi [2012-01-08]
D:\programs-non-setup\AvisynthRepository\plugins\colors_rgb.avsi [2005-07-05]
D:\programs-non-setup\AvisynthRepository\plugins\dupped.avsi [2011-05-16]
D:\programs-non-setup\AvisynthRepository\plugins\ffavisynth.avsi [2010-09-08]
D:\programs-non-setup\AvisynthRepository\plugins\FFMS2.avsi [2013-05-20]
D:\programs-non-setup\AvisynthRepository\plugins\GScript.avsi [2015-02-28]
D:\programs-non-setup\AvisynthRepository\plugins\immaavs.avsi [2015-02-28]
D:\programs-non-setup\AvisynthRepository\plugins\rawsource.avsi [2015-02-28]
D:\programs-non-setup\AvisynthRepository\plugins\Srestore.avsi [2018-03-15]
D:\programs-non-setup\AvisynthRepository\plugins\yadif.avsi [2015-02-28]

[Uncategorized DLLs (32 Bit)]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\AviSynth.dll [0.1.0.0]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\DevIL.dll [0.1.7.8]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\libavcodec.dll [2008-08-07]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\mpegdecoder.dll [1.0.0.1]
D:\programs-non-setup\AvisynthRepository\plugins\DevIL.dll [0.1.7.8]
D:\programs-non-setup\AvisynthRepository\plugins\libavcodec.dll [2008-08-07]
D:\programs-non-setup\AvisynthRepository\plugins\mpegdecoder.dll [1.0.0.1]

[Uncategorized files]
D:\programs-non-setup\AvisynthRepository\plugins\AVCQuickStart.html [2008-01-31]
D:\programs-non-setup\AvisynthRepository\plugins\Average-v0.94.7z [2019-02-28]
D:\programs-non-setup\AvisynthRepository\plugins\AviSynth.css [2006-12-25]
D:\programs-non-setup\AvisynthRepository\plugins\avisynth.h [2004-03-17]
D:\programs-non-setup\AvisynthRepository\plugins\AviSynth.lib [2006-12-31]
D:\programs-non-setup\AvisynthRepository\plugins\AviSynth_C.h [2006-03-28]
D:\programs-non-setup\AvisynthRepository\plugins\avisynthex.dll.zip [2011-10-12]
D:\programs-non-setup\AvisynthRepository\plugins\AVSInpaint.c [2008-02-23]
D:\programs-non-setup\AvisynthRepository\plugins\AVSInpaint.htm [2008-02-23]
D:\programs-non-setup\AvisynthRepository\plugins\AVSInpaint.Makefile.gcc.txt [2008-02-21]
D:\programs-non-setup\AvisynthRepository\plugins\AVSLib_v1-1-0-beta_src-setup_v2.zip [2011-12-01]
D:\programs-non-setup\AvisynthRepository\plugins\Bugs_Limitations.txt [2009-11-05]
D:\programs-non-setup\AvisynthRepository\plugins\Colorit.zip [2010-10-12]
D:\programs-non-setup\AvisynthRepository\plugins\COPYING.txt [2002-05-10]
D:\programs-non-setup\AvisynthRepository\plugins\dcraw.exe [2007-02-08]
D:\programs-non-setup\AvisynthRepository\plugins\DeBarrel.html [2011-09-15]
D:\programs-non-setup\AvisynthRepository\plugins\dedup.txt [2004-11-08]
D:\programs-non-setup\AvisynthRepository\plugins\defish.cpp [2010-05-01]
D:\programs-non-setup\AvisynthRepository\plugins\defish.txt [2010-05-01]
D:\programs-non-setup\AvisynthRepository\plugins\Demo.avs [2008-02-23]
D:\programs-non-setup\AvisynthRepository\plugins\dgavcdec109.zip [2012-10-21]
D:\programs-non-setup\AvisynthRepository\plugins\DGAVCDecodeManual.html [2009-03-10]
D:\programs-non-setup\AvisynthRepository\plugins\dgavcindex.bmp [2007-06-06]
D:\programs-non-setup\AvisynthRepository\plugins\DGAVCIndex.exe [1.0.9.0]
D:\programs-non-setup\AvisynthRepository\plugins\DGAVCIndex.ini [2017-06-08]
D:\programs-non-setup\AvisynthRepository\plugins\DGAVCIndexManual.html [2009-03-10]
D:\programs-non-setup\AvisynthRepository\plugins\DGDecodeManual.html [2010-03-06]
D:\programs-non-setup\AvisynthRepository\plugins\DGIndex.exe [1.5.8.0]
D:\programs-non-setup\AvisynthRepository\plugins\DGIndex.ini [2019-02-25]
D:\programs-non-setup\AvisynthRepository\plugins\DGIndexManual.html [2010-03-06]
D:\programs-non-setup\AvisynthRepository\plugins\DGVfapi.txt [2010-03-06]
D:\programs-non-setup\AvisynthRepository\plugins\DGVfapi.vfp [1.5.8.0]
D:\programs-non-setup\AvisynthRepository\plugins\exinpaint-rus.html [2011-09-16]
D:\programs-non-setup\AvisynthRepository\plugins\exinpaint.cbp [2008-01-14]
D:\programs-non-setup\AvisynthRepository\plugins\exinpaint.cpp [2008-01-30]
D:\programs-non-setup\AvisynthRepository\plugins\exinpaint.dsp [2008-01-14]
D:\programs-non-setup\AvisynthRepository\plugins\exinpaint.dsw [2008-01-14]
D:\programs-non-setup\AvisynthRepository\plugins\exinpaint.html [2011-09-16]
D:\programs-non-setup\AvisynthRepository\plugins\exinpaint.rc [2008-01-30]
D:\programs-non-setup\AvisynthRepository\plugins\ffmsindex.exe [2013-05-21]
D:\programs-non-setup\AvisynthRepository\plugins\fft3dfilter-rus.html [2007-12-02]
D:\programs-non-setup\AvisynthRepository\plugins\FFT3DFilter.cbp [2007-02-19]
D:\programs-non-setup\AvisynthRepository\plugins\FFT3DFilter.cpp [2007-02-20]
D:\programs-non-setup\AvisynthRepository\plugins\fft3dfilter.html [2007-12-02]
D:\programs-non-setup\AvisynthRepository\plugins\FFT3DFilter.rc [2007-02-20]
D:\programs-non-setup\AvisynthRepository\plugins\fft3dfilter_3dnow.cpp [2005-08-30]
D:\programs-non-setup\AvisynthRepository\plugins\fft3dfilter_c.cpp [2006-09-09]
D:\programs-non-setup\AvisynthRepository\plugins\fft3dfilter_sse.cpp [2006-05-11]
D:\programs-non-setup\AvisynthRepository\plugins\fftwlite.h [2006-11-27]
D:\programs-non-setup\AvisynthRepository\plugins\FullChanges.html [2010-03-06]
D:\programs-non-setup\AvisynthRepository\plugins\GNUGPLv2.txt [2006-11-04]
D:\programs-non-setup\AvisynthRepository\plugins\gpl-rus.txt [2003-11-29]
D:\programs-non-setup\AvisynthRepository\plugins\gpl.txt [2003-10-01]
D:\programs-non-setup\AvisynthRepository\plugins\GRunT101.zip [2019-02-28]
D:\programs-non-setup\AvisynthRepository\plugins\immaavs.htm [2010-07-18]
D:\programs-non-setup\AvisynthRepository\plugins\info.h [2003-05-02]
D:\programs-non-setup\AvisynthRepository\plugins\inpainted.jpg [2008-01-14]
D:\programs-non-setup\AvisynthRepository\plugins\inpainting.cpp [2008-01-30]
D:\programs-non-setup\AvisynthRepository\plugins\inpainting.h [2008-01-30]
D:\programs-non-setup\AvisynthRepository\plugins\LGhost.auf.avs [2002-12-24]
D:\programs-non-setup\AvisynthRepository\plugins\LGhost.txt [2003-03-17]
D:\programs-non-setup\AvisynthRepository\plugins\libavcodec.txt [2008-02-25]
D:\programs-non-setup\AvisynthRepository\plugins\makefile [2005-08-13]
D:\programs-non-setup\AvisynthRepository\plugins\masked.jpg [2008-01-14]
D:\programs-non-setup\AvisynthRepository\plugins\masktools2-v2.2.18.7z [2019-02-28]
D:\programs-non-setup\AvisynthRepository\plugins\mvtools-2.7.24-with-depans.7z [2018-01-15]
D:\programs-non-setup\AvisynthRepository\plugins\mvtools-v2.5.11.22.zip [2018-01-15]
D:\programs-non-setup\AvisynthRepository\plugins\original.jpg [2008-01-14]
D:\programs-non-setup\AvisynthRepository\plugins\overlap.gif [2005-04-05]
D:\programs-non-setup\AvisynthRepository\plugins\QTSource_20110219.zip [2011-05-16]
D:\programs-non-setup\AvisynthRepository\plugins\QuickStart.html [2006-02-23]
D:\programs-non-setup\AvisynthRepository\plugins\RawSource.htm [2006-07-28]
D:\programs-non-setup\AvisynthRepository\plugins\ReadMeFirstAVC.html [2009-03-10]
D:\programs-non-setup\AvisynthRepository\plugins\RemoveGrain.cpp [2005-08-01]
D:\programs-non-setup\AvisynthRepository\plugins\RemoveGrain.htm [2005-07-08]
D:\programs-non-setup\AvisynthRepository\plugins\RgTools-0.97.7z [2019-02-28]
D:\programs-non-setup\AvisynthRepository\plugins\Rm_logo.avs [2016-04-17]
D:\programs-non-setup\AvisynthRepository\plugins\rotate.html [2009-09-10]
D:\programs-non-setup\AvisynthRepository\plugins\Srestore 2.792.zip [2019-02-26]
D:\programs-non-setup\AvisynthRepository\plugins\Srestore_27h.avsiOLD [2016-04-16]
D:\programs-non-setup\AvisynthRepository\plugins\svpflow-4.2.0.142.zip [2018-01-15]



[Plugin errors/warnings]
________________________________________________________________________________________________________________________

'D:/programs-non-setup/AvisynthRepository/AVSPLUS_x86/plugins/avisynthex.dll' cannot be used as a plugin for AviSynth.

Note: CPP 2.0 Plugins are not supported by Avisynth+
________________________________________________________________________________________________________________________

'D:/programs-non-setup/AvisynthRepository/AVSPLUS_x86/plugins/LGhost1.dll' cannot be used as a plugin for AviSynth.

Note: CPP 2.0 Plugins are not supported by Avisynth+
________________________________________________________________________________________________________________________

'D:/programs-non-setup/AvisynthRepository/plugins/avisynthex.dll' cannot be used as a plugin for AviSynth.

Note: CPP 2.0 Plugins are not supported by Avisynth+
________________________________________________________________________________________________________________________

'D:/programs-non-setup/AvisynthRepository/plugins/LGhost1.dll' cannot be used as a plugin for AviSynth.

Note: CPP 2.0 Plugins are not supported by Avisynth+
________________________________________________________________________________________________________________________

Cannot load file 'D:/programs-non-setup/AvisynthRepository/AVSPLUS_x86/plugins/immaavs.dll'. Platform returned code 126:
The specified module could not be found.

Dependencies that could not be loaded:
CORE_RL_magick_.dll
________________________________________________________________________________________________________________________

Cannot load file 'D:/programs-non-setup/AvisynthRepository/plugins/immaavs.dll'. Platform returned code 126:
The specified module could not be found.

Dependencies that could not be loaded:
CORE_RL_magick_.dll
________________________________________________________________________________________________________________________

Groucho2004
28th February 2019, 13:39
:scared::scared::scared: Bloody hell, no wonder you have problems. I'll have to dig through this first. Actually, I think I'll tell you what not to remove, that'll be faster.

Groucho2004
28th February 2019, 13:54
OK, in order to make a clean start:

Remove everything in:
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins
D:\programs-non-setup\AvisynthRepository\plugins

except:

D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\ConvertStacked.dll [2018-12-20]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\DirectShowSource.dll [2018-12-20]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\ImageSeq.dll [2018-12-20]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\Shibatch.dll [2018-12-20]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\TimeStretch.dll [2018-12-20]
D:\programs-non-setup\AvisynthRepository\AVSPLUS_x86\plugins\VDubFilter.dll [2018-12-20]
D:\programs-non-setup\AvisynthRepository\plugins\Average.dll [0.94.0.0]
D:\programs-non-setup\AvisynthRepository\plugins\masktools2.dll [2.2.18.0]
D:\programs-non-setup\AvisynthRepository\plugins\RgTools.dll [0.97.0.0]
D:\programs-non-setup\AvisynthRepository\plugins\svpflow1.dll [4.2.0.133]
D:\programs-non-setup\AvisynthRepository\plugins\svpflow2.dll [4.2.0.142]
D:\programs-non-setup\AvisynthRepository\plugins\TIVTC.dll [1.0.14.0]
D:\programs-non-setup\AvisynthRepository\plugins\GRunT.dll [2008-09-27]


Grab the latest srestore avsi from here (https://pastebin.com/raw/JYBjMBvx)

Make a backup of the files you remove. You can later add plugins/avsi's AS NEEDED.

Report back if something's missing (probably a source filter but I don't know which one you use).

a1s2d3f4
28th February 2019, 17:39
I am doing exactly what you wrote. Cleaned out those folders (copied all plugins to "old" folders to draw upon as necessary).
Created a new srestore.avsi from your link.

I know I use plugins that are not listed in your "except" list, but like you suggested, I'll add them as needed.

I am slightly confused as to how the two plugin folders are used: should I have duplicates inside AVSPLUS_x86, or will AVISynth somehow know to look in both locations... /plugins as well as /AVSPLUS_x86/plugins/.

But anyway, here is what happens when I try to load my "srestore() problem" script.

1)
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
Script error: There is no function named 'DGDecode_Mpeg2source'.

So, then I try to add that, and I don't actually see it in my plugins folder at all, which makes me suspect that it is probably part of DGDecode.dll

... Yes, seems like that solved that problem.
Next complaint.

2) ---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
Script error: There is no function named 'Yadif'.


Ok, probably need Yadif.dll (there is also "yadif.avsi") but I am not sure if I should copy them both or not.
Just copying yadif.dll, seems happy.

3)
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
I don't know what 'AvsPlusVersionNumber' means.
(D:/programs-non-setup/AvisynthRepository/plugins/srestore.avsi, line 66)

...
and here I am stuck, because it appears to be some kind of "global variable" which isn't defined, I guess.

Any advice?

Reel.Deel
28th February 2019, 17:47
3)
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
I don't know what 'AvsPlusVersionNumber' means.
(D:/programs-non-setup/AvisynthRepository/plugins/srestore.avsi, line 66)

...
and here I am stuck, because it appears to be some kind of "global variable" which isn't defined, I guess.

Any advice?

Real.finder just updated srestore on Feb. 21st and this is one of the changes. Not sure why he does stuff like making scripts requiring functions in other scripts. Anywho, try copying the following to srestore.avsi

function IsAvsNeo()
{
FindStr(VersionString, "AviSynth Neo") != 0
}

function IsAvsPlus()
{
FindStr(VersionString, "AviSynth+") != 0 || IsAvsNeo
}

function AvsPlusVersionNumber()
{
IsAvsNeo ? eval(MidStr(VersionString(),20,4)) : IsAvsPlus ? eval(MidStr(VersionString(),17,4)) : 0
}

Groucho2004
28th February 2019, 18:03
3)
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
I don't know what 'AvsPlusVersionNumber' means.
(D:/programs-non-setup/AvisynthRepository/plugins/srestore.avsi, line 66)

...
and here I am stuck, because it appears to be some kind of "global variable" which isn't defined, I guess.

Any advice?
My bad, I thought I linked to the latest version of srestore. Just do what Reel.Deel suggested above.

ChaosKing
28th February 2019, 18:05
You need the latest smdegrain.avsi, it contains the IsAvsPlus() etc. functions.

Groucho2004
28th February 2019, 18:07
I am slightly confused as to how the two plugin folders are used: should I have duplicates inside AVSPLUS_x86, or will AVISynth somehow know to look in both locations... /plugins as well as /AVSPLUS_x86/plugins/.
AVS+ will look in both places. You can organise your plugins as you want. No duplicates necessary.

Reel.Deel
28th February 2019, 18:07
My bad, I thought I linked to the latest version of srestore. Just do what Reel.Deel suggested above.

You did link to the latest version, but now it requires those fuctions that are in the latest smdegrain.avsi (https://pastebin.com/raw/gCJCeQRV). :confused:

Groucho2004
28th February 2019, 18:10
You did link to the latest version, but now it requires those fuctions that are in the latest smdegrain.avsi. :confused:Oh, I see, got them mixed up, sorry.

ChaosKing
28th February 2019, 18:10
Blame real.finder not me :P

EDIT: I guess he just don't want to update always every file that contains this "versions" functions in case the logic changes. I would have made a seperate file though.

Groucho2004
28th February 2019, 18:13
Not sure why he does stuff like making scripts requiring functions in other scripts.Indeed, very confusing, particularly for people not so familiar with this stuff.

manolito
28th February 2019, 18:31
And you still refuse to call this "version hell" ? :devil:

real.finder
28th February 2019, 19:01
I already said this here https://forum.doom9.org/showpost.php?p=1866352&postcount=227

I will put this note in https://forum.doom9.org/showthread.php?t=174121 too

Real.finder just updated srestore on Feb. 21st and this is one of the changes. Not sure why he does stuff like making scripts requiring functions in other scripts.



Blame real.finder not me :P

EDIT: I guess he just don't want to update always every file that contains this "versions" functions in case the logic changes. I would have made a seperate file though.

yes, as ChaosKing said but my opinion as I said before https://forum.doom9.org/showthread.php?p=1805621#post1805621

Groucho2004
28th February 2019, 19:07
And you still refuse to call this "version hell" ? :devil:Where and when did I refuse to call "this" (not sure to what your "this" is referring) a version hell? I guess you first have to define "this" and then we can have a discussion without conjecture and ambiguity.

manolito
28th February 2019, 19:38
Where and when did I refuse to call "this" (not sure to what your "this" is referring) a version hell?

Here:
There is no version hell. All you have to do is download the plugins to which I linked in post #760 and put them in your auto-load directory.
And this statement is obviously not correct. If even AVS gurus like you get confused then I wonder how a "normal" user is expected to tackle it.

And by "this" I am referring to the posts from today starting with post #784. Some quotes:
and here I am stuck, because it appears to be some kind of "global variable" which isn't defined, I guess.
Real.finder just updated srestore on Feb. 21st and this is one of the changes. Not sure why he does stuff like making scripts requiring functions in other scripts. Anywho, try copying the following to srestore.avsi
My bad, I thought I linked to the latest version of srestore
You did link to the latest version, but now it requires those fuctions that are in the latest smdegrain.avsi.
Oh, I see, got them mixed up, sorry.
Indeed, very confusing, particularly for people not so familiar with this stuff.

If "this" is not version hell, then I'd like to know what is...

real.finder
28th February 2019, 19:50
Here:

And this statement is obviously not correct. If even AVS gurus like you get confused then I wonder how a "normal" user is expected to tackle it.

And by "this" I am referring to the posts from today starting with post #784.



If "this" is not version hell, then I'd like to know what is...

but this "hell" above to avoid the "hell" below ;)

Yeah, version hell again, this time not caused by Microsoft, but by the "AVS Plugins Modernization Effort" which started after the introduction of AVS+.

Basically users cannot mix older and newer versions of the AVSI scripts, the plugins these scripts depend on and the AVS versions. Everything needs to fit, a newer AVSI needs newer plugins plus a newer AVS+ version. No backward compatibility, going back from AVS+ to classic AVS requires to install older script and plugin versions.

Groucho2004
28th February 2019, 20:16
Here:
There is no version hell. All you have to do is download the plugins to which I linked in post #760 and put them in your auto-load directory.
Ripped out of context, cheap shot. I'm referring to AVS+ and plugins, as everyone except you understands.
And this is your post about version hell to which I objected:
Yeah, version hell again, this time not caused by Microsoft, but by the "AVS Plugins Modernization Effort" which started after the introduction of AVS+.
Yes, I agree that the srestore/smdegrain/qtgmc stuff is confusing but your generalizations are very irritating.

videoh
28th February 2019, 20:33
Doesn't manolito run a P3 with Windows XP? And we're supposed to take him seriously?

Groucho2004
28th February 2019, 20:41
Doesn't manolito run a P3 with Windows XP? And we're supposed to take him seriously?I don't think that running a P3 on XP is a reason to not take someone seriously, it's a choice. Until recently I had a P3 on Win2000 running a server. It just worked reliably for many years.

It's rather comments like this:
AVSI scripts are technically no plugins, but they are treated like plugins by AviSynth.

Groucho2004
28th February 2019, 20:46
If even AVS gurus like youI'm anything but an AVS guru. That's StainlessS' forte.

videoh
28th February 2019, 20:48
It would be a choice to run exclusively DOS apps on Windows 3.1, but nobody is going to take you seriously. :p

StainlessS
28th February 2019, 21:07
I'm anything but an AVS guru. That's StainlessS' forte.

You're talking rubbish again Grouchy :)

Groucho2004
28th February 2019, 21:17
You're talking rubbish again Grouchy :)That's so sweet. :o

StainlessS
28th February 2019, 21:47
Mani,

You could try Groucho2004 AOI installer, setup, ie copy you current plugs into the VideoPrograms/Avisynthsetup/... (or whatever it is)
and it should work just fine after running the batch setup file.
As time and your bravery permits, you could try setup for avs+ x86 (also x64) and if you experience any probs, then just switch
setup back to whatever one you wish, not really any kind of problem.
Plugin dll's usually will provide fewer problems since they tend (on average) not to call other plugin dll's, the biggest problem is
most likely script functions, where they have many plugin requirements and have no idea which version of a plugin that you have installed.
Just make backup after successful update, and life can be so very sweet for you. I'm sure that if you try, you could well become a convert,
even if some of your machines are P3 XP32.

Groucho2004, dont know if is currently supported (I recently have only been updating dll's in you AIO installer thing, and leaving batch alone),
but perhaps could auto switch (via some additional setup dir) to copy non avs dll's to the system32 or SysWoW64 whatsit, so that could be done
automaticlly too.

(2nd time I've wrritten something akin to above, 1st time browser started going nuts and swallowed everything I'de written)

manolito
28th February 2019, 22:00
You guys missed the fact (which I stated frequently) that this old P3 is not my only computer. For AVS+ of course I use one of my ThinkPads T530 with an Intel Core i5 third generation. Probably not a "fairly modern CPU" in your book, but things which do require newer and faster CPUs than this one will simply get ignored by me.

A side note to DG: On your website you explicitly make it clear that NVidia Graphics in Notebooks are not supported by you. My ThinkPad has the NVidia Optimus feature which is also explicitly excluded from your support, so please forgive me if I am not really eager to check out your source filters.

One of the consequences using different computers in parallel is that I do not want to maintain very different AVS plugin folders. All plugins I use need to work on all of my machines. And the old P3 is the lowest common denominator. After many tests I concluded that the speed gains when using the latest plugin versions on my ThinkPad are minimal, not worth the effort.

So if anyone does not take me seriously because I still want to use my old computer (the mainboard is from 2001) I couldn't care less. I do have my reasons, I do not like to waste resources, and to me it does not feel like a sacrifice. My motorcycle is from 1991, I do a long trip every year, it is absolutely reliable, the modern bikes do nothing for me. So please, you do not have to agree with me, but keep your derogatory comments like this one:
Doesn't manolito run a P3 with Windows XP? And we're supposed to take him seriously?
to yourself.


Cheers
manolito

ChaosKing
28th February 2019, 22:00
If anyone wants to test it. I added srestore to avsrepo https://github.com/theChaosCoder/vsrepo/releases
usage:
avsrepo.exe -p install srestore
This will download all plugins in a avisynth32/avisynth64 folder, use -t win32 or -t win64 for your plattform.

(since smdegrain is a dependency of srestore now, it will install also all its dependencies)

StainlessS
28th February 2019, 22:22
Thanx CK, gonna give it a whirl.

Mani, I too used to use an AMD IronSides chipset 500MHz P3 m/c and hated junkin' it, me loved that little doofa,
was way better than equiv Intel whotsit of the time. (Actually, I still have an Atari ST with a 1/2 GB hard drive
[at one time 16 partitions, had to reduce that, was too confusing] and an Amiga 1200 with 10MB RAM [assign 2MB for RamDisk just cos I dont know what else to do with it].
I am now however past the P3 thing, having just dumped two P4 machines, as somebody on-site says in sig,
"Nostalgia aint what it used to be".

EDIT: 1st hard drive for the Atari cost me Ģ400 pound for a 20MB drive, Arh, the good old days.

Groucho2004
28th February 2019, 23:01
Groucho2004, dont know if is currently supported (I recently have only been updating dll's in you AIO installer thing, and leaving batch alone),
but perhaps could auto switch (via some additional setup dir) to copy non avs dll's to the system32 or SysWoW64 whatsit, so that could be done
automaticlly too.What non-AVS dll's?

StainlessS
28th February 2019, 23:22
Mobile (In pub), fft3d.dll or whatever to system32, + the directshowsource dll (cant remember name)
I mean the image/jpeg thing.

Gonna catch my bus, sorry.

ChaosKing
28th February 2019, 23:34
libfftw3-3.dll is not part of the installer and as far as I can see it libfftw*.dll can stay in plugins (avs+ only). I don't have it system32, only in my plugins folder and everything works.

Groucho2004
1st March 2019, 00:41
I don't have it system32, only in my plugins folder and everything works.That only works if your PATH environment variable points to that plugin directory.

real.finder
1st March 2019, 06:49
That only works if your PATH environment variable points to that plugin directory.

Note: Starting from version 2012.04.03 plugin's folder is searched first for its dll dependences. You can now move some things from system32 folder to plugins folder, but check that there are no unexpected old dll versions in plugins folder in case you see strange errors.

from

https://forum.doom9.org/showthread.php?t=148782

avs+ take this from SEt avs mt

StainlessS
1st March 2019, 10:11
I personally dont like non Avs dll's in plugins, would rather install in sytem32 or the other SysWOW64 dir.

Ones I copy to above dirs


AvsRecursion.dll
fftw3.dll
libfftw3f-3.dll
libsndfile-1.dll


Think AvsInstaller already copies DevIL.dll (the one I could not remember name of in pub).

Groucho2004
1st March 2019, 10:46
Note: Starting from version 2012.04.03 plugin's folder is searched first for its dll dependences. You can now move some things from system32 folder to plugins folder, but check that there are no unexpected old dll versions in plugins folder in case you see strange errors.
Just tried this with AVSMT and AVS+ - Does not work (on XP, have to try W7).

Groucho2004
1st March 2019, 10:48
I personally dont like non Avs dll's in plugins, would rather install in sytem32 or the other SysWOW64 dir.Ditto.

Think AvsInstaller already copies DevIL.dll (the one I could not remember name of in pub).Yes, it does. DevIL.dll is a dependency of avisynth.dll.

a1s2d3f4
1st March 2019, 16:06
Ok, so I followed directions from post #785 and copied the defined functions to the bottom of srestore.avsi

Continued with my loading attempts.

(I also included a couple of AVSIs I had written myself in the past which all my scripts use.)
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
Script error: There is no function named 'GScript'.
(D:/programs-non-setup/AvisynthRepository/plugins/AnatolyAVISynthFunctions.avsi, line 67)
...

So, I copied gscript.dll (date modified says 12/6/2009).

---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
Script error: There is no function named 'MSuper'.
...

That's from mvtools2.dll - latest version I could find was from 4/26/2016.
----

And so at this point, indeed, it finally loads and, hooray, I have utf8 support for subtitles.

Also, I do see that the processing speed is not as sluggish as before on my W540 Lenovo (especially with svpflow frame interpolation stuff).

Thanks to everyone for their help.

I guess the only other thing that I could work on is to implement AVSPLUS_x64 to see if my hardware can deliver even faster processing speeds.
I understand that all the .dlls have to be "64 bit" versions for this to work.
So, I am going to try to gather the x64 dll versions of all the plugins I use and stick them in a plugins64 folder (which I would specify in setavs.bat as set PLUGDIR64=D:\programs-non-setup\AvisynthRepository\plugins64).
It also appears that I would need to rewrite my "personal functions" (in AVSI files) using AVSPLUS native if/then format, without using Gscript.dll (from 2009).
Am I correct in thinking this and if so, is there a way to have a single .avsi file that can work for both versions (x86 and x64)?
(If this question shouldn't be in the thread, I'll be happy to ask it in a General Discussion thread)

#EDIT
I also understood from some posts that "avsi files" shouldn't be considered as "plugins". Should I have a separate folder for those, or is it ok for them to continue living inside the plugins folder like they'd always done?

poisondeathray
1st March 2019, 16:35
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
Script error: There is no function named 'MSuper'.
...

That's from mvtools2.dll - latest version I could find was from 4/26/2016.
----


mvtools2 pinterf branch
https://github.com/pinterf/mvtools/releases





I guess the only other thing that I could work on is to implement AVSPLUS_x64 to see if my hardware can deliver even faster processing speeds.
I understand that all the .dlls have to be "64 bit" versions for this to work.
So, I am going to try to gather the x64 dll versions of all the plugins I use and stick them in a plugins64 folder (which I would specify in setavs.bat as set PLUGDIR64=D:\programs-non-setup\AvisynthRepository\plugins64).
It also appears that I would need to rewrite my "personal functions" (in AVSI files) using AVSPLUS native if/then format, without using Gscript.dll (from 2009).
Am I correct in thinking this and if so, is there a way to have a single .avsi file that can work for both versions (x86 and x64)?
(If this question shouldn't be in the thread, I'll be happy to ask it in a General Discussion thread)

x64 is definitely faster ; and the difference becomes larger, the more complex the scripts as you hit memory limits

You can use multithreading to speed things up (avs+ mt is faster than the old avs classic mt)

What is different about your "personal" avsi's ? You should be able to use the same for each x86/x64, unless they have specific references to versions (such as specific .dll's) - but that's bad practice for a general .avsi . I would argue you should do a better job of organizing the .avsi's then

Having all that clutter in plugins folder actually slow things down on initialization. Clean plugins folder makes things start faster. Only load things that you need, or keep frequently used things there. I'm surprised the old avisynth even worked with multiple mvtools2 /masktools versions in there, even from 2.5


#EDIT
I also understood from some posts that "avsi files" shouldn't be considered as "plugins". Should I have a separate folder for those, or is it ok for them to continue living inside the plugins folder like they'd always done?
You can keep them, but I wouldn't keep so much clutter . It can cause problems

a1s2d3f4
1st March 2019, 16:41
What is different about your "personal" avsi's ? You should be able to use the same for each x86/x64, unless they have specific references to versions (such as specific .dll's) - but that's bad practice for a general .avsi . I would argue you should do a better job of organizing the .avsi's then


My avsi's use GScript to allow me to have conditional statements in my functions. Gscript.dll is from 2009 and it is probably a 32-bit plugin.

So, my question was about that.
Right now I have:


function AddBorders_AIL( clip incoming_clip, float w_to_h_ratio ) {
.....
GScript("""
if(.....

...
""")


Do I need to create an alternative avsi that eliminates GScript( ) call:

function AddBorders_AIL( clip incoming_clip, float w_to_h_ratio ) {
.....
if(.....

...
)

or can I, somehow, keep my original code, and still use it as part of the x64 environment?

poisondeathray
1st March 2019, 16:48
There is a gscript x86 and a gscript x64 . You can use the same code, same script. It should be identical for everything in terms of scripts and .avsi's . The problem you might have is if there are specific references to plugin loading (e.g. LoadPlugin() , and it references an x86 version explicitly) - but that's just bad form

If you use x64 application eg. avspmod x64 , or vdub2 x64, or ffmpeg x64, x264 x64 etc... - it will initialize the avs x64 pathway . If you use x86 app, it will initialize the x86 pathway

There are still a few "missing" x64 avs plugins, but the majority of commonly used ones have x64 versions by now

a1s2d3f4
1st March 2019, 16:53
mvtools2 pinterf branch
https://github.com/pinterf/mvtools/releases


I used this link to "update" my mvtools2.dll and it ended up breaking my script.

---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
MFlowFps: inconsistent clips frame size!

Going back to the 04/26/2016 version of mvtools2.dll fixes the problem.

ChaosKing
1st March 2019, 16:54
Am I correct in thinking this and if so, is there a way to have a single .avsi file that can work for both versions (x86 and x64)?


I solved it like this
VersionString: AviSynth+ 0.1 (r2772, MT, i386)
PluginDir2_5 (HKLM, x86): D:\AvisynthRepository\AVSPLUS_x86\plugins
PluginDir+ (HKLM, x86): D:\AvisynthRepository\SCRIPTS

VersionString: AviSynth+ 0.1 (r2772, MT, x86_64)
PluginDir2_5 (HKLM, x64): D:\AvisynthRepository\AVSPLUS_x64\plugins
PluginDir+ (HKLM, x64): D:\AvisynthRepository\SCRIPTS

poisondeathray
1st March 2019, 16:55
I used this link to "update" my mvtools2.dll and it ended up breaking my script.

---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
MFlowFps: inconsistent clips frame size!

Going back to the 04/26/2016 version of mvtools2.dll fixes the problem.

Post your full script

a1s2d3f4
1st March 2019, 16:56
There is a gscript x86 and a gscript x64 .

Could you tell me where to download?

On the Gscript download page I only see this file: GScript_11.zip.

Inside, I only see one dll.

poisondeathray
1st March 2019, 16:58
My bad, I thought you mean grunt, not gscript :o

(You can run x86 plugins in x64 environment with mp_pipeline )

a1s2d3f4
1st March 2019, 17:00
Post your full script

Ok, here is my script.
The problem it complained about is the MFlowFps call at the bottom


#Load some necessary tools
SetMemoryMax( 1024 )
LoadPlugin("D:\programs-non-setup\AvisynthRepository\plugins\svpflow1.dll" )
LoadPlugin("D:\programs-non-setup\AvisynthRepository\plugins\svpflow2.dll" )
#
#AVISynth file script below:
video_file = "F:\PRODUCTS\PerformanceVideos\SoloPerformer(withOccasionalPartner)\_DVDs\MediciArts\Cziffra-Moiseiwitsch-Bolet\VIDEO_TS\VTS_01_1.d2v.bad.d2v"
audio_file = "F:\PRODUCTS\PerformanceVideos\SoloPerformer(withOccasionalPartner)\_DVDs\MediciArts\Cziffra-Moiseiwitsch-Bolet\VIDEO_TS\VTS_01_1 Ta0 48K 16bit 2ch.wav"
# Define start and stop variables
beg_clip_len_in_secs = 7
end_clip_len_in_secs = 10
#Load in the file
audio = WavSource( audio_file )
v1 = DGDecode_Mpeg2source( video_file )
my_fps = v1.framerate
#Calculate variables (these can be copied multiple times if there happen to be multiple artists in the same video)
#Name of Piece: Grand Galop Chromatique
start_time_of_track_in_sec = 2857.5
start_frame = Round( my_fps * start_time_of_track_in_sec )
end_time_of_track_in_sec = 3043
end_frame = Round( my_fps * end_time_of_track_in_sec )
total_frames = end_frame - start_frame
audio_delay_value = 1.32

#Mux Audio and Video then clean up further
v1 = AudioDub( v1, audio )
v1 = DelayAudio( v1, audio_delay_value)
v1 = Trim( v1, start_frame, end_frame )

#
v1 = Crop( v1, 0, 0, 0, 0 )

v1 = ConvertToYV12( v1 )

v1 = Yadif( v1, 1, 0 )

#NTSC->PAL
# The next line only applies if we have an originally PAL video upconverted to NTSC (where every 5th frame is doubled)
v2 = Trim( v1, 0, 9999999 ).srestore( )
#You also do have to convert to RGB for mixing with titles lower
v2 = ConvertToRGB( v2 )

#Create a gentle fade in out
v2 = AddFadeInOut( v2, 5, 5, 0, 0, 0 )

#Create title frames
v200 = v2
begin = BlankClip( v200, Round( beg_clip_len_in_secs * v200.framerate ) )
end = BlankClip( v200, Round( end_clip_len_in_secs * v200.framerate ) )
v2 = begin + v200 + end

w_to_h_ratio = Float( 16 ) / 9
v2 = AddBorders_AIL( v2, w_to_h_ratio )

titles = "
\n\n
György Cziffra\n
London, 1962\n
\n\n\n
'Grand Galop Chromatique'\n
Franz Liszt"
title_size = v1.width / 21
v2 = ConvertToRGB24( v2 )
global desired_pixel_type = "RGB24"
global desired_video_width = v2.width
global desired_video_height = v2.height
tit = DefineTitleClip( v2, titles, beg_clip_len_in_secs - 1, 1, 1, "Georgia", $bbbbbb, title_size )


v2 = uu_mt_blend( v2, tit, mode = "exclude")
ConvertToY8( v2 ).ConvertToYV12( )

#Frame interpolation block

num_frames = 12
super = SVSuper( "{pel: 2, gpu: 1}" )
vectors = SVAnalyse( super, "{overlap: 4}" )
forward_vec = SVConvert( vectors, false )
backward_vec = SVConvert( vectors, true )
super_mv = MSuper( pel = 2, hpad = 0, vpad = 0 ) #padding should be zero here!
v100 = MFlowFps( super_mv, backward_vec, forward_vec, num = num_frames * FramerateNumerator( last ), den = FramerateDenominator( last ) )


v200 = ConvertToY8( v100 ).AssumeFPS( 300 )
# return v200
v200 = ChangeFPS( v200, 60 )
return v200

StainlessS
1st March 2019, 17:02
AVS+ can run GScript While and For/Next and If() Else type stuff, but you need to remove the

GScript("""
...
""")

wrapping stuff.Its easier (on x86) to keep GScript in plugins, and so dont need to strip wrapper, but x64 need strip wrapper.[as no x64 version GScript]

EDIT:
The Wiki gives the impression that you dont need to have GSCript(""" ... """) for the gscript functionality, when it should say that you have to remove
the wrapper else it produces an error (unless you install the Gscript plugin on x86).

a1s2d3f4
1st March 2019, 17:06
AVS+ can run GScript While and For/Next and If() Else type stuff, but you need to remove the

GScript("""
...
""")

wrapping stuff.Its easier (on x86) to keep GScript in plugins, and so dont need to strip wrapper, bug x64 need strip wrapper.

That's what I understood, that AVS+ has a native way of dealing with if() else(). But my question was, given that most of my functions are coded to use the GScript(""" .... """) approach, should I create separate, very similar version of each function where all I do is I strip out GScript(""" .... """), or is there a way to NOT to have to do that and still be able to use my functions with x86 or x64 avisynth?

StainlessS
1st March 2019, 17:15
If you have a function that is called rarely (a couple of times per frame serve, ie not like every frame),
then I use something like below


myName="a1s2d3f4_Stuff: "
IsAvsPlus=(FindStr(UCase(versionString),"AVISYNTH+")!=0) HasGScript=RT_FunctionExist("GScript")
HasGRunt =RT_FunctionExist("GScriptClip") HasMvTools=RT_FunctionExist("MSuper")
HasMaskTools=RT_FunctionExist("MT_Lutxy") HasRemoveGrain=RT_FunctionExist("RemoveGrain")
HasCallCmd = RT_FunctionExist("CallCmd") IsAvs26=VersionNumber>=2.6

Assert(IsAvsPlus || HasGScript,RT_String("%sNeed either GScript or AVS+",myName))

...

GS = """
# Some if/else type Gscript Stuff
"""

HasGScript ? GScript(GS) : Eval(GS) # Use GSCript if installed (loaded plugs override builtin)

...


EDIT: Above will work on Avs Standard 32 bit with Gscript, or avs+ x86 with/without GScript, and x64 without the non existing x64 Gscript.

a1s2d3f4
1st March 2019, 17:24
If you have a function that is called rarely (a couple of times per frame serve, ie not like every frame,
then I use something like below


IsAvsPlus=(FindStr(UCase(versionString),"AVISYNTH+")!=0) HasGScript=RT_FunctionExist("GScript")
HasGRunt =RT_FunctionExist("GScriptClip") HasMvTools=RT_FunctionExist("MSuper")
HasMaskTools=RT_FunctionExist("MT_Lutxy") HasRemoveGrain=RT_FunctionExist("RemoveGrain")
HasCallCmd = RT_FunctionExist("CallCmd") IsAvs26=VersionNumber>=2.6

...

GS = """
# Some if/else type Gscript Stuff
"""

HasGScript ? GScript(GS) : Eval(GS) # Use GSCript if installed (loaded plugs override builtin)

...



This looks interesting. Is this the kind of thing where if GScript(GS) needs to get called then my script automatically gets loaded as the slower x86 process, and if not, then "I am lucky"?

poisondeathray
1st March 2019, 17:26
Ok, here is my script.
The problem it complained about is the MFlowFps call at the bottom


Testing the frame interpolation section of that script - there is some bugginess to the svpflow vectors . Not sure why. It works some of the time , but I can reproduce the error message some of the time too. If you drag the slider (in vdub2, or avspmod), or open/close it , it works here

Or replacing with mvtools2 vectors work too without the bugginess

StainlessS
1st March 2019, 17:32
I forgot to add this after first block and before 1st '...'

Assert(IsAvsPlus || HasGScript,RT_String("%sNeed either GScript or AVS+",myName))

It just selects Gscript if installed and builtin avs+ Gscript if not, the only reason not to use where frequent calls is that it creates a GS string on every call,
so could swallow vast amounts of memory if the GS string is a large code block & called every frame.

EDIT: (repeating edit from prev post) Above will work on Avs Standard 32 bit with Gscript, or avs+ x86 with/without GScript, and x64 without the non existing x64 Gscript.

a1s2d3f4
1st March 2019, 17:58
I forgot to add this after first block and before 1st '...'

Assert(IsAvsPlus || HasGScript,RT_String("%sNeed either GScript or AVS+",myName))

It just selects Gscript if installed and builtin avs+ Gscript if not, the only reason not to use where frequent calls is that it creates a GS string on every call,
so could swallow vast amounts of memory if the GS string is a large code block.

EDIT: (repeating edit from prev post) Above will work on Avs Standard 32 bit with Gscript, or avs+ x86 with/without GScript, and x64 without the non existing x64 Gscript.

Ok, thanks, I'll try to recode my avsi file this way.
If I understand correctly, your code blocks will have to be repeated inside each of my functions that use GS statements
[CODE]
function whatever ( ) {
<your block goes here>
....
return something
}

as opposed to having your code block appear only once at the top of AVSI file and then having a local definition of GS= inside each of my many functions.

StainlessS
1st March 2019, 18:04
I would include in each function,
the other stuff for eg MvTools and RemoveGrain was just to give a few other examples, and not needed,
you only need the IsAvsPlus and HasGScript bits.
If you will always use Avs+ (and never again standard v2.6), then you can skip the IsAvsPlus related parts, eg can remove the Assert (if always IsAvsPlus).

EDIT:
You could in an avsi, use something like below, but I am yet to do anything like that. [EDIT: Ie only single instance of the Global String]

Global HasGScript_A_Unique_Name_Untouched_by_human_hand = RT_FunctionExist("GScript") # Unique to this avsi file, can use in multiple places/functions

Global GS_Some_Very_Unique_Name_that_is_Unlikely_To_be_used_by_anything_else="""
# some Gscipt Code
"""
Function MyFunc(clip c) {

HasGScript_A_Unique_Name_Untouched_by_human_hand
\ ? GScript(GS_Some_Very_Unique_Name_that_is_Unlikely_To_be_used_by_anything_else)
\ : Eval(GS_Some_Very_Unique_Name_that_is_Unlikely_To_be_used_by_anything_else)
return whatever
}


EDIT: Could also replace RT_FunctionExist("GScript") with FunctionExists("GScript") # Note the additional 's'. (if always Avs+)

a1s2d3f4
1st March 2019, 18:13
I would include in each function,
the other stuff for eg MvTools and RemoveGrain was just to give a few other examples, and not needed,
you only need the IsAvsPlus and HasGScript bits.
If you will always use Avs+ (and never again standard v2.6), then you can skip the IsAvsPlus related parts, eg can remove the Assert (if always IsAvsPlus).



I'd like to "always" use AVS+. I am just worried that if in the future I run into some plugin that is not "supported" by AVS+ or something like that, I would need to go back to the standard AVS, in which case I would want my Gscript("""....""") stuff to work too.

StainlessS
1st March 2019, 18:26
Then you need the IsAvsPlus, Assert, and must use RT_FunctionExist() too.

EDIT: If Avs+ was bright enought to skip over the GScript(""" ... """) parts, most/all of this would be un-needed, however it would probably complicate the parser for Avs+
and is probably unlikely to ever happen.

a1s2d3f4
2nd March 2019, 20:38
Then you need the IsAvsPlus, Assert, and must use RT_FunctionExist() too.

EDIT: If Avs+ was bright enought to skip over the GScript(""" ... """) parts, most/all of this would be un-needed, however it would probably complicate the parser for Avs+
and is probably unlikely to ever happen.

Kinda like C Preprocessor works.
#ifdef regular AviSynth
GScript("""
#endif

....

#ifdef regular AviSynth
""")
#endif

Of course, given that # is used for comments in AVS, it would be a different special character

StainlessS
2nd March 2019, 22:35
Kinda like C Preprocessor works.


Yep, that would work (in AVS+ but not Avs standard), I was more thinking of the wrapping simply being optional in Avs+ [if exists then just ignore it].

a1s2d3f4
3rd March 2019, 23:01
Or replacing with mvtools2 vectors work too without the bugginess

Could you explain what you mean in more detail?

I know that if I do that entire block of code, I get frame interpolation.
For a long time I was using mvtools2 functions, as described on this page: https://avisynth.org.ru/mvtools/mvtools2.html

Then last year I tried svpflow and found it to do an even better job, so now I'd like to use its functionality.

poisondeathray
4th March 2019, 00:40
Could you explain what you mean in more detail?

I know that if I do that entire block of code, I get frame interpolation.
For a long time I was using mvtools2 functions, as described on this page: https://avisynth.org.ru/mvtools/mvtools2.html

Then last year I tried svpflow and found it to do an even better job, so now I'd like to use its functionality.


I mean use mvtools2 vectors instead of svconvert . You can also use SVSmoothFps instead of MFlowFPS; that combo doesn't seem to be as buggy

svpflow (in general) produces slightly worse results in my experience, and GPU worse than CPU (hundreds of tests, different types of content). Of course you can tweak the settings, just like you can tweak many settings with mvtools2. But others have posted similar findings

Natty
14th March 2019, 11:31
can someone help me in removing ghosting/blending in this clip ? i dont understand exactly what type of artifact is this. i tried plain qtgmc + srestore and

QTGMC(Preset = "Slower", InputType=0, NoiseProcess=0)
srestore(mode=4, thresh=44)

but cant fix it completely or reduce it to minimum. heres the sample source and encoded clip

https://www34.zippyshare.com/v/wpy3Lzha/file.html

SaurusX
14th March 2019, 20:11
I didn't look, but I can immediately recommend not using QTGMC as your detection clip for sretore. The best results come from simpler bobs. However, you can still using the frames generated by QTGMC by running both at the same time like so:

FFmpegSource2("....")
d=TDeint(mode=1, type=2, full=false, tryWeave=true)
QTGMC(Preset = "Slower", InputType=0, NoiseProcess=0)
srestore(frate=23.976, speed=-1, thresh=1, dclip=d, mode=4)

Yes, these are aggressive srestore parameters, so I'd suggest bumping up the thresh value until the filter stops working well. You might want to try mode=-4 also, since sometimes srestore will work better by analyzing the chroma instead of the luma. It's kind of an art using srestore since no one method seems to work best all the time.

Boulder
14th March 2019, 20:26
I've also had better results sometimes by downscaling the analysis clip with ReduceBy2() after bobbing it.

Boulder
15th March 2019, 11:27
Here's one strange case I've been trying to fix.

https://drive.google.com/open?id=1oIAK_ixeGrQ1Oqn5PiPD71KtYKHKyZsp (original clip)
https://drive.google.com/open?id=1O1uKGsvamTMP33vkNodNAplNFP5oUVnw (bobbed clip)

I tried figuring out a pattern with a that bobbed clip and it looks like 4 good frames, 2 blended ones. Then if you look closer, it looks more like 3 good frames and 3 blended ones where the middle one is a real blended mess and the surrounding frames much less so :( Is it something that cannot be handled by SRestore as the origins seem to be an interlaced clip?

simple_simon
4th August 2019, 21:49
I'm using the latest version of the script (2.796) with the latest avisynth+ x64 and all the latest necessary plugins (masktools, etc) and I'm getting an error complaining "I don't know what 'avsplusversionnumber' means". I tried usiing 2.795 but with that one it complains about not knowing what 'dm' means. I looked at the script and both things are specified so it should 'know' what it means. What am i doing wrong? I can't find any mention of this in the previous entries of this thread.

real.finder
4th August 2019, 21:56
I'm using the latest version of the script (2.796) with the latest avisynth+ x64 and all the latest necessary plugins (masktools, etc) and I'm getting an error complaining "I don't know what 'avsplusversionnumber' means". I tried usiing 2.795 but with that one it complains about not knowing what 'dm' means. I looked at the script and both things are specified so it should 'know' what it means. What am i doing wrong? I can't find any mention of this in the previous entries of this thread.

you need SMDegrain.avsi (v3.1.2.101s or up) (https://forum.doom9.org/showthread.php?p=1790702#post1790702)

hello_hello
4th August 2019, 23:03
I'm using the latest version of the script (2.796) with the latest avisynth+ x64 and all the latest necessary plugins (masktools, etc) and I'm getting an error complaining "I don't know what 'avsplusversionnumber' means". I tried usiing 2.795 but with that one it complains about not knowing what 'dm' means. I looked at the script and both things are specified so it should 'know' what it means. What am i doing wrong? I can't find any mention of this in the previous entries of this thread.

The functions for checking the Avisynth version don't come with SRestore. They come with SMDegrain. Given it's only a few lines, I'd also include the functions with the SRestore script myself, so people won't have this problem, but that's just me and it's not up to me.

Here's what you're missing if you don't want to download the latest SMDegrain, you could add it to the end of the SRestore script if you have it in the auto-loading Avisynth plugins folder, or you could create a separate avsi file etc.

function IsAvsNeo(){ FindStr(VersionString, "AviSynth Neo") != 0 }
function IsAvsPlus(){ FindStr(VersionString, "AviSynth+") != 0 || IsAvsNeo }
function AvsPlusVersionNumber(){ \
IsAvsNeo ? eval(MidStr(VersionString(),20,4)) : \
IsAvsPlus ? val(MidStr(VersionString(),17,4)) : 0 }

simple_simon
5th August 2019, 19:29
Thanks for letting me know. I thought I had latest one (smdegrain_v3.1.2.100s) but guess not. Downloading SMDegrain v3.1.2.104s solved the 'avsplusversionnumber' error but now it's throwing up "I don't know what 'dm' means" error. Anyone know what that one's about?

real.finder
5th August 2019, 20:03
Thanks for letting me know. I thought I had latest one (smdegrain_v3.1.2.100s) but guess not. Downloading SMDegrain v3.1.2.104s solved the 'avsplusversionnumber' error but now it's throwing up "I don't know what 'dm' means" error. Anyone know what that one's about?

what is your full srestore line?

simple_simon
5th August 2019, 22:29
srestore(frate=24.975, thresh=14, cache=8)

real.finder
6th August 2019, 01:40
srestore(frate=24.975, thresh=14, cache=8)

work fine for me

edit: are you using MT Prefetch() in avs+? if yes then that known thing that mt not work (yet) with real-time functions like srestore

simple_simon
6th August 2019, 02:24
Ahhh! That's what it was. Thank you.

What's it mean that a filter is a realtime filter and how do i tell to avoid using prefetch with them?

real.finder
6th August 2019, 05:46
Ahhh! That's what it was. Thank you.

What's it mean that a filter is a realtime filter and how do i tell to avoid using prefetch with them?

http://avisynth.nl/index.php/Runtime_environment

foobar2000
16th March 2020, 00:08
PAL with blends.. hard to deal with..

hi folks I came across two PAL dvds, both with blends..

the first one is progessive but I tried many filters can't fix it, seems to be hard double-telecine?

the second is interlaced with more blends, even more messy

the first one is TFF, second one BFF

here're the samples, thanks a lot

http://www.mediafire.com/file/biwgkp...PAL_blends.rar

manolito
24th May 2020, 23:40
Follow-up to this old post:
https://forum.doom9.org/showthread.php?p=1844334#post1844334

So using an old MaskTools version together with a new SRestore script will not work, but what about the other way around?

Using an old SRestore script (v 2.7e) with he latest pinterf MaskTools2 version? Is this safe if I stay away from Hi BitDepth and Hi Color?

real.finder
25th May 2020, 04:48
Follow-up to this old post:
https://forum.doom9.org/showthread.php?p=1844334#post1844334

So using an old MaskTools version together with a new SRestore script will not work, but what about the other way around?

Using an old SRestore script (v 2.7e) with he latest pinterf MaskTools2 version? Is this safe if I stay away from Hi BitDepth and Hi Color?

if you use new masktools then why you need old SRestore?!!

anyway it should work, new SRestore should also work with old masktools2 in avs 2.5 but new SRestore in avs 2.6 or avs+ will need new masktools2

manolito
25th May 2020, 12:39
:thanks:

The reason because I want to keep the old SRestore script is that I use at least three different computers for my video conversions, and one of them is my ancient WinXP machine with with a P3 Coppermine CPU (no SSE2), and I do not want to maintain different plugin folders with different versions of the filters. Least common denominator, and this means using older plugins from the pre "modernization effort" era. And this old SRestore version 2.7e has always worked well for me...

real.finder
25th May 2020, 12:53
:thanks:

The reason because I want to keep the old SRestore script is that I use at least three different computers for my video conversions, and one of them is my ancient WinXP machine with with a P3 Coppermine CPU (no SSE2), and I do not want to maintain different plugin folders with different versions of the filters. Least common denominator, and this means using older plugins from the pre "modernization effort" era. And this old SRestore version 2.7e has always worked well for me...

you can ask pinterf for c only build :devil:

anyway you have others like 2.7i or older like 2.7g, should work with older masktools

real.finder
31st May 2020, 14:47
:thanks:

The reason because I want to keep the old SRestore script is that I use at least three different computers for my video conversions, and one of them is my ancient WinXP machine with with a P3 Coppermine CPU (no SSE2), and I do not want to maintain different plugin folders with different versions of the filters. Least common denominator, and this means using older plugins from the pre "modernization effort" era. And this old SRestore version 2.7e has always worked well for me...

you can ask pinterf for c only build :devil:

anyway you have others like 2.7i or older like 2.7g, should work with older masktools

hope this will make you happy https://www.solidfiles.com/v/nDeywNzjnKyKG

it's the last version but build with /arch:SSE

manolito
31st May 2020, 17:47
Thanks for this build, but it does not work on my ancient WinXP machine.

I removed the old mt-masktools.dll and copied your build of masktools2 into my plugin folder. Then replaced the old SRestore.avsi with your latest version, then I also needed the file Zs_RF_Shared.avsi in the plugins folder.

When calling SRestore I got this error:
"There is no function MT_Makediff"

So it looks like my Non-SSE2 machine does not like this build...

real.finder
31st May 2020, 18:18
Thanks for this build, but it does not work on my ancient WinXP machine.

I removed the old mt-masktools.dll and copied your build of masktools2 into my plugin folder. Then replaced the old SRestore.avsi with your latest version, then I also needed the file Zs_RF_Shared.avsi in the plugins folder.

When calling SRestore I got this error:
"There is no function MT_Makediff"

So it looks like my Non-SSE2 machine does not like this build...

seems I forget something... this should do it https://www.solidfiles.com/v/55Gr45VPeDVYa

manolito
31st May 2020, 19:09
seems I forget something... this should do it https://www.solidfiles.com/v/55Gr45VPeDVYa

Yes, this build works. Thanks a lot...

real.finder
31st May 2020, 19:17
Yes, this build works. Thanks a lot...

now you don't have any excuse for not using new SRestore :)

manolito
31st May 2020, 20:17
I knew that you would tell me this...

But I have other old AVSI scripts like LSFMod and QTGMC which also rely on MaskTools and MVTools and more. If I just use your MaskTools2 build together with the latest SRestore script I would most likely get some issues with the other old scripts. I would have to replace all these old scripts with newer versions (I know they exist thanks to you and some others). And I would have to ask you to compile an MVTools2 build for my Non-SSE2 machine.

I think that I do not need all this. The main new features of all these new versions are Hi Color and Hi Bitdepth. And I really do not care about these features.

So I do not loose anything by sticking with my older plugins and scripts.

But still a big thank you for taking the time to make these builds for me...

real.finder
31st May 2020, 20:23
I knew that you would tell me this...

But I have other old AVSI scripts like LSFMod and QTGMC which also rely on MaskTools and MVTools and more. If I just use your MaskTools2 build together with the latest SRestore script I would most likely get some issues with the other old scripts. I would have to replace all these old scripts with newer versions (I know they exist thanks to you and some others). And I would have to ask you to compile an MVTools2 build for my Non-SSE2 machine.

I think that I do not need all this. The main new features of all these new versions are Hi Color and Hi Bitdepth. And I really do not care about these features.

So I do not loose anything by sticking with my older plugins and scripts.

But still a big thank you for taking the time to make these builds for me...

only new masktools2 is needed in new scripts (since there are some changes in lut things), others can be either old or new one, also new masktools2 work with older scripts, so there are no excuse :rolleyes:

also you did this sin https://forum.doom9.org/showthread.php?p=1912772#post1912772 :devil:

bruno321
16th June 2020, 07:39
Here's a snippet from a source I'm working on https://1fichier.com/?injetdcnteq796v59b05 progressive 29.97fps and lots of blended frames. Standard srestore(23.976) or srestore(25) are not giving good results, it skips frames. I'm confused by the more advanced options of srestore. Could it help in deblending this, or should I abandon hope and keep it at 29.97fps?

Boulder
16th June 2020, 12:15
I didn't take a look at the sample, but chances are it's telecined content which has been deinterlaced. You can try SRestore(omode="pp3") followed by TDecimate() to repair it. Do not bob the source before SRestore, use it as it is.

bruno321
16th June 2020, 12:51
Thanks. I did try that, but it also skips some frames (e.g. between 211 and 212 once you've applied that).

Boulder
16th June 2020, 13:39
How does the result look right after SRestore and before decimating, are there duplicates and with a constant pattern?

bruno321
16th June 2020, 14:15
There are duplicates then, haven't yet looked for the pattern, but there's already frames skipped at that stage...

manono
17th June 2020, 04:34
You should buy the DVD instead of downloading garbage from the internet. It's from a PAL source that's been blend deinterlaced. It has 3 blends in every 6-frame sequence although one of them is lighter. Exblend is about the only filter that can even begin to handle this kind of damage:

LWLibavVideoSource("22-nofix.mkv")
ExBlend(PAL=1,Show=0)
TDecimate(Cycle=6,CycleR=1)

https://www.sendspace.com/file/fiu21g

bruno321
17th June 2020, 06:56
Hey, that looks good! Thanks!

FWIW the source -is- a DVD. Well, an encoded bit, but the only thing I did was crop & greyscale, so I figured it's the same as providing an untouched m2v snippet for these purposes.

Could you explain or link to an explanation for what "blend deinterlacing" is?

manono
17th June 2020, 07:43
...so I figured it's the same as providing an untouched m2v snippet for these purposes.

You figured wrong. When providing samples, always provide untouched samples direct from your source. In this case it does mean the M2V. You're the one asking for help. Don't mislead - intentionally or unintentionally - the people willing to help.

Blend deinterlacing is just what the name says. An interlaced frame is blended together to make it progressive. It's perhaps the worst way to deinterlace anything. From the Wikipedia article on deinterlacing:

Blending is done by blending, or averaging consecutive fields to be displayed as one frame. Combing is avoided because the images are on top of each other. This instead leaves an artifact known as ghosting. The image loses both vertical resolution and temporal resolution. Although video produced with this technique only requires half the number of pixels vertically, it is often combined with a vertical resize so that the output has no numerical loss in vertical pixels. When interpolation is used, it can result in an even softer image. Blending also loses half the temporal resolution since two motion fields are combined into one frame
https://en.wikipedia.org/wiki/Deinterlacing

bruno321
20th August 2020, 16:20
I'm back with a similar case, progressive NTSC DVD with blended frames. Here's a snippet (untouched! straight from the DVD :))

https://www.sendspace.com/file/hndq7i

The lines from #871 are not giving good results. I also tried

srestore(mode=-4,omode="pp3")
Tdecimate(0,1,6)

which after a cursory examination seems not to work too bad, but I'd like to know if there's something better that can be done. Thanks!

manono
21st August 2020, 03:23
The lines from #871 are not giving good results.
Odd, isn't it? The source is similar to the previous one but the same settings don't work worth a damn. I find the docs for all the StainlessS filters to be completely unintelligible so I have no idea whether or not there's a setting to adjust the sensitivity. Maybe he'll come along and help with the video. Sorry.

StainlessS
21st August 2020, 15:00
Not suitable for ExBlend, which requires at minimum 3 good frames, two blends, repeated.
Your clip regularly has 3 or 4 blends in a row.

EDIT: Also shows damage comverting to AVI (maybe clean disk)

C:\FLV>("C:\BIN\ffmpeg.exe" -i ""."\snippet.demuxed.m2v.mp4" -vcodec utvideo -ac
odec pcm_s16le ""D:"\snippet.demuxed.m2v.mp4.AVI" )
ffmpeg version r89612 git-3e0de97dd8 Copyright (c) 2000-2017 the FFmpeg develope
rs
built on Dec 28 2017 00:32:52 with gcc 7.2.0 (GCC)
libavutil 56. 7.100 / 56. 7.100
libavcodec 58. 8.100 / 58. 8.100
libavformat 58. 3.100 / 58. 3.100
libavdevice 58. 0.100 / 58. 0.100
libavfilter 7. 7.100 / 7. 7.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
[mpegvideo @ 03e4f580] Estimating duration from bitrate, this may be inaccurate
Input #0, mpegvideo, from '.\snippet.demuxed.m2v.mp4':
Duration: 00:00:43.17, bitrate: 4800 kb/s
Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, top first), 720x480 [SAR
8:9 DAR 4:3], Closed Captions, 4800 kb/s, 29.97 fps, 29.97 tbr, 1200k tbn, 59.94
tbc
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video (native) -> utvideo (native))
Press [q] to stop, [?] for help
Output #0, avi, to 'D:\snippet.demuxed.m2v.mp4.AVI':
Metadata:
ISFT : Lavf58.3.100
Stream #0:0: Video: utvideo (ULY0 / 0x30594C55), yuv420p, 720x480 [SAR 8:9 D
AR 4:3], q=2-31, 200 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc
Metadata:
encoder : Lavc58.8.100 utvideo
frame= 349 fps=0.0 q=-0.0 size= 91142kB time=00:00:11.54 bitrate=64672.2kbits
frame= 690 fps=689 q=-0.0 size= 192262kB time=00:00:22.92 bitrate=68708.9kbits
frame= 1045 fps=696 q=-0.0 size= 281606kB time=00:00:34.76 bitrate=66351.5kbits
[mpeg2video @ 0031f140] ac-tex damaged at 15 5
[mpeg2video @ 0031f140] Warning MVs not available
[mpeg2video @ 0031f140] concealing 1125 DC, 1125 AC, 1125 MV errors in P frame
frame= 1294 fps=700 q=-0.0 Lsize= 338181kB time=00:00:43.20 bitrate=64114.5kbit
s/s speed=23.4x
video:338145kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxin
g overhead: 0.010645%

C:\FLV>Pause
Press any key to continue . . .

bruno321
23rd August 2020, 07:37
Thank you both for looking at it. I've no idea what that log you posted demonstrates, StainlessS.

Do you guys have better suggestions than the srestore+decimation lines I posted above?

StainlessS
23rd August 2020, 14:56
The log is saying that the file is damaged, and ffmpeg is trying to conceal/hide the errors in the file during convert lossless to UT_Video AVI.
(so that they are less visible in the new AVI). File is corrupt, maybe dirty DVD.

real.finder
4th September 2020, 12:22
Yes, this build works. Thanks a lot...

can you try this https://www.solidfiles.com/v/MD42MQKzezwP3 ? it's last update for now, I made it since there are issue with older avs/avs+ that fixed today by pinterf

also if you didn't note, I made QTGMC work with old mvtools2 for you months ago, if you has any problems with updates scripts I did you can tell me about them here https://forum.doom9.org/showthread.php?t=174121

AdamCarter
7th October 2020, 07:33
This has probably been thought up.

But the dain app has the ability via AI to interpolate frames from adjacent frames,

Wonder if there was away to detect blended frames and export all frames as pngs with a number and have the blended frame be skipped in number so dain could fill in missing frame with an interpolated frame or have the blended frames marked with an asterisk so i can delete them before running dain app to likewise fill the blended frame with an ai generated interpolated progressive frame.

bruno321
16th October 2020, 17:03
Another one similar to the two ones that I brought up above... but neither srestore nor Exblend (with or without PAL mode activated) are giving good results:

https://fex.net/s/tpytxl3

Is there anything I can do to get rid of those blends?

Metal-HTPC
5th June 2021, 09:01
hello,
I'm having a PAL VHS which runs in NTSC speed but is a NTSC->PAL conversion with field blending.
Am I able to apply a fix blend for both the interlaced and deinterlaced version (I don't have the hq interlaced versions for all clips for some I only have the low resolution ones which appear to be already deinterlaced)
so they could match with my NTSC hard telecined film which I would IVTC with TFM().TDecimate() ?

https://workupload.com/file/nmUpb9S3DD9

I'm also getting a script error with Srestore "expected ')' . In The line 63: avs26=!(VersionNumber() 2.6)

Line 60-65

# ==================================================================================================================================

function Srestore(clip sourceo, float "frate", "omode", float "speed", float "blocks", int "mode", float "thresh", int "cache", clip "dclip")
{
avs26=!(VersionNumber() < 2.6)

Which doesn't make any sense to me since I already use all the required plugins.
thanks in advance for your help

real.finder
5th June 2021, 09:30
make sure you have last update from https://github.com/realfinder/AVS-Stuff/blob/Community/avs%202.5%20and%20up/Srestore.avsi and https://github.com/realfinder/AVS-Stuff/blob/Community/avs%202.5%20and%20up/Zs_RF_Shared.avsi

Metal-HTPC
5th June 2021, 14:08
ok it's working. I tried all the different options of srestore but can't seem to get it to the same frames as the dvd source and that is the interlaced I'm not at the progressive yet. So if anyone wants to check out the samples any help would be greatly appreciated. thanks a lot

rjansen1
23rd August 2021, 11:01
FYI: After installing AVS+ 3.70 Srestore gave an "expected )" error. I found I needed to change the position from which to extract the version number in the AvsPlusVersionNumber function for it to start working again:

function IsAvsPlus()
{
FindStr(VersionString, "AviSynth+") != 0
}

function AvsPlusVersionNumber()
{
# IsAvsPlus ? eval(MidStr(VersionString(),17,4)) : 0

# adjusted search position for new AVS+ 3.70
IsAvsPlus ? eval(MidStr(VersionString(),19,4)) : 0
}

StainlessS
23rd August 2021, 14:43
From recent [maybe latest] Real.Finder Zs_RF_Shared.avsi,

####################
#### some of StainlessS AvsVersion.avsi https://forum.doom9.org/showpost.php?p=1897680&postcount=5103
Function IsAvsNeo() { FindStr(VersionString," Neo")!=0}
Function IsAvsPlus() { FindStr(VersionString,"AviSynth+")!=0||IsAvsNeo}
Function AvsPlusVersionNumber() { V=VersionString Off=(!IsAvsPlus)?0:FindStr(V,"(r") return (Off==0)?0:V.MidStr(Off+2).Value.Int } # Avs+ & Neo, (More than 4 digits, Max 24 bit, ~16M)

I personally ignore the Neo thing now.

malze
6th February 2022, 14:18
I was wandering if there is a 64-bit verison of Srestore plugin or similar plugin of this.

Boulder
6th February 2022, 14:21
real.finder has kept the function up-to-date.

https://forum.doom9.org/showthread.php?t=174121

Tlen
2nd August 2022, 13:31
Hi,
I have a double blended PAL DVD, that is blended on the semi-frame.

My idea was to try to remove the double blending doing a

SeparateFields
srestore

Then a Weave to reunite the deblended semi-frames.

But i'm not able to end up with a pure 50fps de-blended result.

Srestore seems just not kicking in.

Is that workflow possible?

manono
7th August 2022, 02:21
SeparateFields
srestore

Doesn't that by itself give you 23.976fps for a PAL source? If so, then SRestore is 'kicking in'. Why would you want 50fps?

Tlen
7th August 2022, 15:42
Why would you want 50fps?

Honestly, i was looping on the fact that i wanted to maintain the original 25.00 fps,
and srestore wasnt't giving me results (or i was not able to make it function in that way),

but thinking about it, the original frate it's not a strict requirement, so i can try with the 23.976 path too.

Thank you for the reply.

tormento
28th September 2023, 22:52
Perhaps I should have posted here this (https://forum.doom9.org/showthread.php?p=1992102#post1992102).

Long story short: 59.98i to 23.976p, one video badly resized and perhaps telecined, the other simply interlaced.

Can you find some good use for srestore in that case scenario?

fabioseixal
11th October 2023, 03:24
Perhaps I should have posted here this (https://forum.doom9.org/showthread.php?p=1992102#post1992102).

Long story short: 59.98i to 23.976p, one video badly resized and perhaps telecined, the other simply interlaced.

Can you find some good use for srestore in that case scenario?

For the 1st clip, is this (https://mega.nz/file/t2ZWkL5K#pjrCsOxwYbdTZDRSOfYheBRMSjCG_-WpKmG0CQ6WNv4) ok?

I had to resize because I have an old PC...

kedautinh12
11th October 2023, 04:02
It's still dancy text :D

tormento
22nd September 2024, 00:51
I can't sort this (https://www.mediafire.com/file/6950qap3b2lxwjo/2_oav_10.mkv) out.

My next step is to downsize to native (540p I suppose), retaining 444 croma at the end.

My suspect is that I have to resize before applying any kind of deblend/fake deinterlace.

I can't really fix the rainbow/blending/weaving.

Any help is welcome.

Selur
22nd September 2024, 10:10
Maybe ExBlend (https://forum.doom9.org/showthread.php?t=175948) can help a bit.

Trixter
22nd September 2024, 19:28
I can't sort this (https://www.mediafire.com/file/6950qap3b2lxwjo/2_oav_10.mkv) out.

My suspect is that I have to resize before applying any kind of deblend/fake deinterlace.


You generally don't resize before fixing. Resizing is destructive, so you do it last.

Your footage shows some sort of multi-frame blending, like it was the result of a poor PAL to NTSC to inverse-telecine conversion. There are instances of half-frame horizontal blending halfway down the frame, for example. exblend might help, but for the most part this was mangled during conversion, and it's terribly difficult to unscramble eggs.