View Full Version : another restore function
Pages :
1
2
3
4
5
6
7
[
8]
9
10
11
12
13
14
15
16
17
18
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...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.