View Full Version : New Filters: Conditional Temporal Median Filter and DeSpot filter
kevina
13th August 2003, 00:41
I have created a Conditional Temporal Median Filter. The filter is designed to remove temporal noise in the form of small dots and streaks found in some videos. A common cause of this is dirty VHS heads but I have also seen small black or white streaks in broadcast material.
You can find it at http://kevin.atkinson.dhs.org/temporal_median/.
It requires my C API Plugin available at http://kevin.atkinson.dhs.org/avisynth_c/.
Please test it out and let me know what you think. It may occasionally cause AviSynth to crash, however it is definitely usable. It will generally only crash when previewing the video (ie lots of back and forth motion in the timeline). To be safe just reopen the script file before saving your final copy. I will release another version once I track down this bug, of course. Update: This bug is now fixed as of version 0.92
It works as follows:
1) Find pixes that are different from its neighbors by at least P1.
1b) Enlarge outliers based on P2.
2) Determine the size of the specks and reject all those larger than PWIDTHxPHEIGHT
3) Find moving areas of an image by simply comparing each pixel to the previous frame and considering all those which are greater than MTHRES.
3b) Remove pixels determined as noise from the motion map.
4) Denoise the motion map by diffusing and then diluting. This is probably the most important step.
5) Only remove the specks in which there was no motion in the current or the next frame.
Mug Funky
14th August 2003, 21:31
that's some good thinking there.
would this work for cigarette burns on bad film transfers?
or dust and scratch on film?
i haven't got a chance to test this yet, but it certainly sounds good.
kevina
14th August 2003, 21:44
It might, you need to try it and see. It has only really been tested well on one particular type of noise so the paramaters will most likely need adjusting.
cablemonkey
18th August 2003, 03:42
I tried the ConditionalDenoise filter, and have the following to report:
1) Its quite good at detecting and removing spotting in poor film source. So far this is the only filter (other than SpotRemover for vdub) that has been effective in removing the "black dots" noise in my current project.
2) It still has some stability problems. While working with this, AVISynth many times would throw out the following error:
Avisynth read error: Avisynth read error: Avisynth: caught an access violation at 0x6c2016eb, attempting to read from 0x0b96400.
The first hex address would always be the same, but the second would vary. This was using avisynth 2.5.2. Even with it was he only filter in the script (except ConvertToYV12), it would kick out this error, even after closing vdub and reopening.
Looks like it has a good bit of potential, but definitely needs some more testing.
kevina
18th August 2003, 04:11
Thanks for the report.
It should be OK to encode a video as it should't crash when not jumping around the video. I am not trying to make up an excuse for the bugs, just a work around.
kevina
18th August 2003, 06:07
Just to make sure. Are you using version 0.11 of the C API Plugin?
morsa
18th August 2003, 06:26
I have the same crash and I'm using c api version 11.
@Cablemonkey:
Could you post your setting for removing spots?
kevina
10th September 2003, 06:21
A new version is now available. This version fixes the nasty crash. It should work OK for everyone.
So please try it out again.
http://kevin.atkinson.dhs.org/temporal_median/
cablemonkey
10th September 2003, 17:04
i've been swamped at work (gotta love post-acquisition integrations)and have had to put this project on hold for a bit. I'll let you know when i have have an opportunity to pick it up again.
unplugged
12th September 2003, 22:35
Crashes not resolved yet, at least for ConditionalDenoise, couldn't use that with (YV12) 768x576, 720x576 and 720x288; generally it never worked to me.
I haven't tried other res and avisynth is the lastest version.
:(
kevina
12th September 2003, 23:32
What processor are you using?
Make sure you are using the avisynth_c.dll included.
unplugged
13th September 2003, 00:51
Athlon XP, the DLL is latest 0.14.
Must say that I have tried denoise only with defaults as follows: ConditionalDenoise(interlaced=false)
Maybe am I missing anything... ?
P.S.: there is not much doc about mwidth, mheight and mp parameters. Please add something, thanks :).
slk001
23rd September 2003, 23:17
I have the latest version and I cannot get ConditionalDenoise to even run. ConditionalMedian looks to be very useful for me, and I want to see if the Denoiser will also.
Whenever the Denoiser runs, Avisynth always catches an access violation.
I run on dual P4s. Your C plugin is used.
Here's the script I am using:
LoadPlugin("d:\program files\HOLDER\mpeg2dec3.dll")
LoadPlugin("d:\program files\AviSynth 2.5\plugins\avisynth_c.dll")
LoadCPlugin("d:\program files\AviSynth 2.5\plugins\CondTemporalMedian.dll")
#mpeg2source("d:\program files\HOLDER\TEST.D2V")
mpeg2source("d:\program files\HOLDER\TEST.D2V").bilinearresize(720,480)
ConvertToYV12
#ConditionalMedianMap()
ConditionalDenoise()
#fadein2(48)
#ResampleAudio(44100)
#version()
This filter has amazing potential - don't give up on it yet!
slk001
24th September 2003, 15:35
One more thing... ConditionalDenoise causes Avisynth to give the error when it tries to access the second frame. The first frame holds steady.
kevina
27th September 2003, 09:03
OK Everyone. I THINK I finally got it working right. I tested it on a Windows XP system (I normally use Windows 98) and was able to reproduce the problem and fix it.
So give it another go. http://kevin.atkinson.dhs.org/temporal_median/. A non iSSE version is now included.
I also expanded the readme a bit to give a quick guide to tuning the parameters.
slk001
29th September 2003, 17:40
Yes, it works quite well now. Here's a script that I have been testing with:
LoadPlugin("d:\program files\HOLDER\mpeg2dec3.dll")
LoadPlugin("d:\program files\AviSynth 2.5\plugins\avisynth_c.dll")
LoadCPlugin("d:\program files\AviSynth 2.5\plugins\CondTemporalMedian-isse.dll")
mpeg2source("d:\Experiment\CHHTEST.D2V").trim(195,0)
conditionalmedian(mthres=30,mwidth=6,mheight=4,mp=11)
ConditionalDenoise(mthres=16,mwidth=5,mheight=3,mp=11,p1=2,p2=2,interlaced=false)
converttoYUY2()
v1=declick(lthresh=35,cthresh=10,map=true)
#stackhorizontal(v1,v2)
V2=blankclip()
audiodub(v1,v2)
Notice that it also uses DG's DECLICK routine. I find that this .DLL helps remove clicks in the frames at scene changes, where there is no prior and post matches.
The CONDITIONALMEDIAN filter cleans up the overall video nicely (this test video is an old film with lots of dust, hairs, etc on the encoding - also, this video also has the chroma shifts due to the age of the film).
The CONDITIONALDENOISE filter removes horizontal noise (the "meteors") on my video (it is a laserdisk capture with scratches on the disk surface).
Many kudos to you, Kevin (and Donald). Thanks for your efforts.
morsa
30th September 2003, 16:47
May be some source code from Declick should be included into Kevin Atkinson's filter, cause Graft has stop development and even download availability of Declick.
Fizick
9th November 2003, 00:48
Recently I found "Conditional Temporal Median Filter".
Greate works! Thanks to Kevin Atkinson.
I tred to use it for my archive of old 8 mm kino-films (telecined with camcorder and tv-tuner).
These movies have many spots and scratches.
Before I tried similar filters for VirtualDub: "SpotRemover", "Pops", and "Random Noise Remover".
But CTmedian is the most advanced, it makes less artefactes (false detections) on moving parts. Also it removes spots more purely, completely (with outliers).
However, I have one question (proposition).
In many my (and similar) movies, almost all spots are black (from dust).
Sometimes, the CTmedian filter make false detections at transition from dark to light pixels.
Rarely, it transfers a dark spot from previous frame to current!
In contrast, there are another movies, captured from analog TV, with only white spots (snow).
I think, this filter would produce still less artefacts on similar movies, if it makes comparing of pixels not by absolute difference, but simple difference (as option).
For example, some new option may control filter's work as follows:
- detect and clear all transitions (default),
- detect and clear only black spots,
- detect and clear only white spots.
Is it possible in next version of the filter?
By the way, the POPS filter has similar control (tuned black and white spot detection levels).
P.S. I am not a real C-programmer.
P.P.S. Sorry my English.
Fizick
9th November 2003, 01:15
Sorry, the my previous post have been prepared 5 day ago (forum rules for first newibe post), but I decide to send it now.
During these days I try some c-programming.
In Kevin's source code (GNU) I found (in file med-f.cpp) function "find_outliers", and change some code (for non-CCE version).
( o - output, p - priveous frame, c - currrent, n - next)
o[x] = 0;
byte mn = min(p[x], n[x]);
byte mx = max(p[x], n[x]);
//Original code by Kevin Atkinson:
// if (c[x] < mn) o[x] = mn - c[x];
// if (c[x] > mx) o[x] = c[x] - mx;
// Modes added by Fizick:
// Set some black-white mode of spots search, from SIGN parameter:
switch (parms.sign){
case 1:
// sign=1 - only black (dark) spots and outliers
if (c[x] < mn) o[x] = mn - c[x];
break;
case -1:
// sign=-1 - only white (light) spots and outliers
if (c[x] > mx) o[x] = c[x] - mx;
break;
case 2:
// sign=2 - only black (dark) spots, any outliers
if (c[x] < mn) o[x] = mn - c[x];
if (c[x] > mx) o[x] = min( (c[x] - mx), parms.p1 );
break;
case -2:
// sign=-2 - only white (light) spots, any outliers
if (c[x] > mx) o[x] = c[x] - mx;
if (c[x] < mn) o[x] = min( (mn - c[x]), parms.p1 );
break;
case 0:
default:
// sign=0 - any spots and outliers (default)
if (c[x] < mn) o[x] = mn - c[x];
if (c[x] > mx) o[x] = c[x] - mx;
I add one new parameter "sign", and of course change some code for it also.
It works!
May be, Kevin Atkinson will put similar code in original source (I not understand some code in parameters parsing).
Fizick
30th November 2003, 20:37
As Kevin does not respond, I modify the filter myself (GNU GPL v.2).
Changes:
1. "sign" parameter for removing only black or white specks.
(as described in my previous post.)
2. "per" parameter for more smoothed specks perimeter.
Set percent of smoothing for pixels near perimeter (border) of spot.
per=0 - all pixel at spot outliers are replaced to same pixels
from adjacent frames.
per=100 - pixels near border of spot outliers are not changed,
internal pixels at spot outliers are changed partially,
(with quadratic interpolation),
according to pixel differences from adjacent frames,
smoothing=0 when difference>p1
per=i - intermediate degree of perimeter smoothing.
default per=0, recomended value per=50.
3. More short filter name ctmedian.dll
The filter may be found at:
http://bag.hotmail.ru/ctmedian/ctmedian.dhtml
I am still waiting for Kevin answer.
And testers too.
morsa
1st December 2003, 09:09
I know Ia sk for this things all the time, please forgive.It´s just that I find all these amazing filters and I hope we could add them to Avisynth collection.
It seems that this is what we´ve been looking for since a long time.
For your (our) pleasure.
There are two filters for The Gimp and now for the Cinepaint project that are really interesting.They just need an experienced coder to port them to Vdub or Avisynth.
One is a deconvolution one and the other...Wow is an scratch removal filter (at least it says that).
http://sourceforge.net/project/showfiles.php?group_id=75029
There is a port of a Deconv filter from Gimp to Vdub here
http://fcchandler.home.comcast.net/Refocus_YUV_Test.zip
Hoping to find someone kind enough to port them,
Morsa.
Fizick
2nd December 2003, 21:07
to Morsa:
Thanks, it is interesting.
Cinepaint is free similar Ulead Videopaint?
However "sratch removal" is not filter, but mostly various information. The only source code included is for spatial method, not temporal.
morsa
3rd December 2003, 08:11
Well the idea now would be to have a detector for the scratchs.Isn't it?.I believe also that this Spatial interpolation would be very good for Logo removal and Subtitles removal.
Fizick
20th December 2003, 23:03
I release a new version 0.934 of the filter -
with luma correction and local blur of deleted spots borders.
The filter may be found at:
http://bag.hotmail.ru
COMBINED USAGE
Very good results are may be obtained with combined this filter
with motion estimation and compensation, even if only general motion,
produced my (Fizick) GENMOTION plugin.
Fizick
30th December 2003, 19:27
I released a new version of the filter.
Changes 1.0 from 0.934 (Dec 30, 2003)
Added "tsmooth" parameter for temporal smoothing in static areas.
Changed filter name to DeSpot as more appropriate, filter file name to despot.dll,
and function names:
ConditionalDenoise to DeSpot,
ConditionalDenoiseMark to DeSpotMark,
ConditionalDenoiseMap to DeSpotMap,
ConditionalMedian to DeSpotMedian,
ConditionalMedianMap to DeSpotMedianMap.
Corrected info.
The filter may be found at:
http://bag.hotmail.ru
brett
25th January 2004, 18:57
So, is there going to be any more work done on this filter? It seems very nice for VHS captures, but it's pretty unusable in its current state.
For example, my heaviest filtering script is:
Convolution3d(c,0,32,128,16,64,10,0)
ConvertToYV12()
Cnr2("xxx",4,5,255)
UnDot()
STMedianFilter(8,32,0,0)
QMF()
BilinearResize(352,208)
UnDot()
Temporalsoften(2,3,3,mode=2,scenechange=6)
Limiter(min_luma=16)
I use it for noisy VHS and cable TV captures. This encodes at 7.33 FPS on an Athlon XP 1600, so that's 3 hours to encode your agerage 1-hour show with commercials taken out.
If I simply add DeSpot to the above script, it's 13 times slower. It goes 0.57 FPS, and takes 37 hours to encode a 45-min show. It would take 3 days to encode your average VHS movie, so it's really not practical.
Maybe there is a similar filter that does well removing the white horizontal lines of noise that show up in old VHS tapes?
Fizick
26th January 2004, 22:55
What is your script for DeSpot?
Its speed is depended from parameters setting.
morsa
5th February 2004, 01:11
@Fizick
In case this is useful for anything,
http://www.mpi-sb.mpg.de/~hitoshi/research/image_restoration/index.shtml
If someone is interested and if this could be usefull here is another link with some examples and a description of the algorithm in pseudo code.
http://www.cs.berkeley.edu/~efros/research/EfrosLeung.html
krieger2005
11th March 2004, 01:46
@Fizick
Thanks for your Filter. It do a good job when you tune them enogh.... But this is the problem: Tuning this filter for a movie is a horrible thing. Not at least because some desciptions of your filter-usage seems to be false
1. you wrote "p1 > mthres > p2". But when im using "p1 > mthres < p2 AND p1>p2" then DeSpotMark show me that some areas were spots.
2.
"sign (default 0)
Set mode for removing of only black or white spots or both:
sign=0 - any spots and outliers (default)
sign=1 - only black (dark) spots and outliers
sign=2 - only white (light) spots and outliers
sign=3 - only black (dark) spots, any outliers
sign=4 - only white (light) spots, any outliers "
But you can only select -2, -1, 0, 1, 2.
When you select 1 or 2 for searching for white/black spots then the filter find dark/light spots too. Why?
3. The Variables
mwidth (default 7)
mheight (default 5)
mp (default mwidth*mheight/3)
seems for some peaple unclear (for me too). Can You explain this a little bit more?
and then technical detail: Avisynth 2.54 does not like your Filter (DeScratch also). When you set it for loading (LoadPlugin) it sait: Could not load ...
I try always to tune the filter for one pic (first). For that i set p2=0 and p1="something" (mthres=p1-1). When the spot where found i tune p2 (+1) or mthres (-1), since the spot were still found by the filter. This method is a "need many time" method and does not give me the results which i estimate -> Artifacts.
For now i do not understand clearly what the filter do so it is difficult to tune the vaiables.
As long, as one can not see which areas were removed by which step of your algorithm it is difficult to tune the values. Something that you could do is to show different steps in different colours: mark_v_forP1, mark_v_forP2...
Then: Can you do that the Mark is transparent (highlighted in the selected colour) so one does not need StackVertical/Horizontal, which does not help, when you have a picturesize of 720/576 (because 720*2=1440, 576*2=1052 an i have the maximum resolution of 1024/768).
But at all the filter does helped me to restorate some movie which were very old and for that :thanks:
Fizick
11th March 2004, 22:04
1. no comment yet.
2. Yes, its my mistake in info.
Correct:
// sign=1 - only black (dark) spots and outliers
// sign=-1 - only white (light) spots and outliers
// sign=2 - only black (dark) spots, any outliers
// sign=-2 - only white (light) spots, any outliers
// sign=0 - any spots and outliers (default)
3. It is mostly Kevin code.
MP is not very clear for me too. It is some limit number of moving pixels.
4. I use v.2.53. Problem was discussed here. Wait.
5. Try get pixel values (and differences) with some Photo-editor.
It is not very robust filter, yes.
6. I have not time now. Plese, wait.
Fizick
1st June 2004, 17:27
O.K. I return to it.
New experimental version 1.2 of DeSpot plugin (June 01, 2004):
Added parameters Ranked, weak, maxpts, p1percent,
change mark mode to color spot with weak motion map.
If "ranked" parameter is true, the 3 neighbors in previous frame and 3 neighbors in next frame are ranked (ordered by value), and those min and max are used for current difference calculation
If "weak" parameter is used, the some small weak spots are rejeñted also.
If "numpts" parameter is set, the big spots are rejected also.
If "p1percent" parameter is set, then not strong (by criterion P1) spots(which have many outliers) are rejected also.
The color (pink, green or grey) of noise spot now is depend from parity of mark_v.
Weak motion map is also shown now.
Source now is compatible with MS VC6, VC7 (free tools). But I can not port it from avithynth_c to pure avisynth plugin (needed in some help):)
To moderator:
May you add to this thread subject some words:
... and DeSpot filter.
Fizick
7th June 2004, 23:35
Now I have a more new version.
Changes 1.3 (June 7, 2004) from 1.2:
Remove parameter "weak" ( "p1percent" is seems more useful).
Add parameter "Dilate" to enlarge spots sizes.
Change parameters order to more functional.
Change default values of some parameters to more optimal.
Update doc.
If "Dilate" mode, spots are enlarged (with range value as the parameter is set) to cover its non-contrast edges and close small gaps between its, by applying a morphological dilate operation to noise (spots) map.
krieger2005
8th June 2004, 11:28
Hi,
thanks for development of this filter...
1. Can you put the Link to Despot in the first Post? I must search it always.
- EDIT - I Note, that you does not open the thread... forget this point...
2. I tried DeSpot 1.2 with Avisynth 2.55 alpha using "avisynth_c.dll". It was all okey...
3. Your Site is not updated?
thx
greets krieger2005
Originally posted by krieger2005
1. Can you put the Link to Despot in the first Post? I must search it always.
A small hint: click on the "www" button below Fizick's posts to go straight to his homepage... ;)
np: Gescom - Keynell (Mix 1) (Autechre - Keynell Mixes)
Fizick
8th June 2004, 23:50
Originally posted by krieger2005
3. Your Site is not updated?
I have v1.3, but I did not release it :D
I found a small bug.
And I want to do once more update.
Please wait.
I also wait some responce from users about possible bugs and suggestions.
If nobody responded, why I will release new version? :(
Backwoods
9th June 2004, 06:56
Originally posted by Fizick
If nobody responded, why I will release new version? :(
Doesn't mean there aren't people using it :)
Fizick
9th June 2004, 14:17
O.K. my site is updated with 1.3.
I wait some respond how useful are new options for various sources.
Now I also think about porting DeSpot to native Avisynth plugin (not C).
Anybody will be interested?
Fizick
10th June 2004, 02:22
New DeSpot version 2.0.
It is major release update (probably alpha with bugs):
Main interface code is rewrited, and now filter is native Avisynth plugin (not C-plugin).
Add parameter "median" instead of DeSpotMedian function,
Add parameter "show" instead of DeSpotMark, DeSpotMap, DeSpotMedianMap functions.
Replace parameter "mp" to parameter "merode" (relative)
Change "p1percent" to integer.
Update doc.
iradic
10th June 2004, 02:53
hi...
www button is ok... but you could add url in your signature (direct link )
bye
Fizick
10th June 2004, 10:48
You are seems too lazy...:D
http://bag.hotmail.ru
krieger2005
13th June 2004, 22:19
I have problems with this Filter on "higher" motion in movies. I used
Despot(p1=25,p2=10,pwidth=60,pheight=60,mthres=12,ranked=true,dilate=1, sign=2)
and when there is high motion there the filter produce ugly big artefacts. When i increase mthres (e.g. mthres=17) it seems, that the artifact stay the same, when i lowering the threshold the effect is the same.
Summerized for me is it difficult to decide which factor p1,p2 or mthres should be tuned to get right results. As you can imagine i does not understand the algorithm of this filter so good, so maybe you can get give some points, how to tune it.
-- EDIT
I think the filter should get better motionestimation (not best but better) because i think one must set p1 high und p2 low to reduce artefacts. Because i think a simple difference betweet two pixels is too bad to decide, if it is a spot or motion.
greets krieger2005
Fizick
14th June 2004, 12:53
For high motions, you may increase Mwidth, Mheight parameters, and try tune Merode.
But of course, motion compensation is the better. Did you try Depan or MVtools ?
New version Despot 2.1 (June 14, 2004) is released:
Add parameter "mratio" parameter (it was internal =3 in all previous versions).
Change default of "merode" to dependent from "mratio".
Update doc.
At last I begin to understand how the filter works at motion denoising stage :D
3) Find moving areas of an image by simply comparing each
pixel to the previous frame and considering all those which
are greater than MTHRES.
3b) Mark motion pixels without noise with weight "mratio" in the motion map.
Mark pixels determined both noise and motion as weight 1 in the motion map.
4) Denoise the motion map by erosion and then dilating
(as a whole it is morphological opening operation).
During erode phase, the motion map is eroded with range mwidth/2 and mheight/2,and zones with small summary weight (less than "mratio*merode/100") are decreased or completely removed from motion map. Such zones correspond to small relative (in percent) numbers of motion neighbors within this range or mostly noisy pixels (spots).
During dilate phase, remained motion zones are enlarged with same range.
krieger2005
14th June 2004, 15:58
I try first MVTools. But because the source is very noisy MVTools generate a "block-theater", where block were shift down, up ...
But in some scenes does the MVTool "something", so that DeSpot does less artifacts.
I tried also DePan:
i=last
d=depanestimate(range=5, trust=100)
x=depan(data=d)
return StackHorizontal(x,
\ subtract(x,i).ColorYUV(autogain=true))
The Result was, that i was the same as x. So that DePan has done nothing...
For higher motion-scenes u use:
norm=ConditionalFilter(motion,des,"abs((YDifferenceFromPrevious+YDifferenceToNext)/AverageLuma*100)",">","19")
ConditionalFilter(highmotion,norm,"abs((YDifferenceFromPrevious+YDifferenceToNext)/AverageLuma*100)",">","35")
where des the Result of DeSpot is, motion a blured movie
btw, thanks for the tip with Mwidth, Mheight. I forgot these parameters....
Fizick
14th June 2004, 23:22
With Depan, you must use or two Depan(), or DepanInterleave, to compensate global motion for Despot.
Simplest script:
avisource("qwerty.avi")
i=ConverttoYV12()
mdata=DePanEstimate(i)
DePanInterleave(i,data=mdata)
Despot(some parameters)
selectevery(3,1)
BTW, now I try implement some new method of motion detect in DeSpot.
Fizick
21st June 2004, 23:27
Changes new DeSpot v.3.0 (June 22, 2004) from 2.1:
Version 3.0 is major release update (probably alpha with bugs):
Add another motion detection method "motpn" (previous to next frame).
Add whole segments removing methods "seg"=1,2. - more safe.
Change luma correction to local in segments (spots) removing mode. Change some defaults.
Code reorganization.
http://bag.hotmail.ru
If new modes will be good in tests, I will remove some old modes in next version.
tedkunich
24th June 2004, 10:16
Fizick,
Have been trying out your filter in restoring some captures off of a laserdisc that is experiencing "laser rot". Your filter seems to knock out the white and black spots nicely, but it does not seem to detect/eliminate any chroma information from the removed spots. I have white, red, blue, and green dots - the white ones are gone, but the others have the intensity reduced, but the chroma flair is still visible. Any thoughts, tricks???
I'm using version 3.0 or your filter.
Thanks
Ted
Fizick
25th June 2004, 20:04
I think, indedendent color spots detecting may produce false detection with ugly color artefactes.
Probably removing color spot only at places of detected luma spots may be better.
But it is not very simple task becourse of different sampling of color planes in YV12, espessially for interlaced clips.
And it also may produce some artefactes.
Current version of DeSpot can fit luma locally, but how fit color in places of removed spots?
May you propose any algorithm?
tedkunich
25th June 2004, 22:40
Fizick,
Probably removing color spot only at places of detected luma spots may be better.
That is exactly what I was thinking of. In my particular case (laser rot) the spots are only visible for one frame - would it be possible to replace the luma and chroma information of the detected spot with a blend or interpolation of frames from either side of the detected defect? I am processing pure progressive frames. Would it be helpfull if I sent you a few frame grabs or a small avi?
Thanks,
Ted
Fizick
27th June 2004, 18:13
New version of DesPot.
Changes 3.1 (June 27, 2004) from 3.0:
Add color correction at place of removed spots.
Parameter "color":
true - change color of pixels at places of removed spots to mean value previous, current and next frames,
false - not change color of pixels at places of detected spots.
Try!
tedkunich
28th June 2004, 17:16
Fizick,
You are the Man!!!! Looks like the filter works as advertized - I need to play around with the parameters, as I get some smearing around the spot removal, but the results are better than the previous verisons and certainly much, much better than nothing at all!!! Thank You.
If you ever get to the USA, look me up - I owe you a beer!!!!!
T
Originally posted by Fizick
New version of DesPot.
Changes 3.1 (June 27, 2004) from 3.0:
Add color correction at place of removed spots.
Parameter "color":
true - change color of pixels at places of removed spots to mean value previous, current and next frames,
false - not change color of pixels at places of detected spots.
Try!
Fizick
28th June 2004, 20:01
It is impossible to create a perfect filter, but one must to strive for it.
http://bag.hotmail.ru/images/beer.gif
Fizick
12th August 2004, 20:24
Recently I release new version of DeSpot.
Changes 3.2 (July 4, 2004) from 3.1:
Corrected enabling and disabling of temporal smooth for some modes.
Changed temporal smooth method to more fast but simpler, new tsmooth is similar to old tsmooth*2.
Restored median mode processing as was before version 3.0.
Partial ISSE optimization for speed increasing (Pentium3 or Athlon is needed now).
Updated doc.
Backwoods
13th August 2004, 02:54
Will give a go this week, have some 8mm footage to capture.
Serg Belyansky
20th August 2004, 10:12
Fizick, I adore you. The DeSpot filter works better than expected (and documented) -- the results are awesome.
Combined with DePanEstimate, it forms a perfect tool for film restoration. Unfortunately one problem persists: any solid surface with a large number of frequent simular elements (e.g. brick wall or polka-dot dress) will exhibit an erratic motion estimation with elements disappearing and reappearing randomly.
It can be partially remedied by increasing the "range" parameter of Depanestimate, but it slows the process and introduces artifacts on other surfaces.
So I'm still scratching my head.
Fizick
20th August 2004, 23:03
Serg Belyansky,
... it forms a perfect tool for film restoration. Unfortunately one problem persists...
Threrefore, it is not perfect yet :)
The rest of your post is belonged to DePan filter?
I will answer there.
http://forum.doom9.org/showthread.php?s=&threadid=66686&perpage=20&highlight=depan&pagenumber=4
Please post there.
Fizick
19th September 2004, 01:33
New Despot version 3.3 (September 19, 2004):
Added "mscene" parameter for scene change detection.
(To prevent artifacts at scene change)
Fizick
9th October 2004, 00:58
Changes new version 3.3.1 (October 08, 2004) from 3.3:
Fixed bugs with scene change detection.
Jedd
27th October 2004, 19:20
Originally posted by Fizick
you may try DeSpot plugin for Avisynth for a source with some amount of negative dirt (white marks, hair and streaks).
But it is almost offtopic, please go to DeSpot thread if you want.
I've followed here from the RemoveDirt topic, because in my case I have all of them - white marks, hair, streaks and crawling dust.
Pic1 (http://webpages.charter.net/jedd/m67.png) Pic2 (http://webpages.charter.net/jedd/m68.png) Pic3 (http://webpages.charter.net/jedd/m69.png)
RemoveDirt removes everything, but details suffer quite a bit.
So I tried DeSpot and indeed it removes some of the white sparks, but I couldn't make him to remove scatches (pic3: right eye), hair lines (pic1: nose) and some of the not so white sparks (pic2: right cheek, pic3: over the left ear)
What are the tweak directions to remove these scratches and bluish sparks on the background?
Fizick
28th October 2004, 20:33
Jedd,
Your hair scratches are probably too weak for current Despot.
However, you may try this script:
despot(sign=-1,pwidth=100,pheight=10,p1=15,p2=8,mthres=12)
But I think, that more safe for so low threshold p1 is two-pass call (first for thin long horizontal scratches and second for small compact spots):
despot(sign=-1,pwidth=100,pheight=2,p1=15,p2=8,mthres=12)
despot(sign=-1,pwidth=10,pheight=10,p1=15,p2=8,mthres=12)
But it is not perfect. Try.
Any comment and suggestion for DeSpot inproving?
Jedd
30th October 2004, 02:12
I've got a little far than that, now my script looks like:
#big black spots
despot(sign=1,pwidth=45,pheight=45,p1=15,p2=8,mthres=8,color=true)
#thin white lines
despot(sign=-1,pwidth=140,pheight=100,p1=8,p2=1,mthres=5)
#thick hair lines (avoid real hair)
despot(sign=-1,pwidth=140,pheight=100,p1=15,p2=13,mthres=13,merode=24)
#lines contacting motion, avoid motion areas
despot(sign=-1,pwidth=140,pheight=100,p1=15,p2=13,mthres=13,merode=16,seg=1)
#small dots and dust
despot(pwidth=6,pheight=5,p1=15,p2=8,mthres=12,tsmooth=2)
And I have to say results are outstanding! I remove my hat before the author.
Pic3 before (http://webpages.charter.net/jedd/m69.jpg)
Pic3 after (http://webpages.charter.net/jedd/m69a.jpg)
I was trying to make it more compact, but thin and thick lines and dots - they all whant diffrenet thresholds.
What is difficult:
- to get rid of the light blue dots on the dark green wall.
- gray hair - when the head moves the hair tends to stay where it were. I could partially fix it with the low merode arg.
- to understand why higher thresholds fix big artifacts and don't fix small ones.
Another very strange problem I met - I use dvdrebuilder to compress my video and it seems, rebuilder doesn't like 5 despots in a row. 4 are fine, 4 despots + deen are fine too. VirtualDub takes 5 without any problems. I asked Rebuilder pros here:
http://forum.doom9.org/showthread.php?s=&threadid=84660
but maybe somebody here knows what might be wrong? :confused:
Fizick
31st October 2004, 00:19
Jedd,
youmust be careful with low values of thresholds - it may result in bad artifactes at motion scenes.
(may be use ApplyRange or additional masktools to prevent it)
And I never used more than 1 Despot. :)
Jedd
4th November 2004, 05:00
I've spent several days already playning with the parameters and still couldn't decrease the number of calls to get rid of
Dots (http://webpages.charter.net/jedd/m2691o.jpg)
Blue hair lines (http://webpages.charter.net/jedd/m2698o.jpg)
Black spots (http://webpages.charter.net/jedd/m105o.jpg)
Splashes (http://webpages.charter.net/jedd/m319o.jpg)
Splashes over moving parts (http://webpages.charter.net/jedd/m261o.jpg)
Thin scratches (http://webpages.charter.net/jedd/m67o.jpg)
at the same time, without artifacts over moving faces and grey hair.
It seems that every type requies it's own settings.
All ideas how to combine them (maybe with some other filters) are very welcome, because CCE crashes over too many DeSpots. :eek:
dbzgundam
4th November 2004, 21:46
Apparently, VirtualDubMod will not open after using the C API dll...
AVISynth 2.55, VDubMod 1.5.10:
http://rx782.000k2.com/error.PNG
I tried replacing ntdll with another version from the internet, didn't help since the dll was being used ^^;;.
Fizick
4th November 2004, 22:51
dbzgundam,
:script:
dbzgundam
4th November 2004, 22:52
I can't open Vdubmod *at all*, meaning prior to any script.
Fizick
4th November 2004, 23:00
Go to
http://forum.doom9.org/forumdisplay.php?s=&forumid=22
krieger2005
24th November 2004, 23:49
Hi,
do you think about the using of MVTools (the result of MVAnalyze)? I think this could give Despot a better precision to remove spots... Then MVAnalyze give you vectors of the motion so that despot could be used even in moving scenes... The good thing could then be, that you not need to generate the motion because MVtools give you the information. Scince MVTools make good steps forward i think the results could be very good...
What do you thinking about all this and do you think this is really complex to combine this both filters?
greets
krieger2005
Fizick
30th March 2005, 19:23
New versions.
Changes v.3.3.3 (March 30, 2005) from 3.3.2:
Fixed bug with median mode (thanks to slk001 for report)
Changes 3.3.2 (March 28, 2005) from 3.3.1:
More correct clip cache range (now =2 in place of undefined)
slk001
12th May 2005, 15:55
When using Despot in the median mode, there is occasional "ghosting" at the frame just before a major scene change. It doesn't ghost at all scene changes, but only at certain ones.
There was no parameter setting that I came up with that would eliminate the ghosting, short of setting the parameters so that no temporal averaging was done at all. This lead me to load up "DEFLICKER" and see if that would perform the smoothing that I wanted. Using the INFO=TRUE setting, I noticed that the word NEW flashed at the scenes that contained the ghosting phenomenon - but ONLY at these scene changes.
I noticed that the "major" scene changes went from a slow moving, bright scene, to a slow moving dark scene, and vice versa. These are, of course, abrupt scene changes, with no fading from one to the other. However, other abrupt scene changes do NOT exhibit any ghosting, but they also are not identified as "NEW" in DEFLICKER.
A comment on the ghosting. The ghosting at the scene changes appears to be almost a carbon copy of the MOTION MASK of the next frame when shown using SHOW=1, and NOT of the true frame image.
Fizick
12th May 2005, 21:32
Yes, there are no scenechange settings in Median mode.
But there are no MOTION mask in this mode too.
EDIT. I forgot, that motion mask exists...
I never really used Median mode for real denoising.
slk001
18th May 2005, 19:20
Can you remove the motion mask while using MEDIAN=TRUE and recompile the .DLL? I find that using DESPOT(MEDIAN=TRUE) is an excellent way to prevent luma and chroma variations in frame to frame in older movies in areas like skys, clouds, and large bodies of water.
Just a request.
And thanks if you decide to do it. And thanks even if you don't want to do it, because the DESPOT() filter is still an excellent denoiser.
Fizick
18th May 2005, 21:26
Remove motion mmask?
i.e. unconditional median?
Fizick
18th June 2005, 00:28
When I start reformatting of despot manual for cvs update,
i unexpectedly found the DeSpot version 3.4 in my archive :)
Version 3.4 (April 11, 2005): Added parameter minpts.
minpts (from 0 to 10000000, default=0 - no limit)
Set lower limit of points (pixels) per every spot.
The reformatted 3.4.0 (with the same binary) is released too.
Fizick
26th November 2005, 16:13
New version 3.5 (November 26, 2005):
Added external motion mask clip option and example.
Changed default motpn=true (was really false, contrary to documentation).
You also may try to use external mask clip (extmask parameter) in addition to (or instead of) internal motion mask to protect good objects. For example, it can be motion mask or inverted SAD mask from MVTools plugin.
Example script with external mask from MVTools plugin v0.9.13.2 (you may tune optional MVAnalyse parameters):
LoadPlugin("mvtools.dll")
LoadPlugin("masktools.dll")
LoadPlugin("degrainmedian.dll")
LoadPlugin("despot.dll")
AviSource("h:\kino.avi")
i = ConvertToYV12()
prefilt=i.DeGrainMedian() # prefiltered for better motion analysis
# analyse and compensate motion forward and backward (to current frame)
ml = 100 # mask scale
thscd1 = 400 # scene change
vf = prefilt.MVAnalyse(isb=false, truemotion=true) # forward vectors
cf = i.MVFlow(vectors=vf, thscd1 = thscd1) # previous compensated forward
sadf = MVMask(vectors=vf, ml=ml,kind=1,gamma=1, thscd1 = thscd1) # forward SAD mask
msadf=sadf.Binarize() # binary inverted forward SAD mask
vb = prefilt.MVAnalyse(isb=true, truemotion=true) # backward vectors
cb = i.MVFlow(vectors=vb, thscd1 = thscd1) # next compensated backward
sadb = MVMask(vectors=vb, ml=ml, gamma=1, kind=1, thscd1 = thscd1) # backward SAD mask
msadb = sadf.Binarize() # binary inverted backward SAD mask
msad = Logic(msadf,msadb,"OR") # combined inverted SAD mask
msad = msad.Expand() # expanded inverted SAD mask
msadi = Interleave(msad, msad, msad) # interleaved 3-frame inverted SAD mask
# This mask is high (255) where at least one motion estimation is good,
# so these areas will be protected
Interleave(cf,i,cb) # interleave forward compensated, source, and backward compensated
DeSpot(p1=30,p2=12,pwidth=800,pheight=600,mthres=20,merode=33,\
sign=0,show=1,seg=0,color=true,motpn=true, extmask=msadi)
SelectEvery(3,1) # get filtered source
sixtydeuce
6th January 2006, 04:13
I have captured some promos on a laserdisc, but I believe I have laser rot:confused: Would this filter remove the colors across the middle of the screen? I've enclosed an example. Thanks for your time.
grannyGeek
7th June 2006, 04:38
I’ve read through the thread, and to be very honest, much of it seems like ancient Sanskrit, I am too new to understand a lot of the technical terms you folks use.
I have a commercial vhs movie captured in DV avi (about 23 mb for 113 minutes) with LOTS of big chunky black spots, white spots, hair, and dust fuzzies.
I'm trying to use DeSpot in VirtualDubMod, and trying to adapt sample scripts from the download page.
Here is one script I tried.
LoadPlugin("despot.dll")
AviSource("c:\__CAP\Test-22s.avi")
ConvertToYV12(interlaced=true)
DeSpot(p1=35, p2=14, pwidth=20, pheight=30,mthres=25,tsmooth=3,interlaced=true) #, show=1)
When I include the parameter show = 1, it highlights most of the dirt.
But when I process the clip to be cleaned with the filter, it doesn't seem to touch any of it.
Did I mess up the script?
Should I have an "interlaced" parameter both at ConvertToYV12, AND in the DeSpot sequence?
Is it failing to filter because most of the spots last for two frames instead of one?
Would someone please take pity on me, and give me a push in the right direction ?
Fizick
10th June 2006, 07:02
Yes, you must have an "interlaced" parameter both at ConvertToYV12, AND in the DeSpot sequence.
If you see red spots in show mode, they will be removed in normal mode.
grannyGeek
12th June 2006, 04:15
Fizick, thank you SO much for responding.
My main problem is that the Show parameter does indeed show the dirt, but when I run the filter to clean, it seems like it doesnt clean the spots that it highlighted the first time.
I don't understand how this can be.
What am I doing wrong?
I saw a rather complicated script elsewhere that includes DePan, do you recommend that I use that?
Fizick
12th June 2006, 09:07
Why you do not answer my question?
Do you see RED (colored) highlighted spots in show=1 mode?
If not, therefore spots are not detected, and you see highlighted motion zones only (they will not be removed).
Try tune parameters. Read the filter manual. I hope, you use last version 3.5.
grannyGeek
13th June 2006, 05:27
I'm sorry, I didn't realize you were asking a question :o
Yes, in show mode, DeSpot does highlight some spots in red, but in processing, not all of those that were marked get removed.
I'm not at my home computer right now, so I can't post screen shots of before and after.
If it would be helpful, I can post some tomorrow (?)
It also highlights a lot of spots in white that I want to have it identify as dirt, but I don't understand how to change the settings to do that.
am studying this thread and your manual again, and trying hard to understand how the parameters work. If it works for other people, there has to be a way I can get it to work for me.
Thanks for any advice you can give me, this newbie is really confused.
Fizick
13th June 2006, 19:57
It is often confused me too :)
Large spots removing is generally very hard task, and DeSpot is complex (and not perfect) filter.
That is why we try use motion compensation, etc.
You never can automtically remove ALL spots without artifactes, but you can remove great part of them and improve visual quality. :)
It is always better to underdenoise than overdenoise.
Part of spots can be removed only by hand (with rotoscoping software), frame by frame.
grannyGeek
14th June 2006, 07:40
Fizick, would you mind helping me out just a bit more?
If you are too busy, just tell me so, I certainly will understand.
First, a quick question --- Would it make a difference that I am using NTSC instead of PAL? Maybe that weird 29.97 fps makes trouble for DeSpot, because of blended frames and such.
With the first script I posted, DeSpot is identifying maybe 25% of the dirt, and removing only about 5%.
Second, I could really use some advice on another script I tried that includes DePan, I got this off another forum and adapted it a bit.
AviSource("c:\__CAP\Test-22s.avi")
Loadplugin("depan.dll")
Loadplugin("despot.dll")
Loadplugin("Convolution3DYV12.dll")
#
# Assume Bottom Field First
AssumeFieldBased() ### added after error message
AssumeBFF()
v=ConvertToYV12(interlaced=true)
#
# Separate Fields from Frame
AssumeFrameBased() ### added after error message
SeparateFields()
#
# Makes 3 copies of each frame for motion compensation
d = DePanEstimate(v,range=1, trust=3, log="depan.log")
DePanInterleave(v,data=d, prev=1, next=1, matchfields=false)
#
# Despot - remove noise
DeSpot(p1=35, p2=14, pwidth=20, pheight=30, mthres=25, motpn=true, dilate=1, seg=2, interlaced=true)
#
# Recover original frame
SelectEvery(3, 1)
#
# convolution3D Low Quality
odd=SelectOdd.Convolution3D (0, 6, 10, 6, 8, 2.8, 0)
evn=SelectEven.Convolution3D (0, 6, 10, 6, 8, 2.8, 0)
#
Interleave(evn,odd)
#
# Combine both fields back into a frame
weave()
#
converttoyuy2()
When I tried to open it, I got error :
SeparateFields sould be applied on frame-based material, use AssumeFrameBased() beforehand
So I added that in.
Then got error :
Weave sould be applied on frame-based material, use AssumeFieldBased() beforehand
So I added that in.
Then it opened ok, but when I went to process it I got this error
Cannot start video compression:
The source image format is not acceptable
(error code - 2 )
My clip was captured with DV codec in Pinnacle Studio
< don't laugh >.
In VirtualDubMod, I selected Panasonic DV codec for compression.
Please, could you give me a push in the right direction?
( I used to do a little bit of programming with Visual Basic, but this is a whole different animal, isn’t it )
Many thanks for your time and attention
Fizick
14th June 2006, 18:37
If your video is native NTSC TV or camcorder video (not Film), DeSpot must work well (in interlaced mode).
Please do not use this strange script.
Start with examples from DeSpot and DePan documentation.
And you still do not aswer me what Depan version you use.
grannyGeek
15th June 2006, 03:54
Hi again. I am getting very discouraged :(
I am using DeSpt v 3.5, and dePan v 1.7.
Don't know if it matters, my computer is XP-Home, SP2.
Now I have a NEW problem.
Last night I gave up on that crazy script, and went back to the first one I posted (its the simple one from your help-guide without DePan).
When I try to open VDM, I get new error that it cannot locate compressor for YV12.
I haven't changed anything on my computer since yesterday morning, but now it can't recognize the codec it used then.
What codec should I have for this?
Do you need a list of what is available on my computer?
foxyshadis
15th June 2006, 09:45
Installing xvid or setting ffdshow's vfw mode to decode YV12 will take care of that.
grannyGeek
16th June 2006, 06:17
Foxyshadis, thank you for that.
I will install ffdshow, and see if I can get that to work for me.
I will probably be back with more questions.
If my hair wasn't already gray, this episode would make it so !
;)
grannyGeek
3rd July 2006, 03:34
foxyshadis, I just wanted to pop back in to thank you.
Installing the xVid codec did the trick beautifully.
:thanks:
The ffdshow was fighting with WMP and I don't have the patience right now to try to troubleshoot that.
grannyGeek
3rd July 2006, 04:00
Fizick, are you still out there?
I think I found why I’m having problems, and I need advice.
__1__ If frame height is more than 300, and Interlace is set to True, the filter misses most of the spots, even if it marks them correctly in SHOW mode.
__2__ If I change Interlaced=true to FALSE, I get beautiful results, even with full frame size.
If I change it back to True, the spots come back.
Doubling pheight does not help.
__3__ If I crop to height of 300 or less, I get beautiful results, even with Interlace set to True.
I opened VirtualDubMod script editor, and changed crop height and interlaced settings back and forth, and watched the spots appear and disappear.
I’m sure my clip is interlaced, I can see interlace artifacts (the “stripes”)
What a confusion !!!
I’ve seen posts in other forums where users like me said the filter didn’t seem to do anything. I wonder if we all have interlaced source clips.
Might it be a bug in the filter, or is there another parameter I must change?
I’m thinking I should set deSpot Interlaced parameter to False.
But then, for ConvertToYV12, would I include parameter Interlaced = true?
Please, can you advise?
I have nowhere to post my clip, but here are some cropped screenshots.
I took them from the rendered avi, not from editing window in VDM.
My script:
path = "C:\Program Files\_Multimedia\_Video\AviSynth 2.5\plugins\"
LoadPlugin(path+"despot.dll")
AviSource("c:\__CAP\Test-22s.avi")
#
ConvertToYV12(interlaced=true)
#
# @@@ to increase cleaning ~~~ these have most effect
# go lower from defaults seg=2, dilate=1, p1=24, p2=12
# go higher from defaults mwidth=7, mheight=5
#
# What about INTERLACED ???
DeSpot(interlaced=false, pwidth=35, pheight=70,
\ p1=18, p2=10, dilate=0, seg=0,
\ mthres=16, mwidth=20, mheight=15, merode=33, motpn=true,
\ ranked=false, p1percent=0, blur=1, tsmooth=3, show=0)
My source was vhs movie, captured from vcr with usb device, using DV Video Encoder in Pinnacle Studio.
NTSC, 29.97 fps. Interlaced Frame size 720x480.
The dirt spots in my 20-second test clip are in the sky, top half of the frame.
Almost every frame has at least one big black spot, and almost every spot lasts two frames.
I’m using deSpot v 3.5, in an avs script in VirtualDubMod.
PC is P4 3.06 ghz, XP-Home SP2.
I hope you can help me, now I have seen what great results I can get from your wonderful filter, and want to make sure I am using it correctly.
Thanks for any advice.
johnmeyer
9th July 2006, 02:25
In the Despot documentation, and on the post on the previous page, I believe that msadb = sadf.Binarize() # binary inverted backward SAD maskshould bemsadb = sadb.Binarize() # binary inverted backward SAD maskIn other words sadf should instead be sadb. Otherwise it repeats the operation already done above.
grannyGeek
11th July 2006, 06:14
I'm trying to be patient, but it is hard.
Please, can anybody advise me about the interlace parameter that I asked about in previous post in this thread on 03 July?
Boulder
11th July 2006, 17:18
Try with
path = "C:\Program Files\_Multimedia\_Video\AviSynth 2.5\plugins\"
LoadPlugin(path+"despot.dll")
AviSource("c:\__CAP\Test-22s.avi")
#
LeakKernelBob(order=0,sharp=true,threshold=3)
ConvertToYV12()
#
# @@@ to increase cleaning ~~~ these have most effect
# go lower from defaults seg=2, dilate=1, p1=24, p2=12
# go higher from defaults mwidth=7, mheight=5
#
# What about INTERLACED ???
DeSpot(interlaced=false, pwidth=35, pheight=70,
\ p1=18, p2=10, dilate=0, seg=0,
\ mthres=16, mwidth=20, mheight=15, merode=33, motpn=true,
\ ranked=false, p1percent=0, blur=1, tsmooth=3, show=0)
AssumeBFF()
SeparateFields()
SelectEvery(4,0,3)
Weave()
You'll need LeakKernelDeint.dll for this to work. There are better bobbers available (such as TDeint(mode=1), SecureDeint and MVBob), but this is just for testing. You might be better off bobbing to full height frames, processing and then reinterlacing. I assume you have a bottom field first source since it's DV.
As it's a movie you're dealing with, chances are that it is originally progressive (is there a pattern of 3 non-combed frames followed by 2 combed frames?). You might want to open a new thread and post a sample clip there so we can check it out without polluting the DeSpot thread.
Fizick
14th July 2006, 19:26
johnmeyer,
thanks for documentation bug report.
Today I release v.3.5.0 with updated doc.
grannyGeek,
We with Boulder suppose, that your source was original film (24 fps). See typical film dust (scratch) on your example. You may do pulldown removal, get progressive video, and use interlaced=false.
try analyse the fields.
Case Despot(interlased=true,...) is mostly for true video interlaced source with analog video defects like small spikes.
grannyGeek
21st July 2006, 03:52
I just wanted to report back that I've had success.
Boulder, Fizick, you are correct. My source does turn out to be telecined, and for my purposes, I used DeComb / Telecide to de-interlace the "extra" frames and still keep the 29.97 fps frame rate that my NLE needs.
It's hard when you don't know about something, you don't even know the right terms to do a proper search.
Fizick, thank you for your wonderful filter.
I'm getting about 95% cleaning, and the clip looks great.
:thanks:
johnmeyer
21st July 2006, 16:38
grannyGeek,
For almost anything I can think of, you'd be better off doing an inverse telecine to get to 23.976, and then doing your editing with that. Perhaps I am spoiled using Vegas, but it lets you mix video on the timeline that has different fps. If you are going to go to DVD, the encode will be HUGELY better if you start with 23.976 and encode with the pulldown flag.
But maybe none of this applies with what you are doing ...
Boulder
21st July 2006, 19:40
That's true, because if you use only Telecide, you get duplicate frames which will look very, very annoying.
grannyGeek
22nd July 2006, 10:09
Hi johnmeyer, hello Boulder.
Yup, you're both correct there, and I think I've maybe got a way to work it out.
I was having a hard time trying to get a good 23.97 fps mpeg2 clip that DGPulldown could use (my software selection is pretty slim, and everything I have insisted on adding the 3:2 pulldown itself)
I finally broke down and actually used Pinnacle Studio v 10 (though I've had it installed for 4 months) and that version actually accepts 23.97 fps.
I've used Studio to render some test vobs straight from the 23.97 avi clips that I created with VirtualDubMpeg2.
They look pretty good to me.
Ok, just babbling on here, my apologies.
Thanks again for your feedback. I'm so glad folks like you are here to keep fools like me on track.
If there would be a better way to do this, I hope someone will advise me.
Granny
she's getting senile, but she has a lot of fun . . .
Vesi
3rd September 2007, 18:34
Hi Fizick.
i have a DVD which has small white dots and ver small with line. which parmerter or filter should i use to get ride of them.
Fizick
3rd September 2007, 23:59
despot with mvtools.
see example in despot doc.
start with default settings.
Vesi
4th September 2007, 01:52
thanks Fizick for replay.
@ could you provide some script that how to use MVtools with Despot. i have downloaded the despot V.3.5.0 and MVtools 1.8.4.
this is my first time i'm using this filter i releay need to learn it. and the source i'm using on it has many whit dots and and very little something like whit hair. i'm doing xvid rip. thanks in advance
Fizick
4th September 2007, 06:15
simplest example script:
AviSource("h:\kino.avi")
LoadPlugin("mvtools.dll")
LoadPlugin("despot.dll")
i = ConvertToYV12() # for Despot
vf = MVAnalyse(i, isb=false,idx=1)
f = MVCompensate(i, vf,idx=1)
vb = MVAnalyse(i, isb=true,idx=1)
b = MVCompensate(i, vb,idx=1)
Interleave(f, i, b)
DeSpot()
SelectEvery(3,1)
But source must be progressive (film) for this example.
Additional paramers of Despot is depended on type and size of your source clip defects.
Vesi
4th September 2007, 10:01
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\VagueDenoiser.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\despot.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mvtools.dll")
DGDecode_mpeg2source("C:\Documents and Settings\vesi\Desktop\test\test.d2v",cpu=4,info=3)
ColorMatrix(Mode="Rec.601->Rec.709",scaling=2,threads=2)
edeintted = AssumeTFF().SeparateFields().SelectEven().EEDI2(field=-1)
tdeintted = TDeint(edeint=edeintted,order=1)
tfm(order=1,clip2=tdeintted).tdecimate(hybrid=1)
crop( 2, 44, -2, -50)
BicubicResize(704,320,0,0.5) # Bicubic (Neutral)
VagueDenoiser(threshold=0.8, method=0, nsteps=6, chromaT=0.8)
here is the script. Source is dvd9 and rip size will be 1400MB.problem is i have never used Desopt and MVtools, so this is like start for me:) and deficult to know how to use it with deferent sources.
Fizick
4th September 2007, 17:58
if your dots is white, use settings Despot(sign=-1)
Fizick
4th September 2007, 22:27
full script:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\VagueDenoiser.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\despot.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mvtools.dll")
DGDecode_mpeg2source("C:\Documents and Settings\vesi\Desktop\test\test.d2v",cpu=4,info=3)
ColorMatrix(Mode="Rec.601->Rec.709",scaling=2,threads=2)
edeintted = AssumeTFF().SeparateFields().SelectEven().EEDI2(field=-1)
tdeintted = TDeint(edeint=edeintted,order=1)
tfm(order=1,clip2=tdeintted).tdecimate(hybrid=1)
crop( 2, 44, -2, -50)
i = last
vf = MVAnalyse(i, isb=false,idx=1)
f = MVCompensate(i, vf,idx=1)
vb = MVAnalyse(i, isb=true,idx=1)
b = MVCompensate(i, vb,idx=1)
Interleave(f, i, b)
DeSpot(sign=-1)
SelectEvery(3,1)
BicubicResize(704,320,0,0.5) # Bicubic (Neutral)
VagueDenoiser(threshold=0.8, method=0, nsteps=6, chromaT=0.8)
i have got your test clip (first 4 meg),
the cript works for frames 2,36, 130, 132.
But for frame 32 (and some others) the pupils of the eyes partially removed.
there is no any ideal filter. :(
Vesi
5th September 2007, 11:03
thanks alot Fizick. will give it try and let you know.
Vesi
8th September 2007, 02:08
i did the rip and quality was an awesome, thanks alot. as you saw the Screen shots or the spots, if i get more spots for example in source what should i change then, which parmeters. thanks again
Fizick
23rd October 2007, 21:28
if your spots are quite large, try increase pwidth and pheight.
but it may result in ugly artefactes (false detecting).
Vesi
10th January 2008, 23:31
Edit:
kiwiusa
28th January 2008, 17:12
All,
I have the only copy of some 8mm film that has been captured onto PAL VHS and I'm trying to clean it up as best I can.
The best results I have had so far is by decimating every second frame as some of the scratches seem to last 3 frames, but I'm sure I'm missing something.
Here is a link to a small clip, if somebody would be so kind as to give me some pointers.
http://rapidshare.com/files/87194482/clip.mpv
Thanks,
Al
johnmeyer
28th January 2008, 17:54
You have to use a capture method that captures one frame of film to one frame of video (like Moviestuff's Workprinter). Otherwise the scratch filter won't work.
kiwiusa
28th January 2008, 18:30
You have to use a capture method that captures one frame of film to one frame of video (like Moviestuff's Workprinter). Otherwise the scratch filter won't work.
Thanks for the reply John,
As the original 8mm film is now lost and I have the only remaining VHS tape copy, re-recording it is not an option.
What is the best I can hope for given these limitations?
Al
Fizick
28th January 2008, 19:25
you soult try :
1) restore original (about 16) fps
2) apply a filters
3) convert to 25 fps backward
your clip (first megabyte downloded) is fine restored to 16.666 fps with:
MPEG2Source("F:\Internet\080128\clip.d2v", cpu=0)
separatefields
selectevery(6,0,1,4,5)
weave
try check rest of your source.
kiwiusa
28th January 2008, 19:53
you soult try :
1) restore original (about 16) fps
2) apply a filters
3) convert to 25 fps backward
your clip (first megabyte downloded) is fine restored to 16.666 fps with:
MPEG2Source("F:\Internet\080128\clip.d2v", cpu=0)
separatefields
selectevery(6,0,1,4,5)
weave
try check rest of your source.
Thank you very much Fizick, I will try that tonight and let you know.
Al
kiwiusa
29th January 2008, 04:20
you soult try :
1) restore original (about 16) fps
2) apply a filters
3) convert to 25 fps backward
your clip (first megabyte downloded) is fine restored to 16.666 fps with:
MPEG2Source("F:\Internet\080128\clip.d2v", cpu=0)
separatefields
selectevery(6,0,1,4,5)
weave
try check rest of your source.
Fizick, you are my hero, the results are awesome. Thank you so very much.
Two quick questions as I am a novice at this.
1) To convert back to 25fps I just used ConvertFPS(25) and the results were fine to my naked eye. Is there a better way?
2) When I re-encode to mpeg2 using TMPGenc prior to DVD building should I save as progressive or interleaved?
Thanks again,
Al
johnmeyer
29th January 2008, 05:10
I would encode to DVD as progressive 25 fps.
Fizick
29th January 2008, 05:54
1. There are many ways to convert to 25 fps. No one is perfect.
Yor clip was converted by somewhat similar to:
# again telecine 16.666 fps to 25 fps (interlaced ?)
assumetff
separatefields
interleave(last,last)
selectevery(8,0,2,1,6,5,7)
weave
It may be also done with special pulldown, MVFlowFps, etc.
My advice is temporary forget about converting to 25 fps (it is off-topic here) and concentrate on:
- perfect restoring to 16.666 (may be some fieldmatcher like TFM-TDecimate can produce more stable results especially on VHS frame drops VHS)
- sime filtering with DeSpot, MVTools, ets (if you want).
I am sure, it takes a while :)
kiwiusa
31st January 2008, 02:30
1. There are many ways to convert to 25 fps. No one is perfect.
Yor clip was converted by somewhat similar to:
# again telecine 16.666 fps to 25 fps (interlaced ?)
assumetff
separatefields
interleave(last,last)
selectevery(8,0,2,1,6,5,7)
weave
It may be also done with special pulldown, MVFlowFps, etc.
My advice is temporary forget about converting to 25 fps (it is off-topic here) and concentrate on:
- perfect restoring to 16.666 (may be some fieldmatcher like TFM-TDecimate can produce more stable results especially on VHS frame drops VHS)
- sime filtering with DeSpot, MVTools, ets (if you want).
I am sure, it takes a while :)
Still working on it but weird things are happening:
If I use your original suggestion
SeparateFields()
SelectEvery(6,0,1,4,5)
Weave()
or
TFM()
TDecimate(Mode=2 ,Rate=16.666)
I get a nice 16.666 frame rate but there are still many areas of the clip where I have up to 6 duplicate frames in a row.
As I'm not concerned about audio sync, is there anyway to decimate "all" duplicates so as to give DeSpot a fair chance?
Alan
kiwiusa
31st January 2008, 16:19
OK, I did some more reading and I'm going to give MultiDecimate a try tonight. I'm also going to switch to a DGIndex input instead of DirectShow to see if that helps.
Wish me luck...
johnmeyer
31st January 2008, 18:30
I have done lots of work with film transfer and also recovering 24p (or 18p or 16p) from film that has been telecined. The transfer process used on that film was different than a true telecine, but similar enough that TFM, with the proper parameters, will probably be able to remove most duplicates. What you need to do is use "separatefields", and then feed that script into VirtualDub. Then, look at each field and see how many duplicates you get, and what pattern they have. When looking at fields, you need to have at least two in a row from each frame of film (because you need both fields to create a full-resolution frame of video). However, as soon as you see a third field, you need to decimate (remove) that. Remember that decimation is done on a per-field basis, not per frame. TFM (and its associated decimation plugin) is definitely the thing to be using for this process.
kiwiusa
1st February 2008, 15:17
Fizick and John,
Firstly, thanks for all the help. You guys are great.
The change from DirectShow to Dindex did the trick and I didn't need to use MultiDecimate. In fact in my 2 hour video, I can only detect about 4 dup's now.
Despot is handling everything except at scene changes (which I expected). I also used some MVTools stabilization and Descratch.
It all looks good.
Thanks again
Al
johnmeyer
8th February 2008, 21:07
I don't think I posted this. It is my script for "despotting" 16mm film. Each frame of video contains one frame of film and therefore can be treated as progressive. After years of not quite getting despot to work right, the results with this script are amazingly good and seem to work across many different exposure and film stocks. The key to getting things to work was using the motion compensation.
Hope this helps someone.
AVISource("J:\OPRFHS 1969 FILMS\1969-09-13 LaGrange0001.avi")
loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools.dll")
loadplugin("c:\Program Files\AviSynth 2.5\plugins\despot.dll")
i = ConvertToYV12() # for Despot
vf = MVAnalyse(i, isb=false,idx=1)
f = MVCompensate(i, vf,idx=1)
vb = MVAnalyse(i, isb=true,idx=1)
b = MVCompensate(i, vb,idx=1)
Interleave(f, i, b)
DeSpot(show=0,p2=4,mthres=8,p1=15,pwidth=70,pheight=70,mwidth=20,mheight=15,interlaced=false,merode=33,ranked=true,p1percent=0,dilate=0,fitluma=true,blur=4,motpn=false,seg=0,sign=1)
output=SelectEvery(3,1)
stackvertical(i,output)
Obviously, you comment out the "stackvertical" command when doing final output.
kiwiusa
21st February 2008, 16:40
Or have I got some version problems with dlls etc.
Here is my very simple AVSp test script.
setmemorymax(512)
IL = ([<"Interlaced ?", 0, 1, 1>] == 0) ? false : true
version()
ConvertToYV12(Interlaced=IL)
despot(Interlaced = IL)
Everytime I move the slider I get an Access Violation error.
Any help or redirection greatly appreciated.
Al
Fizick
23rd February 2008, 09:44
1.What with avisynth 2.5.7?
2.What without Avsp?
3. What is despot version?
kiwiusa
23rd February 2008, 17:49
Hi Fizick,
I get the same results with AviSynth 2.5.7 (Dec 31, 2006) as below.
Exception exceptions.WindowsError: 'exception: access violation reading 0x03D1001F' in <bound method PClip.__del__ of <avisynth.PClip instance at 0x02812A58>> ignored
AvsP is Version 2.0.2
Despot is Version 3.5.1.0
Hope this helps,
Al
johnmeyer
27th March 2008, 00:46
Despot doesn't work on some frames. It works fine for dozens of frames, and then stops working for several frames. I have spent hours changing every conceivable parameter, but can't get it to work. I am now wondering if it is a bug. This doesn't appear to have anything to do with a scene change, or with anything that could be confused with a scene change.
I am using Despot Version 3.5.1.
Here is the script:
# Despot test script
loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools.dll")
loadplugin("c:\Program Files\AviSynth 2.5\plugins\deflicker.dll")
loadplugin("c:\Program Files\AviSynth 2.5\plugins\despot.dll")
Avisource("d:\test.avi")
i = ConvertToYV12()
vf = MVAnalyse(i, isb=false,idx=1)
f = MVCompensate(i, vf,idx=1)
vb = MVAnalyse(i, isb=true,idx=1)
b = MVCompensate(i, vb,idx=1)
Interleave(f, i, b)
Deflicker(percent=99, lag=5,scene=15, info=false)
DeSpot(show=1,p2=5,mthres=9,p1=22,pwidth=70,pheight=110,mwidth=7,mheight=10,mscene=90,interlaced=false, \
merode=73,ranked=true,p1percent=0,dilate=0,fitluma=true,blur=4,motpn=true,seg=0,sign=1)
SelectEvery(3,1)
I have uploaded this script, along with a short DV AVI file that illustrates the problem (and I've included the DLLs for Despot and Deflicker, just to make sure we're all on the same page). Here is the link (this is only good for seven days):
http://download.yousendit.com/DE86CE26252A263E
Here's frame 9 from the test clip, with "show" set to true. As you can see from the pink, lots of dirt is being removed:
http://i177.photobucket.com/albums/w208/johnmeyer/GoodDespot.jpg
Then, here is the next frame:
http://i177.photobucket.com/albums/w208/johnmeyer/BadDespot.jpg
While the motion protected areas are still shown (you'll see a few white patches in the trees in the second picture, you won't see any dirt removal (pink). Despot seems to work for about 5-6 frames, and then stops working for 1-3 frames, although this isn't a consistent pattern. This is very old film, so there is some flicker due to how it was processed in 1928. I tried to minimize this by using Deflicker, although it only makes a slight improvement.
This film was captured with a machine that is equivalent to a Workprinter (i.e., frame-by-frame) so there is absolutely zero flicker introduced by the transfer process.
So, if anyone can tell me why this is happening, I'd sure like to know. If it is a bug, hopefully this will help the author track it down.
Quick update (ten minutes after initial post): I think the problem is with the MVAnalyze code, which I took directly from the doc. Without motion comp, Despot does something to every frame.
rfmmars
27th March 2008, 01:58
Thanks for the clip and script. Here is what I did. Ran the script and saved the file. Loaded that file and ran the script again. Loaded that file and ran the script once more. On all runs, a pattern developed and with each run, more frames were cleaned than before. Here's the pattern on the third run.
Bold frames are the cleaned frames
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
16,17,18,19,20,21,22,23,24,25,
26,27,28,29,30,31,32,33
,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,
50
Hope this will be some help.
EDIT: As you see my frame count is 8 higher than reported by AVSp, This is the number of clicks of the "right arrow in AVSp"
Richard
photorecall.net
johnmeyer
27th March 2008, 03:18
Thanks for the help. I had never thought of interating the script.
I have spent several more hours on this and found that the problem with skipped frames is because of a defect in MVAnalyze, not Despot. I switched to Depan for motion estimation, and the problem went away. I have always suspected that there are problems with MVAnalyze, and if you take my script and comment out the SelectEvery statement, as you step through the video you will see that there is absolutely no motion estimation being done on some frames. It is these frames that don't get any "despotting" because the "previous" and "next" frames (which are generated by MVtools) are identical to the reference frame and therefore Despot doesn't see any differences, and therefore does nothing.
There are still lots of other fun things to do to "perfect" the despotting with this 12 fps clip (whoever took it was cranking really slowly, probably to save film). Because there is so much time between frames, there are huge differences between each adjacent frame, and therefore despot has to deal with lots of stuff that normally wouldn't be a problem at 30 fps.
Didée
27th March 2008, 08:21
Probably that's not a "defect" of MVAnalyze, but rather all the noise & dirt is triggering the scenechange threshold.
For a quick test, increase thSCD1:
f = MVCompensate(i, vf,idx=1, thSCD1=9999)
b = MVCompensate(i, vb,idx=1, thSCD1=9999)
If that eliminates the problem of not-processed frames, then noise is the culprit.
johnmeyer
27th March 2008, 18:04
all the noise & dirt is triggering the scenechange threshold.
Bingo!
I spent all that time working with the mscene parameter in Despot, because the problem sure looked like a scene change issue, but in doing so completely forgot that MVAnalyze has a scene change parameter as well.
This fixed the problem. Many thanks.
johnmeyer
28th March 2008, 22:07
Many thanks for the help. Since the film from which this clip came was filmed in 1928 at 12 fps, the temporal changes between each frame is extreme, which makes motion estimation tough to do, and also the flicker due to how the film was developed (the capture process introduced no flicker) made the scene detection go bonkers (as was pointed out above).
I "solved" the first problem by using a combination of a mask created with MVTools, and the internal motion comp built into Despot. I made huge progress on the second problem (flicker) by using the old VirtualDub filter instead of Deflicker. Getting rid of the flicker prior to doing Despot makes a HUGE difference. Unfortunately, it also blows out the highlights in some places, so I may re-write the script to use the "deflickered" video to drive the despotting, but actually perform the despotting on the original, flickery film. I haven't yet figured out how to do that.
If you are interested, here are two short clips, showing before:
http://www.youtube.com/watch?v=b92SThVVgZ4
and after:
http://www.youtube.com/watch?v=e8c0r_oD8WQ
deras
1st October 2008, 21:59
(first, mi english is not very good).
Hi, I need help to use DeSpot and DeScratch AviSynth plugins with a Super8 video.
I use DeScratch for the black vertical lines, and DeSpot for the black spots in the video, like this (in the bottom and left):
http://i195.photobucket.com/albums/z257/derass/captura_S8_tacanegra_despotNO.jpg
DeScratch reduces some lines, but not a lot, and I think that it's possible to reduce more. And DeSpot I think that don't do anything, I suppose because of the configuration I gived it.
I upload the Super8 video, please, if someone can help me with any information about those plugins, please, write it.
Video: http://www.megaupload.com/?d=FVLAUSQ5
And this is the script I use:
# PLUGINS
LoadPlugin("J:\plugins\mpeg2dec3.dll")
LoadPlugin("J:\plugins\cnr2.dll")
LoadPlugin("J:\plugins\descratch.dll")
LoadPlugin("J:\plugins\despot.dll")
#
# SOURCE
AviSource("J:\S8\videof.avi")
#
# COLOR
CNR2()
Tweak(hue=-5, sat=1.25, bright=15, cont=0.7)
#
DeScratch(mindif=3)
#
DeSpot(median=false)
Thank you to all the people that read my post and help me.
johnmeyer
1st October 2008, 23:23
I can't solve all your problems, but I can point you in the right direction for how to use despot.
First of all, this assumes that your footage is progressive. I capture 16mm, Super8, and 8mm film using a "Workprinter" so I end up with one frame of video for each frame of film. Even if the video is saved using the DV codec, which encodes interlaced, the resulting footage can be treated as progressive because there is no temporal difference between adjacent fields.
Second, you will still need to tweak the settings for despot in the script below because each film is different.
The key to getting despot to work well is to feed it a motion compensated clip, as I do with MVTools in the script below. Before I figured this out, I spent months trying to get despot to work, and it never seemed to do much.
Also, pay attention to the scene detection threshold. If you set that incorrectly, despot will quit working on some frames, because it thinks it has detected a scene change.
# Despot script for B&W 12 fps film with lots of flicker
loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools.dll")
loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\masktools.dll")
loadplugin("c:\Program Files\AviSynth 2.5\plugins\despot.dll")
prefilt=Avisource("E:\Stan's Film\Barney and Google.avi").ConvertToYV12()
i=prefilt
#Create mask
ml = 100 # mask scale
thscd1 = 800 # scene change
vf = prefilt.MVAnalyse(isb=false, truemotion=true) # forward vectors
cf = i.MVFlow(vectors=vf, thscd1 = thscd1) # previous compensated forward
sadf = i.MVMask(vectors=vf, ml=100,kind=1,gamma=1, thscd1 = thscd1)
msadf=sadf.Binarize() # binary inverted forward SAD mask
vb = prefilt.MVAnalyse(isb=true, truemotion=true) # backward vectors
cb = i.MVFlow(vectors=vb, thscd1 = thscd1) # next compensated backward
sadb = i.MVMask(vectors=vb, ml=ml, gamma=1, kind=1, thscd1 = thscd1) # backward SAD mask
msadb = sadb.Binarize() # binary inverted backward SAD mask
msad = Logic(msadf,msadb,"OR") # combined inverted SAD mask
msad = msad.Expand() # expanded inverted SAD mask
msadi = Interleave(msad, msad, msad) # interleaved 3-frame inverted SAD mask
Interleave(cf,i,cb) # interleave forward compensated, source, and backward compensated
DeSpot(show=0,maxpts=1200,p2=5,mthres=11,p1=22,pwidth=100,pheight=140,mwidth=7, \
mheight=5,mscene=90,interlaced=false,merode=58,ranked=true,p1percent=25,dilate=2, \
fitluma=true,blur=2,motpn=false,seg=1,sign=1,extmask=msadi)
SelectEvery(3,1)
#output=SelectEvery(3,1)
#stackvertical(prefilt,output)
Here is a link to about ten seconds of a very dusty 1928 16mm film:
http://www.youtube.com/watch?v=b92SThVVgZ4
and here is the same film after cleaning with the above script. Ignore the first second of the cleaned film (because it wasn't cleaned -- long story). You can open these in separate browser windows and play them side-by-side if you want to get a real-time view of the before/after.
http://www.youtube.com/watch?v=e8c0r_oD8WQ
The difference between the two clips, especially if you view them side-by-side, is pretty remarkable. Despot can do some remarkable things.
As for descratch, I've never gotten it to work properly.
P.S.
I looked at your film, and you won't get very far unless you first do IVTC to remove the redundant fields.
P.P.S. I just looked at the film one field at a time, using separatefields() in AVISynth, and I'm not sure you'll be able to do anything with Despot, even if you first do IVTC. The problem is that the capture method you used ends up blending one frame of film across many, many fields. For instance, if you just do a separatefields command, then on "frame" 3194 (which is actually "field" 3194) you'll see a dust spot start to appear next to the woman's hand holding the purse. That spot comes into full view in subsequent fields, but is still visible in field 3200. That is seven fields. If the transfer is done properly, that spot should only appear on two fields which, when combined together, would be one frame of film. There is no way you can remove a spot when it appears on that many fields.
lansing
22nd October 2008, 05:00
i ran into a similar problem kiwiusa has in post #121 with AvsP, and also with Megui and Virtualdub.
here's my script:
DeSpot(pwidth=50,pheight=50,p1=14,p2=8,mthres=10,mwidth=30,mheight=30,color=true)
LimitedSharpenFaster(strength=25)
FastLineDarkenmod(strength=40,thinning=0)
tweak (bright=12.75)
convolution3d("animehq")
spline36resize (716,540)
when i open it with Megui, either I close the preview window or enqueue the encoding job, the program crashed. Happened the same with Virtualdub when it starts to encode the script. The only program that encode successfully was Avidemux. Any help on this problem?
Fizick
22nd October 2008, 10:23
---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
Script error: there is no function named "FastLineDarkenmod"
(F:\Papa\c\despot351\Release\despot66.avs, line 7)
---------------------------
ОК
---------------------------
Any ideas? :)
krieger2005
22nd October 2008, 11:35
Don't know if this is the latest release: http://forum.doom9.org/showpost.php?p=1035405&postcount=3
Fizick
22nd October 2008, 11:55
I have no any problem with AVSP or VDubMod.
Other host are not supported by me :)
it is quite possible, that problem is in specific source.
lansing, have you any problem with other clips? if not, upload small part of problem clip.
if yes, try clean your plugins folder :)
lansing
22nd October 2008, 19:48
I've test the script with different source, they have the same crash on VDub and Megui. But when I commented out DeSpot(), everything works fine.
i've also tried both cleaning up the plugin folder and reinstalling Avisynth, the problem still exist. VDubMod works fine encoding though.
CORRECTION: VDub encode fine when not starting it in the job list
Fizick
22nd October 2008, 21:23
lansing, so VirtualDub (what version? or VirtualDubMod?) encode with a crash, only if it starting from job list?
Please say step by step. :)
Also source size, fps, and may be type of encoding (xvid?)
lansing
22nd October 2008, 22:05
lansing, so VirtualDub (what version? or VirtualDubMod?) encode with a crash, only if it starting from job list?
Please say step by step. :)
Also source size, fps, and may be type of encoding (xvid?)
VirtualDub 1.8.6 and VDMod 1.5.10.3 will both encode when I select save as avi. They both crash when I save it as a job and then run it in the Job control window. Closing the video in VD/VDMod, reopening the video, or closing VD/VDMod will also lead to crashes.
this (http://www.mediafire.com/download.php?ynvjz2njimk) is a sample of the source I'm trying to work on
Fizick
22nd October 2008, 22:33
DeSpot version?
lansing
22nd October 2008, 23:07
despot version?
3.5.1.0
Fizick
23rd October 2008, 09:33
I can not confirm a bug.
Anybody else?
i khow about some strange code fragments in Despot, but i can not figure the exact bug place (if any).
may be you can provide virtualdub bug report?
Fizick
23rd October 2008, 15:20
OK, I made trial version 3.5.2, temporal link is here:
http://avisynth.org.ru/despot/despot.dll
I try fix (or prevent) some memory problem (in filter constructor-destructor), but.... it is hard to fix if I had no any problems with 3.5.1. :)
i will look more after responce.
What I really want, it is to add YUY2 support to DeSpot.
lansing
23rd October 2008, 16:42
OK, I made trial version 3.5.2, temporal link is here:
http://avisynth.org.ru/despot/despot.dll
I try fix (or prevent) some memory problem (in filter constructor-destructor), but.... it is hard to fix if I had no any problems with 3.5.1. :)
i will look more after responce.
What I really want, it is to add YUY2 support to DeSpot.
yes, this one fix it
Fizick
23rd October 2008, 17:09
Well!
I found one more bug with external mask for some width values, will fix it too :)
lansing
24th October 2008, 00:32
I'm having difficulties tweaking despot for my anime video for hours, a tweaking works for some scenes, and then over worked for other scenes. Here's the sample video (http://www.mediafire.com/download.php?grk1okjtmmt) that I mixed from several different scenes from the same video.
Here's the script from the document that I use:
avisource ("mixed sample.avi")
i = ConvertToYV12()
prefilt=i.DeGrainMedian() # prefiltered for better motion analysis
# analyse and compensate motion forward and backward (to current frame)
ml = 100 # mask scale
thscd1 = 400 # scene change
vf = prefilt.MVAnalyse(isb=false, truemotion=true) # forward vectors
cf = i.MVFlow(vectors=vf, thscd1 = thscd1) # previous compensated forward
sadf = MVMask(vectors=vf, ml=ml,kind=1,gamma=1, thscd1 = thscd1) # forward SAD mask
msadf=sadf.Binarize() # binary inverted forward SAD mask
vb = prefilt.MVAnalyse(isb=true, truemotion=true) # backward vectors
cb = i.MVFlow(vectors=vb, thscd1 = thscd1) # next compensated backward
sadb = MVMask(vectors=vb, ml=ml, gamma=1, kind=1, thscd1 = thscd1) # backward SAD mask
msadb = sadb.Binarize() # binary inverted backward SAD mask
msad = Logic(msadf,msadb,"OR") # combined inverted SAD mask
msad = msad.Expand() # expanded inverted SAD mask
msadi = Interleave(msad, msad, msad) # interleaved 3-frame inverted SAD mask
# This mask is high (255) where at least one motion estimation is good,
# so these areas will be protected
Interleave(cf,i,cb) # interleave forward compensated, source, and backward compensated
DeSpot(p1=15,p2=1,pwidth=40,pheight=40,mthres=4,merode=25,p1percent=10,sign=0,show=0,seg=0,color=true,motpn=true, extmask=msadi)
SelectEvery(3,1) # get filtered source
The script give acceptable result keeping the stars in one scene while removing spots on the other, but for the scene when it is a panning of a door, there're several false spots that has been removed.
Any suggestion about how can I compromise this?
Fizick
24th October 2008, 08:58
Try seg=1 or 2. it should be safer.
sorry, i have have no time to check your clip.
lansing
26th October 2008, 00:36
thanks, I'll try my luck here.
I'm thinking to resize the video to a bigger size and run despot to wipe out the tiny spots, and then run despot again with another setting to remove the bigger spots. But I'm kind of confuse with the order of the script,
will this script do what I just meant?
AVISource("source.avi")
source = spline36resize (716,540)
backward_vectors = source.MVAnalyse(isb = true, truemotion=true, delta = 1, idx = 1)
# we use explicit idx for more fast processing
forward_vectors = source.MVAnalyse(isb = false, truemotion=true, delta = 1, idx = 1)
forward_compensation = source.MVFlow(forward_vectors, idx=1, thSCD1=500) # or use MVCompensate
backward_compensation = source.MVFlow(backward_vectors, idx=1, thSCD1=500) # or use MVCompensate
# create interleaved 3 frames sequences
interleave(forward_compensation, source, backward_compensation)
DeSpot(setting)
selectevery(3,1) # return filtered central (not-compensated) frames only
DeSpot(setting)
johnmeyer
26th October 2008, 00:41
I don't think that re-sizing the video to make the spots bigger will do anything, except chew up time, and possibly degrade your video.
lansing
28th October 2008, 04:35
@john
in my case, I'm going to upsize it before or after anyway, so it worth a test.
after a few harsh days of trials and errors, I'm just going to surrender to the saying that there's no one setting that will work for the whole clip. What I'm really looking for now is a parameter/way to tell despot not to despot certain segments of the clip, ie. frame 100 to 200?
thetoof
28th October 2008, 04:57
source=your file
source.your filtering with despot...
filtered=last
section1=filtered.trim(0,99)
section2=source.trim(100,200)
section3=filtered.trim(201,0)
section1+section2+section3
That's only a skeleton... but the logic is quite easy to understand.
lansing
28th October 2008, 05:15
source=your file
source.your filtering with despot...
filtered=last
section1=filtered.trim(0,99)
section2=source.trim(100,200)
section3=filtered.trim(201,0)
section1+section2+section3
That's only a skeleton... but the logic is quite easy to understand.
Thanks toof for the enlightenment to a beginner. I always thought that trim() will be very painful if I have many segments to trim out before I see this.
Edit:
If I was running Despot with MVAnalyse like this, how should I put it in order?
source = ConvertToYV12()
backward_vectors = source.MVAnalyse(isb = true, truemotion=true, delta = 1, idx = 1)
# we use explicit idx for more fast processing
forward_vectors = source.MVAnalyse(isb = false, truemotion=true, delta = 1, idx = 1)
forward_compensation = source.MVFlow(forward_vectors, idx=1, thSCD1=500) # or use MVCompensate
backward_compensation = source.MVFlow(backward_vectors, idx=1, thSCD1=500) # or use MVCompensate
# create interleaved 3 frames sequences
interleave(forward_compensation, source, backward_compensation)
DeSpot(setting)
selectevery(3,1) # return filtered central (not-compensated) frames only
thetoof
28th October 2008, 05:45
source = ConvertToYV12()
backward_vectors = source.MVAnalyse(isb = true, truemotion=true, delta = 1, idx = 1)
# we use explicit idx for more fast processing
forward_vectors = source.MVAnalyse(isb = false, truemotion=true, delta = 1, idx = 1)
forward_compensation = source.MVFlow(forward_vectors, idx=1, thSCD1=500) # or use MVCompensate
backward_compensation = source.MVFlow(backward_vectors, idx=1, thSCD1=500) # or use MVCompensate
# create interleaved 3 frames sequences
interleave(forward_compensation, source, backward_compensation)
DeSpot(setting)
filtered = selectevery(3,1) # this line is the final step of your despot sequence
a=filtered.trim
b=source.trim
c
...
a+b+c+....
other filters
Make sure you IVTC, deinterlace before source=
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.