PDA

View Full Version : Fizicks Depan plugin


videoFred
16th February 2005, 08:19
Hello everybody,

I have some questions about Fizicks exellent depan plugin.


I'm transfering Super-8 films with a home made system:
a modified Eumig projector with a 1024x768 machine vision camera.
I transfer frame by frame.
This way, I have progressive 1024 x 768 AVI-files, Huffyuv codec, 15FPS.(HUGE files!)
No hotspot, no flickering, very good quality.

You find a Mpeg1 20MB example here.(right click, save target...)
ftp://ftp.filmshooting.com/upload/video/mpg/videoFred_examples.mpg


Discription of my system: (Dutch, but with many pictures)
Look for the machine camera, not the webcam (previous system)
The frames and movies where made with the old webcam system.
http://users.telenet.be/ho-slotcars/s8_index.htm


I use this depan script to stabilise the films:

avisource("006.avi")
loadplugin("depan.dll")
loadplugin("MSharpen.dll")
loadplugin("FluxSmooth.dll")
i=converttoYV12()
mdata=DePanEstimate(i)
DePanStabilize(i,data=mdata,cutoff=0.5)
converttoYUY2
FluxSmoothST(8,12)
MSharpen(0,125,true,false,false)



This works very, very well. It works very fast, and in one pass.
I prefer this script above Gunnars VirtualDubs deshaker because the film looks more natural with this script. But Gunnars deshaker is also very good.
Then I save my stabilised and resized (720x576) clip again with Huffyuv, still 15FPS.

After stabilising, scenes with much panning are shaking.
I have this same effect with Gunnars deshaker, too.

Fizicks script for framerate conversion is the perfect solution for this:



function fps3to5(clipYV12)
{
# change FPS from 3 to 5 (or 15 to 25, or 18 to 30 and so on), i.e. with factor=5/3
# uses global motion compensation
# input must be YV12 progressive (or separated fields probably ?)
data = DePanEstimate(clipYV12,trust=0)
t3_5 = DePan(clipYV12, data, offset=-2./5)
t6_5 = DePan(clipYV12, data, offset=1./5).trim(2,0)
t9_5 = DePan(clipYV12, data, offset=-1./5).trim(1,0)
t12_5 = DePan(clipYV12, data, offset=2./5).trim(3,0)
Interleave(clipYV12, t3_5, t6_5, t9_5, t12_5)
SelectEvery(15,0,1,2,3,4)
}

AviSource("001.avi")
assumefps(15)
LoadPlugin("depan.dll")
ConvertToYV12()
fps3to5()

Panning is now S-M-O-O-T-H!!!!!!!!!!
Actualy, I think this is the best script for smooth panning....
You see this on the example movie: panorama from the old city.(1972,Brugge,Flanders,Belgium)

Scenes with moving objects are more difficult: the objects are shaking.
The solution is: the trust parameter from DePanEstimate.
If I set this to 50 or more, objects are not shaking anymore.

AND NOW THE BIG PROBLEM:
Scenes with both panning and moving objects.
By playing around with the trust parameter I get either the pannig or the moving objects right, but not both.

A possible solution is this one:
I wrote a script that runs depan twice on the same clip, once with trust=0 and once with trust=50 or more.
Then, I take parts of both clips and put them together again. Of cource, I need to know in advance where to apply the different trust parameters.

function afps3to5(clipYV12)
{
# change FPS from 3 to 5 (or 15 to 25, or 18 to 30 and so on), i.e. with factor=5/3
# uses global motion compensation
# input must be YV12 progressive (or separated fields probably ?)
data = DePanEstimate(clipYV12,trust=0)
t3_5 = DePan(clipYV12, data, offset=-2./5)
t6_5 = DePan(clipYV12, data, offset=1./5).trim(2,0)
t9_5 = DePan(clipYV12, data, offset=-1./5).trim(1,0)
t12_5 = DePan(clipYV12, data, offset=2./5).trim(3,0)
Interleave(clipYV12, t3_5, t6_5, t9_5, t12_5)
SelectEvery(15,0,1,2,3,4)
}

function bfps3to5(clipYV12)
{
# change FPS from 3 to 5 (or 15 to 25, or 18 to 30 and so on), i.e. with factor=5/3
# uses global motion compensation
# input must be YV12 progressive (or separated fields probably ?)
data = DePanEstimate(clipYV12,trust=60)
t3_5 = DePan(clipYV12, data, offset=-2./5)
t6_5 = DePan(clipYV12, data, offset=1./5).trim(2,0)
t9_5 = DePan(clipYV12, data, offset=-1./5).trim(1,0)
t12_5 = DePan(clipYV12, data, offset=2./5).trim(3,0)
Interleave(clipYV12, t3_5, t6_5, t9_5, t12_5)
SelectEvery(15,0,1,2,3,4)
}

AviSource("001.avi")
assumefps(15)
LoadPlugin("depan.dll")
ConvertToYV12()
A=afps3to5()
B=bfps3to5()
C=TRIM(A,0,250)
D=TRIM(B,250,0)
C+D

