PDA

View Full Version : smoothly flowing video with 25 fps like with 50 fps


alexzeit
27th January 2009, 16:08
Hi All,
The source is interlaced DV video 720x576, 25fps(50 fields per second) from Digital Camcorder. The aim is to make deinterlaced 25fps XVid or DivX video with smoothly flowing motions.
Bobbing the source to 50 frames per second gives good results.
Is it possible to get same smootheness for 25fps?
As far as I know human eye is able to see 24 fps maximum.
I tried Smooth Deinterlace, TomsMoComp, MvBob, TDeint, Decomb etc., but 25fps result is much more jerky than 50fps one.

The samples are on:
http://rapidshare.com/files/190128160/50vs25.rar

dv source:
General
Format : AVI
Format/Info : Audio Video Interleave
File size : 25.9 MiB
Duration : 7s 120ms
Overall bit rate : 30.5 Mbps
Recorded date : 2008-12-27 12:01:52

Video
Format : Digital Video
Codec ID : dvsd
Codec ID/Hint : Sony
Duration : 7s 120ms
Bit rate : 28.8 Mbps
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 4/3
Frame rate mode : Constant
Frame rate : 25.000 fps
Standard : PAL
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Interlaced
Bits/(Pixel*Frame) : 2.778
Stream size : 24.4 MiB (94%)

neuron2
27th January 2009, 16:27
How can it possibly look as smooth if you throw away half the temporal resolution (information)?

2Bdecided
27th January 2009, 17:31
As far as I know human eye is able to see 24 fps maximum.You "know" wrong ;)

You can add some fake motion blur to 50p to make the 25p look less jerky. Quick and dirty would be a simple "blend" deinterlace. Nice and slow would be mvflowfps to a higher frame rate, temporal soften, and selectevery().

Cheers,
David.

thetoof
27th January 2009, 18:57
You could do a bit of research about how many frames the human eye can see; I recall stumbling on a website with video samples of the same movement (panning white bar) at different framerates.
Is there any reason why you can't have a 50fps Xvid?

Sagekilla
27th January 2009, 19:33
Indeed, the only way you could conceivably get 25p to look more fluid like 50p is to add motion blur.

Let's ignore the fact that it's interlaced and suppose it's a 50p source. Each frame at 1/50s exposure time. If you took each frame at 1/25s, it would look a lot blurrier when things moved around, but would still look fluid. So you need to add in some blur to the decimated 25p source so it looks fluid, because it still has blur characteristics of 50p.

leeperry
27th January 2009, 19:37
the brain can be tricked with 72 fps apparently.

http://www.100fps.com/how_many_frames_can_humans_see.htm

yes motion blur can help greatly :)

alexzeit
27th January 2009, 20:14
Is there any reason why you can't have a 50fps Xvid?
MPEG-4 with 50 fps results in bigger filesize and needs more processing power. Unfortunately computer where this video should be played is old and slow and has CD Rom only. So we also limited by the file size.

alexzeit
27th January 2009, 21:25
Thanks a lot to all temporalsoften makes it's job really good

scharfis_brain
27th January 2009, 22:54
temporalsoften will blur the image unnecessarily

alexzeit
28th January 2009, 22:40
temporalsoften will blur the image unnecessarily
Motion Blur (internal VirtualDubMod filter) gives worser results. Unfortunately I did not find how can I parametrise it.

Sagekilla
28th January 2009, 22:49
Use avisynth:


Source("...")
src = last
super = src.MSuper(pel=2)
bvec = super.MAnalyse(isb=true, delta=1, overlap=4)
fvec = super.MAnalyse(isb=false, delta=1, overlap=4)
src.MFlowBlur(super, bvec, fvec, blur=50.0) # Adjust blur to taste (0.0 - 100.0)

alexzeit
29th January 2009, 20:38
Thank you very much results looks much better now
I used it after tdeint() :
src.MFlowBlur(super, bvec, fvec, blur=100.0)

smok3
7th June 2009, 14:53
so the fast way would be
convertfps(25, zone=80) #?
(going from real 50p to 25p, where main concern is to blend macroblocks - hdv footage)

WorBry
7th June 2009, 22:23
For simulating a cinematic/filmic motion blur (i.e. 50% shutter = 1/50 sec at 25fps), I generally prefer the following script (mpfpsscd), based on a function (mvfpsscd) created by Scharfis_Brain way back when. It utilizes MotionProtectedFPS script (from 'Motion' package):


25p or bob-deinterlaced (50p) source
ConvertToYV12() # if needed
mpfpsscd(25,oversample=32, blurradius=8) # or 25, 16, 4 for slight speed increase
#
function mpfpsscd(clip i, float fps, int "oversample", int "blurradius")
{
oversample=default(oversample,1)
blurradius=default(blurradius,1)
mv=i.MotionProtectedFPS(fps*oversample,warpfast)
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)")
}


