PDA

View Full Version : scene change sensitive framerate conversion


scharfis_brain
19th February 2005, 18:14
all framerate convertors do have one thing in common.
they mess up the scene changes.

either with blending (convertfps)
or with horrible blocking (mvconvertfps)

so I made a scene detecting framerate convertor myself.

take a look:

function mvfpsscd(clip i, float fps, int "oversample", int "blurradius")
{
blurradius=default(blurradius,1)
oversample=default(oversample,1)
j=i.temporalsoften(2,4,5,2)
fwd=mvtools0962_mvanalyse(j,isb=false,lambda=4000)
bwd=mvtools0962_mvanalyse(j,isb=true, lambda=4000)
mv=i.mvtools0962_mvconvertfps(bwd,fwd,fps=fps*oversample).deblock()
global mv= (oversample>1) ? mv.temporalsoften(blurradius,255,255,mode=2).selectevery(oversample,0) : mv
global ch=i.changefps(fps) #. subtitle("ch")

global msk0=ch.duplicateframe(0).reduceby2().reduceby2().motionmask(thsd=255,y=3,u=1,v=1)
global msk1=msk0.trim(1,0)
global msk2=msk0.trim(2,0)
global msk3=msk0.trim(3,0)

f0=scriptclip(ch,"""sc""") #.subtitle(string(a0)+" "+string(a1)+" "+string(a2))""")
f1=f0.frameevaluate("""sc= (sc2 || sc1) ? ch : mv""")
f2=f1.frameevaluate("""sc2=( (a2 > (a1*5+25)) && (a2 > (a3*5+25)) ) ? true : false""")
f3=f2.frameevaluate("""sc1=( (a1 > (a0*5+25)) && (a1 > (a2*5+25)) ) ? true : false""")
f4=f3.frameevaluate("a3=averageluma(msk3)")
f5=f4.frameevaluate("a2=averageluma(msk2)")
f6=f5.frameevaluate("a1=averageluma(msk1)")
f6.frameevaluate("a0=averageluma(msk0)")
}

videoFred
7th July 2005, 16:47
I tried this script, and it works very well, but it needs MVTools V9.5 because it uses MVConvertfps(). On the other hand, it also uses deblock(). But for deblock() I need MVTools V0.9.7 and this version does not support MVConvertfps anymore :(

So I dissabled deblock() :(
And yes, sometimes I see.... blocks :mad:

Is there maybe a MVTools version 09.6.2? I do not find it on Manao's site...

Fred.

scharfis_brain
7th July 2005, 16:53
load both. the old and then the new plugin!

rename the old one into: mvtools0962.dll

videoFred
7th July 2005, 17:46
I understand... Very clever way to get the best of both worlds ;)
Yes, it works... But still some artefacts, but not on scene change.
I must do more tests at home, on my faster computer.

I use it for 15-25, 16-25 and 18-25 conversions.
Playback appears to be very smooth, panning also! :thanks:

Fred.

videoFred
14th November 2005, 08:23
OK:

Because ALL my clips are old 8mm files, I need good frame rate conversion and stabilising, too.

So I did many many tests :devil:

The very best is MVconvertFPS, followed by Fizicks Depan.
The second best is ChangeFPS(), followed by Depan.

I also noticed the blocks are much better if I use FFT before MVconvertFPS.
Upsizing before MVconvertFPS, then downsizing again also helps to reduce the blocks.

With MVconvertFPS it is possible to convert any frame rate to any frame rate! :D
(first AssumeFPS(), of cource)
Why has Manao removed it?
It's the only *REAL* frame rate convertor we have for Avisynth...

Manao, you where so close to perfection....
Is it so difficult to remove the blocks?
The strange thing is, some scenes do not have blocks, others have...
What is creating the blocks?

Incredible slow motion (1fps!) is possible, too.
Files are playing incredible smooth both on computer and TV.
Even huge 1024 x 768 Huffyuv files are playing fine on computer.

But now I re-found this nice script from Sharfis....
No one else using MVconvertFPS()?

Sharfis, can you give some more info, please?
It's using upsizing, too, right? (oversample)
Any new developments?
Have you also tried FFT before and Depan after your script?


Fred.

Fizick
14th November 2005, 17:48
Hi videoFred,
Try experimental MVFlowFps function.
Get it from this thread. But read carefully my disclamer. :)
It is still experimental alpha!

http://forum.doom9.org/showthread.php?t=102071

videoFred
14th November 2005, 18:30
Thank you, Fizick!
I love alpha versions :p

I try it and report back...
But I need some weeks to test it.


Fred.

Fizick
14th November 2005, 18:40
all framerate convertors do have one thing in common.
they mess up the scene changes.

either with blending (convertfps)
or with horrible blocking (mvconvertfps)



Hmm, did you try properly set ThSCD1 parameter in MVAnalyse?
It must detect scenechange, and compensate functions (MVCompensate,MVConvertFps, etc) will output original source frame at scenechange withot blocking. (at least MVFlowFps do so).

Fizick
14th November 2005, 18:41
videoFred,

WEEKS ?

videoFred
14th November 2005, 18:47
videoFred,

WEEKS ?

OK, I try faster: tomorrow? :p

Fred.

videoFred
16th November 2005, 07:39
To avoid cross posting:
see my answer here:
http://forum.doom9.org/showthread.php?t=102071

Fred.