This works fine on scenes with panning at the begin and moving people at the end or otherwise.
But maybe someone could give me some more tips or settings to try out?
Also, is it possible to change framerate 18-25?



Fred.

Fizick
16th February 2005, 23:32
1) If somebody do not know what is DePan and its long history, see the thread:
http://forum.doom9.org/showthread.php?s=&threadid=66686
:)

2) Fred,
I repeat here my private answer ;)

Also, is it possible to change framerate 18-25?

My films are mostly old Normal8 (16 fps).
I think, it is possible to change framefate with a factor 4/3, i.e. from 18 to 24, or from 18.75 to 25.
You can try write such function yourself (on base of my fps2to3 and fps3to5 functions).

But recently I realize, that we can use simple function ConvertFPS(25) with following DePanStabilize to achieve quite good results in one pass without additional interpolation (by fps2t3).
ConvertFPS simply dups frames.
Of course, the local motion will not smoothed in any case.
But I am did not try this method with real films yet.
Please, try.

scharfis_brain
16th February 2005, 23:51
convertfps will fail.
it has to be changefps.

@videofred:

if you really want to create a fullframe smooth motion, you may want to test mvconvertfps
from mvtools 0.9.6.2 of manao

this function will to a motion compensation based on blocks.
not only on global motion.

Fizick
17th February 2005, 06:30
Oops. Yes, of course, Changefps(25)

videoFred
17th February 2005, 10:23
Thank you both Fizick and Sharfis for the answers.:p
I did some more tests: after stabilising with depan, most of the clips are very good, even with moving people. No stuttering, smooth movement.:cool:

It was the framerate conversion 15-25 with depan that caused the stuttering movement. However, this kind of framerate conversion is the best for scenes with (only)panning.

For the other scenes I use virtualdub 1.6.2 to do the 15-25 conversion. But now I have another problem: VD 1.6.2 gives an Avisynth error when saving Avisynth files??? :angry:

About mvtools: I think these tools are for more advanced users, right? To be honest, as a newbie, I don't understand how to use them....:scared:

Any help is more than welcome...

Fred.

rfmmars
17th February 2005, 19:02
videoFred.........Great website......great work. I see that I am not the only one that knows there are better NLEs than the 2 $700.00 ones everybody thinks are so great. I am speaking of MEP2005 from Magix and may be known in your country as Video Deluxe 2005 Plus. There newest bomb shell is Edit Pro 10 which will be released in March. Glad to see it is one of your featured programs.

I have done basicly the same thing as you.

For your non beleivers see page at his link

http://www.members.cox.net/rfmmars/Magix.jpg

richard
photorecall.net

videoFred
18th February 2005, 08:10
Originally posted by rfmmars
Glad to see it is one of your featured programs.

I have done basicly the same thing as you.



Hello Richard,

Thank you for the appreciation!:p
Yes, Magix is a very powerful video-editing program.
The build-in Ligos Mpeg encoders are very good, too.
I see you are working with film, too.
The combination Avisynth-VirtualDub-Magix is ideal for this.

Fred.

videoFred
7th March 2005, 10:36
Originally posted by scharfis_brain
convertfps will fail.
it has to be changefps.

@videofred:

if you really want to create a fullframe smooth motion, you may want to test mvconvertfps
from mvtools 0.9.6.2 of manao

this function will to a motion compensation based on blocks.
not only on global motion.

Thank you again for this tip.
I understand a little how MVtools works, now.

I tried this simple script:

loadplugin("MVTools.dll")

source = avisource("001.avi") .assumefps(16).converttoYV12()


backward_vectors = source.MVAnalyse(isb = true,pel=1,lambda=2000)
forward_vectors = source.MVAnalyse(isb = false,pel=1,lambda=2000)


result = source.MVConvertFPS(backward_vectors, forward_vectors, fps = 25).MVDenoise(backward_vectors, forward_vectors,thT=10,sadT=800)

return result


Denoising is great!!!
Framerate conversion is amazing... By changing assumefps() I can make incredible slow motion.

But as you know, sometimes we have these block artifacts, in scenes with fast moving objects....

Maybe someone has some more tips to improve this?

Fred.

Fizick
8th March 2005, 07:33
If you want "amazing framerate conversion", then use MVTOOLS.
If you do not want "block artifactes", then use Depan.
It is dilemma.

videoFred
8th March 2005, 08:57
Originally posted by Fizick
If you want "amazing framerate conversion", then use MVTOOLS.
If you do not want "block artifactes", then use Depan.
It is dilemma.

I am very, very happy with Depan for deshaking. It works also perfect for scenes with panning. But walking people or moving cars are 'stuttering'. I can change this with the trust parameter, but then panning is not good anymore.

Yes, it is a dilemma, sometimes. But I thank you and Manao again for these wonderful tools.:)

PS: Depan is very fast, too.

Fred.