function MotionProtectedFPS(
\ clip input, float FPS,
\ int "mode", int "protection",
\ int "iterate", int "reset", int "initialise")
{
mode = default(mode, warpfast)
protection = default(protection, 80)
iterate = default(iterate, 2)
reset = default(reset, 50)
initialise = default(initialise, 6)

originalFPS = input.framerate()
input

mp = temporalsoften(2,4,5,2).FindMotion(iterate = iterate, reset = reset,
\ initialise = initialise)
p = MotionFPS(FPS,mode,Motion = mp)
maskp = mp.SumStretchFPSMask(FPS, protection)

mn = temporalsoften(2,4,5,2).FindMotion(iterate = iterate, reset = reset,
\ initialise = initialise, from = next)
n = MotionFPS(FPS,mode,Motion = mn, source = next)
maskn = mn.SumStretchFPSMask(FPS, protection, source = next)

maskp
assumeFPS(originalFPS)
CombineFPS(FPS, maskp, maskn.Invert())
bilinearresize(width*8, height*8)
crop(0, 0, input.width(), input.height())
fity2uv()

maskedmerge(p, n, last, u=3, v=3)
}

It's relatively fast and IMO less prone to warping of the background around moving ojects ("heat", as some call it) than MVFlowBlur/MFlowBlur and other MVTools based methods I've tried. The last version of 'Motion' can be found here:

http://forum.doom9.org/showthread.php?p=750037#post750037

Also, needs MaskTools for the scene detection part.

There again, if you intend to view your final XviD/DivX encodes on a PC, why bother decimating your bobbed 50p output to 25p at all....just leave and encode at 50p. IMHO, the only case for 25p is if you are intending to play on a standalone DivX player or upload to YouTube, Vimeo etc.

smok3
8th June 2009, 00:48
WorBry: that won't be fast i imagine? :)

(yes there will be 50p version as well)

WorBry
8th June 2009, 01:55
Well, for sure mpfpsscd is not 'real time'. Haven't used it for quite a while (I always encode 50p now) but IIRC it was much faster than the original mvfpsccd, which used an older (pre-Fizick) version of MVtools. When I have a mo, I'll see how it compares speedwise with an updated MVtools2 version...can probably dispense with the 'scene detection' segment of the original mvfpsscd script now.

As for......
There again, if you intend to view your final XviD/DivX encodes on a PC, why bother decimating your bobbed 50p output to 25p at all....just leave and encode at 50p..

....I guess I should have noted the foregoing post:

MPEG-4 with 50 fps results in bigger filesize and needs more processing power. Unfortunately computer where this video should be played is old and slow and has CD Rom only. So we also limited by the file size.

@Alexzeit, btw:

Thank you very much results looks much better now
I used it after tdeint() :
src.MFlowBlur(super, bvec, fvec, blur=100.0)

blur=100 is literally equivalent to 100% open shutter (i.e. 1/25 sec at 25fps). No doubt the result is very fluid, but are you really sure you want that much blur? Above 50% shutter, the blur tails start to overlap and become less well defined; at 100% they are completely overlapped. If you do decide to go with MFlowBlur, you might try increasing the % shutter (blur) incrementally to find the minimum value that gives acceptably fluid motion.

OMG, just realized that his original post dates back to January.....probably not interested now anyway:rolleyes:

vampiredom
8th June 2009, 09:15
Wouldn't the "correct" amount of blur depend on the shutter speed of the original?

WorBry
8th June 2009, 13:39
Yes you are right; I'd assumed that the DV was shot at 1/50 sec shutter, which is the default shutter speed for most, if not all, PAL DV camcorders in (fully) auto-mode. Faster shutter speeds will likely need more blur:

http://forum.doom9.org/showthread.php?p=758154#post758154

2Bdecided
8th June 2009, 13:51
Yes you are right; it assumes that the DV was shot at 1/50 sec shutter, which is the default shutter speed for most, if not all, PAL DV camcorders in (full) auto-mode.That was true for my 1992 camcorder, but for my 1999 and 2007 camcorders "full auto" gives you fast shutter speeds in bright sunlight - 1/120th upwards.

It's really noticable - whereas just dropped every other field is good enough for indoor footage, you get terrible strobing on outdoor footage.

Of course you can set the shutter speed if you want. Being lazy and just blending fields works OK up to a point - not from a 1/120th or faster shutter speed though.

Cheers,
David.

Alex-Kid
8th June 2009, 15:39
the brain can be tricked with 72 fps apparently.I can notice the difference between 120 and 240 Hz Motionflow video. With a lot of attention but I can!

I didn't know the "motion blur trick". I think I have to test it by myself.

leeperry
8th June 2009, 20:43
I can notice the difference between 120 and 240 Hz Motionflow video. With a lot of attention but I can!

I didn't know the "motion blur trick". I think I have to test it by myself.
http://forum.doom9.org/showpost.php?p=1290141&postcount=1239 ;)

http://forum.doom9.org/showthread.php?p=1281299

WorBry
9th June 2009, 00:27
That was true for my 1992 camcorder, but for my 1999 and 2007 camcorders "full auto" gives you fast shutter speeds in bright sunlight - 1/120th upwards.

Ah yes, I forgot that on the Canon cams you need to switch to Shutter Priority (Tv Mode) to set a fixed shutter speed. My Panasonic NV-GS400 (PAL) operates only in shutter priority; fixed at 1/50 sec in auto mode, and in manual shutter mode 1/50 sec is the slowest possible setting. I know the Canon HV/HF series cams allow 1/25 sec and lower.