View Full Version : producing Film-like motion blur
Maximus_G
3rd May 2004, 13:36
As we know, all films are motion-blurred, and that makes'em look natural. And when it comes to movies based on 3D-games, there is no motion blur, just separate frames, one by one. And that looks just as a game, not more. I'm trying to give them some natural look, and motion blur is the thing needed first of all.
According to Kotelnikov's sampling theorem, we can completely determine the signal by using 2*frequency samples. Which means that we use 44100kHz for the audio AND as i presume - 60 static frames for the video.
So the main problem for the motion-blur production is the conversion - from 60fps of static images to 30fps of blurred ones.
Maybe it would look like joining the top fields of every odd frame with the bottom fields of every even frame (regardless they are actually progressive) into a new interlaced frame. My AVS file looks loke this now:
converttoYUY2()
AssumeFPS(60)
clip0=SelectOdd()
clip1=SelectEven()
clip00=SelectOdd(SeparateFields(clip0))
clip11=SelectEven(SeparateFields(clip1))
Interleave(clip00, clip11)
DoubleWeave()
repal()
kerneldeint(order=0, threshold=3)
I know it's NOT right, but my AVS knowledge is not enough.
Please help! :)
And - yes i know there is a simple way - just to record the sequence to a VHS and capture it back - but there HAS to be a purely digital way... :(
scharfis_brain
3rd May 2004, 13:43
x=avisource("blah")
overlay(x,x.trim(1,0),opacity=0.5)
selectodd()
but this will result in ghosting, NOT in motionblur.
3D apps like 3D Studio MAX have their own motion blur, no AVS needed.
Maximus_G
3rd May 2004, 14:42
Thank you scharfis_brain, it worked. Unfortunately, it's good only with very little motion. With fast-moving things, we get ghosts... So i guess this method would be satisfactory enough only if we had some 150-300fps sources...
So, either there is more complicated algorythm, or i'm just wrong thinking that 60fps would be enough.
2 mf:
We're grabbing video from a game, not modelling in 3DS ;)
---
Maybe there are some special filters?
You can try temporalsoften on the 60fps video, and then blend-convert to 30.
Zarxrax
3rd May 2004, 18:44
There are some expensive tools to generate a realistic looking mostion blur from non-blurred footage. For instance, Realsmart Motion Blur for Adobe After Effects. Though I doubt you are willing to pay such a high price just for your game videos :p
Mug Funky
3rd May 2004, 18:55
reelsmart needs some (natural) blur to be present already (yes, yes, i found this out trying to make 3dsMAX a little faster by adding blur later)
sampling theorems are all well and good, but with synthetic images you do not know the nyquist frequency without rendering at ever higher sampling rates until no aliasing is present. it is usually a very low rate, but in some cases it is stupidly high (think of the moire patterns you get in poorly-sampled 3d textures as they move away from you, or to put it crassly, "the matrix screen effect" where a slow zoom on any monitor yields a crazy pattern that throbs and throbs.).
sampling at 60hz to blur at 30hz is _sort of_ possible, but you'd require a hugely sophisticated reconstruction filter (just like 44.1khz audio needs more than just linear interpolation to be able to reproduce all frequencies under nyquist without aliasing of any kind).
hm. well, there it is :)
you could try recording the video at 120fps and blending 5 frames together for each frame of a 24fps movie.
or you could turn "motion-blur" on in your video card's options. no doubt it's available.
but IMHO, computer games will never look like film with current technology. not without writing some kind of app to record the movements inside the game, then writing an importer for some 3d app to interpret this and render it it's own way. (hmmm.... sounds like a good idea actually. i remember doom and quake had demo-recorders, and quake could be plugged into max. a maxScript would be able to load the demo data, and sound could be dumped right out of quake during the demo recording)
[edit]
practical example here:
take a photo of a room. do not move the camera. this has a very low nyquist frequency for motion blurring.
now take a photo of the TV. not just a static photo, but one where the camera is moving so fast the final image is of several warped TV shapes. this has an extremely high nyquist.
while the first example could be synthesised without any motion blur sampling at all (we're not counting flickering lights, assuming you're inside), but the second would need a sample for every pixel on the TV that is visible. for a typical indoor exposure this would yield ~10 TV pictures, each with ~500 lines and horizontal sampling equal to the length of these lines in the photographed image. for simplicity, let's say each screen image is 500 pixels wide. this is 500 lines x 500 pixels per line x 10 images in shot, meaning that to synthesize this image properly on a computer, you would need 2.5 million motion-blur samples!
of course, these are extreme situations... but things can get pretty hairy in a computer game, and frame blending twice the output rate wont be adequate in most cases (and will be more than adequate if you're moving less than 2 pixels per frame)
Soulhunter
3rd May 2004, 19:21
Originally posted by Maximus_G
We're grabbing video from a game, not modelling in 3DS ;) Which game ???
IIRC, some engines like the MAX-FX (MaxPayne 1/2) n' Unral2 (also UT 03/04) already have this capability... ;)
But dont ask me what code you have to edit for this !!!
Think some ppl from a "mod board" could help you more with this stuff... :rolleyes:
Bye
SoonUDie
3rd May 2004, 19:27
@scharfis_brain
Since you're the expert on this, why not use DeShaker output and Genmotion to increase the framerate, then blend back down to 30fps?
scharfis_brain
3rd May 2004, 23:31
depan or deshaker/genmottion will only compensate GLOBAL motion.
this means, only pans/zooms/rotations of the whole frame are getting blurred. everything else (running persons, perspectively moving objects) are getting ghosting and stuttering.
forget genmotion for that.
it can only be abused for small framerate conversions with the result of smooth pans.
But why not use Motionperfect for this.
take the 60fps-stream, upconvert it to something between 300 and 1200 fps. (depends on: how long you want to wait & how much space you have on HDD).
take the 300 fps video and do:
assumefps(300)
temporalsoften(7,255,255) (13 frames blending diameter)
changefps(24)
on a 600 fps video do:
assumefps(600)
temporalsoften(13,255,255) (25 frames blending diameter)
changefps(24)
and on a 1200 fps video take
assumefps(1200)
temporalsoften(25,255,255) (50 frames blending diameter)
changefps(24)
Maximus_G
5th May 2004, 05:54
2 Zarxrax:
>There are some expensive tools to generate a realistic looking mostion blur from non-blurred footage. For instance, Realsmart Motion Blur for Adobe After Effects.
I tried it several times - it really needs some blurred sources, as Mug Funky said.
---
2 Mug Funky:
>or you could turn "motion-blur" on in your video card's options. no doubt it's available.
Don't know what you mean
>but IMHO, computer games will never look like film with current technology.
It's offtopic, but... take a look at S.T.A.L.K.E.R. screenshots - they use renderer simulating film-like random noise - small dots of different luminosity. Looks MUCH better :) So is the motion blur - i think it's not so impossible to render a simple version of that in realtime. If they DO render every pixel and they DO know its coordinates at every bit of time - why just not smear it? They have everything for that: color, coordinates, luminosity, motion trajectory...
---
2 Soulhunter:
>Which game ???
IIRC, some engines like the MAX-FX (MaxPayne 1/2) n' Unral2 (also UT 03/04) already have this capability...
It's Forgotten Battles. I mix with guys programming several utils for the game, but they say - it's only a theory. And after all, it's very far from a universal way.
---
2 scharfis_brain:
I'm familiarizing myself with the Motionperfect right now. Looks almost as what we need... but at VERY high- and complex-motion scenes (explosions for example) it makes really weird things :)
So, in order to preserve the content, we have to be sure that when stretching it back to 30fps, every second one of the original static 60fps frames returns back to it's place. It means that when we compare the original video and the blurred one, later should exactly repeat the original + the motion blur.
So, maybe we should use
assumefps(300)
overlay(x,x.trim(1,0),opacity=0.1
overlay(x,x.trim(2,0),opacity=0.1
overlay(x,x.trim(3,0),opacity=0.1
overlay(x,x.trim(4,0),opacity=0.1
overlay(x,x.trim(5,0),opacity=0.1
overlay(x,x.trim(6,0),opacity=0.1
overlay(x,x.trim(7,0),opacity=0.1
overlay(x,x.trim(8,0),opacity=0.1
overlay(x,x.trim(9,0),opacity=0.1
SelectOdd()
SelectOdd()
SelectOdd()
SelectOdd()
instead of
assumefps(300)
temporalsoften(7,255,255) (13 frames blending diameter)
changefps(30)
?
Which is better? Or is that just the same?
scharfis_brain
5th May 2004, 07:42
z=overlay(x,y,opacity=0.1)
is the same as
z=x
you have to set opacity to 0,5 for getting a 50:50 blend.
I thought of using overlay, too. But I was (and actually am) too lazy to:
- write thousands of overlays
- calculate their cirrect weights
- merge then properly together
why not using temporalsoften?
it is a easy way to go here.
layering 4 frames (4 times the original framerate) may look like this:
overlay(overlay(a.trim(1,0),a,opacity=0.5),overlay(a.duplicateframe(0),a.duplicateframe(0).duplicateframe(0),opacity=0.5),opacity=0.5)
changefps(framerate(last)/4)
I don't want to start thinking about a temporal blurring ratius above 4.
Maximus_G
5th May 2004, 07:46
:)
hmmm, the motion blur effect in films is not caused by blending few descrete images (2 in your example). it's caused due to the longer exposure of the film (1/24 sec). the thing is, that games produce 'singular' frames (i.e. exposure of infinitisimally small duration) therefore, with zero motion, and you loose all the information 'in-between' frames.
as mug funky suggested, i think the best way would be to import the 3d data to some 3d modeling app, and then interpolate the motion of all the objects/camera, and then simulate a 1/24 sec exposure (or 30 if that's what you need, but i'd go for 1/24 since that's that how films are done) . for that 'simulation', several frame-multipliers should be tried. i'd start with 5, but i won't be suprised if 10 in-between frames would be needed for fast-motion scenes for good results. that could take a lot of time ;)
i don't have a clue how to do that ;) but that's the only 'correct' method imho.
Mug Funky
5th May 2004, 10:01
film uses a mechanical shutter, so it's not exposing 1/24th of a second (and physically cannot do that unless you undercrank the camera and shoot at a lower framerate for time-lapse)
it's exposure times are set more like how a manual SLR would be set. for simplicity, we'll say it's 2/3 of 1/24th (that's how you'd set it in 3dsMAX - as a percentage of frame time). deinterlaced PAL always looks slightly choppier than film because it's blur is 1/50 (no mechanical shutter going here, so exposure time can go right up to 100% of frame time).
usually motion-blur must be eyeballed and guessed at for 3d apps and such, unless the guys that shot the film tell you the settings they used.
thx for the clarification :) i didn't think it's actually full 1/24, but i guessed it's derived from that value, and pretty close to it. 2/3 sounds reasonable ;)
scharfis_brain
5th May 2004, 10:30
I've looked into some of my movies and think, they are all shot with 1/48sec shutter.
(except some action scenes, that had a much short shutter time <1/100 sec)
I compared the distances between motionblurred moving objects and the length of the motionblur itself.
if both lenghts are the same, the shutter time is the half of 1/fps.
If you are doing synthetic motion blur by combining frames made at a higher framerate you are better off using gaussians to weight the individual frames. This makes it a lot more robust.
scharfis_brain
5th May 2004, 23:56
MfA, then tell me, how to do a gaussian weighted blend of lets say 10 Frames without excessive usage of endless overlay commands.
I know, how to set up a sequence, that can handle this, but it will be far slower than temporalsoften and much lesser configurable than temporalsoften.
Maximus_G
6th May 2004, 01:39
Originally posted by scharfis_brain
I've looked into some of my movies and think, they are all shot with 1/48sec shutter.
(except some action scenes, that had a much short shutter time <1/100 sec)
You are obviously right, because the exposure time is 1/48 of a second at 24fps movie. And when the shutter angle is reduced twice (close to 90 degrees), the exposure time is near to 1/96 of a second. Which can be seen in action scenes of Gladiator and Saving Private Ryan, for example.
And i subscribe to the question - what would the "gaussian weighted blend" look like?
BTW, the "configurability", i guess, would be limited to the simulation of exposure time - "normal" and "action-like".
Forget about script, you destroy dynamic range if you try to combine that many frames without more bpp.
Maybe when we get 16/32 bits per component colour spaces with 3.0 ;)
Maximus_G
6th May 2004, 06:31
Originally posted by avih
as mug funky suggested, i think the best way would be to import the 3d data to some 3d modeling app, and then interpolate the motion of all the objects/camera, and then simulate a 1/24 sec exposure (or 30 if that's what you need, but i'd go for 1/24 since that's that how films are done) . for that 'simulation', several frame-multipliers should be tried. i'd start with 5, but i won't be suprised if 10 in-between frames would be needed for fast-motion scenes for good results. that could take a lot of time ;)
i don't have a clue how to do that ;) but that's the only 'correct' method imho.
I talked to the guys... there is no obvious way to export 3D data since it's embedded into the code which is protected, and that puts us dangerously close to hacking :sly: Until there are some provided features, like an AVI exporting tool in Lomac.
BUT since all we need is an extremely high-framerate video sequence, we can write an util which would generate "pause game" keystroke, then "Printscreen", name the screenshot file properly, unpause game, wait for 1/framerate of a second, and so on. And the output would be the image sequence. Looks simple. Considering starting coding :rolleyes:
About the gaussian, this (http://citeseer.ist.psu.edu/455657.html) was the paper I was remembering. Basically instead of just doing a straight average of a series of frames within a sampling window you take the weighted average, with the weight determined by a gaussian function of the distance to the center of the window. As I said though, forget about doing it in script ... you need at least 16 bits per component accuracy for the weighted average.
Maximus, that only works if the game is able to run at a high enough framerate (100 fps+) or if it actually creats a frame for the moment it is paused.
What engine you using anyway? I remember that with quake3 for instance it was quite easy to get a demo into an avi at an arbitrary framerate.
Maximus_G
6th May 2004, 13:15
It's Il-2 Shturmovik / Forgotten Battles / Aces Over Europe series.
And you're right, everything turns on rendering speed. To get a 30 fps movie, the game has to run with speed >=30 fps. But the game has an option to slow down the playing speed up to 4 times. Anyway, it's worth trying. The only available way now to capture the video - is to use FRAPS, which does not allow video-capturing resolutions more than 640x480, and is able to steadily capture ony 15 frames/second on my machine, regardless the fact it's above the average rating.
Maybe one of the old time cheats for games like counterstrike can slow it down further (or if you can find someone to program it for you just intercept the calls the game makes to the kernel to get the time, and make it run a lot slower).
While I was looking around for the Magic Bullet link (http://www.redgiantsoftware.com/magbulsuit.html).
I don't mean this arrogant about our group here although I think it is pretty special, but I can't see how these guys could know anything more about this subject than you guys in this thread do. It would be kinda cool for avisynth to be able to do the deinterlacing section as well or better as it is done in their 1000 buck software. That's the big part of their stuff. Rest is pretty much grain and emulsion emulation.
I came across this (http://www.lafcpug.org/film_look.html).
Highlight a clip, duplicate it and place it directly above itself in the same way your technique is set up. Set the V2 opacity at 50%. Now place the "de-interlace" filter (with the "LOWER" setting selected) on the V1 clip. Next, place "de-interlace" (with the "UPPER" setting selected) on the V2 clip. Thats it!!! No interlaced-induced flicker. Full resolution, No strobing, No jaggies, just a subtle, classy, non-video look.
I wonder if this might be an interesting general direction to pursue? Just throwing it out as I am pretty sure you guys can emulate this in avisynth without the NLE.
Wilbert
6th May 2004, 20:39
I read your quotation several times, and I still don't get it.
Now place the "de-interlace" filter (with the "LOWER" setting selected) on the V1 clip.
What does this do, opposed to selecting the "UPPER" field?
Originally posted by DDogg
Highlight a clip, duplicate it and place it directly above itself in the same way your technique is set up. Set the V2 opacity at 50%. Now place the "de-interlace" filter (with the "LOWER" setting selected) on the V1 clip. Next, place "de-interlace" (with the "UPPER" setting selected) on the V2 clip. Thats it!!! No interlaced-induced flicker. Full resolution, No strobing, No jaggies, just a subtle, classy, non-video look.
Sounds like a complicated way to do blend-deinterlacing. Full resolution, no strobing, no jaggies, but I bet a lot of ghosting.
I don't use FCP, but when I read it I got the impression they were putting 2 clips 'out of phase' with each other. I got a mind picture of two sine waves out of phase and smoothing each other out. Really just threw it to stimulate conversation. I assumed upper and lower were speaking of field precedence?
violao
7th May 2004, 12:22
Originally posted by scharfis_brain
x=avisource("blah")
overlay(x,x.trim(1,0),opacity=0.5)
selectodd()
Back to the original question, I think this suggestion is a good starting point. Actually it produces 50% frame blends. Some blurring of the result would hopefully hide the ghosting effect. Masktools could be used to build a motion mask of the original clip to protect the static areas and then overlay masked blurred blends over the original. Interleave original and result and get 2*fps. Every other frame will have blends blurred only in motion parts.
What I don't know is how to do blurring/softening in the direction of motion. Normal spatial blurr doesn't seem to produce satisfactory results. Perhaps some motion vectors could help? Any ideas?
scharfis_brain
7th May 2004, 13:04
but: where to get the vectors from?
violao
7th May 2004, 13:45
Originally posted by scharfis_brain
but: where to get the vectors from?
That's what I've been asking myself too :confused:
scharfis_brain
7th May 2004, 14:02
manao has a motionvectors.dll on his masktools download site.
but it only displays thos vectors.
so no senseful usage is possible.
maybe you want to modify it becoming a general motion blurrer since you are able Coding plugins yourself.
violao
7th May 2004, 15:55
Originally posted by scharfis_brain
manao has a motionvectors.dll on his masktools download site.
I checked that. It appears manao is actively working on that plugin. As far as I can see motionvectors.dll include mvmask() that outputs some kind of mask produced from motion vectors, but I don't think it's more useful than motionmask().
I released the sources, and I made a generic class ( GenericMotionFilter ) which allows you to simply create a filter which can fetch motion vectors. Then, it's up to you to decide what you want to do with them.
It still lacks some documentation yet. However, looking at the three filters bundled with motion.dll, I'm sure you can work it out ( while in the meantime, I'll try to produce a usable documentation ).
First, let's identify the problem: I have a similar problem and managed to find a solution. My problem is, I want to superimpose video for a film we are making. So I film the subject, say, an actor sitting in a chair, against a highly illuminated white backdrop. I use a very high shutter speed, say 600, so that the edges are very sharp even when motion is high, say if the actor is flailing his arms wildly. This also keeps the subject a little underexposed, which is good, because I convert to black and white before making my alpha masks.
(This is good because in YV12 color space, the luma, which is where my masks come from, is full resolution PAL @720x576, whereas the color channel is only one quarter full resolution, i.e, 360x288. So if I make my masks by differentiating blue from any other color my maske will only have 25% resolution and will look much worse.)
IT IS THE SHARP EDGES THAT MAKE THE MOTION LOOK STRANGE WHEN PLAYED BACK AND IT IS THE SHARP EDGES THAT CAUSE THE GHOSTING PHENOMENA WHEN MOTION BLUR IS ATTEMPTED WITH REGULAR DEINTERLACING METHODS. The sharpness of the lines may seem very trivial, but here it is everything! (Similarly, if you have a picture of someone who is supposed to be lying on the ground, and a picture of the ground without that somebody, if you superimpose the two without some sort of shadow, the body will look like it is hovering a few feet off the ground. Here a simple shadow is everything!!)
A solution: 1.Separate the fields so you are working with 720x288 (PAL) frames at 50 frames per second. Use Donald Graft's "Msharpen" because it can make a mask (that you can adjust for sensitivity) of where the sharp lines are in the frames. You can't use this mask until you make the areas of this mask that are gray go to white and the other areas in the mask, i.e., where sharp lines are, go to black.
Once you have done this you have to blur this mask by doing a few "ReduceBy2" operations, then resizing back to the original resolution.
Now you have to blur the original (separated) video in the same way and use "Layer" to blend the original (unblurred)clip with the blurred one such that only the sharp lines are blured.
2. Now separate your fields into frames at double the frame rate . Then cut 1 scan line off the bottom of the odd (or even) frames and add 1 line to the top. This will line up the odd and even frames so that the objects in the picture don't bob up and down 25 times a second.
Next "Subtract" each frame (i.e., separated field) from the next frame (separated field) in order to make a motion mask. Now you have a motion mask that is based on the difference between 2 fields and not 2 frames. You have to turn this mask into an alpha mask by making the motion areas go to black (transparent) and the gray (non-motion) areas go white (opaque)
3. Finally use "Layer" and the above mask to combine the original video with the processed result of step 1 above (there only the sharp lines are blurred) so that the video with the blurred lines only shows through the original video in motion areas. Now put the video back together (i.e., 720x288@50fps goes to 720x576@25fps) and use smart deinterlace on the fields.
I know this method will work, although it will run very slow, 1-3 fps. Also, I am very bad at scripting and refrain from giving a script for the simple reason that I am sure someone out there can come up with a much better way to do all this. Like I said, I have tested enough to know that this WILL work, but any feedback is most welcome.
t_2 : you may want to discover what the masktools are.
@all : I'll try to make a quick attempt in a motion blur filter.
@Manao
Sounds exciting! I have heard about "MaskTools" but never had time to look into it. Also, if you use the "Msharpen" way, I think I had to enlarge the video from 720x576 to at least 1440x1152 and then apply Msharpen and reduce the mask back to the original resolution to get good results. But like I said I am terrible at scripting and doubtless there is a much better way to do it.
The only problem with the method I described in my first post is that the background and the moving object are blurred together in the motion areas, whereas with real motion, the moving object is blured in the foreground (= no sharp lines), but the background that shows through at the edges of the motion isn't blurred at all (i.e., the lines in the background are still sharp.) Nevertheless it works.
Perhaps a better method would be the following, but although simpler,I have never tested it:
Instead of combining the original video using the mask (where lines = transparent)with the blurred video, we should instead combine it with the previous sharp frame of the same video so that the previous frame (with sharp edges) only shows through in the motion areas. Then put the video back together and do "SmartDeinterlace" using the blend in motion areas option.
@all : download that and enjoy :)
http://www.geocities.com/manao47/Filters/motionvectors-v0.8.2.zip
( As usual, right clic on the link, save as... )
I added a new filter to the dll : MVBlur(int thSCD1, int thSCD2, int sx, int sy, int pel, int lv, int mxd,
bool mmx, bool isse, int nb, float rl, int fth)
- thSCD1, thSCD2 : thresholds for the scenechange detection.
Defaults are : 10, 160. Increase them and you'll get less scenechanges
( and possibly miss some of them )
- sx, sy : bloc's size. Defaults are 8, 8, and values can only be 4 or 8.
- pel : precision of the motion vectors. Default is 1, keep it that way
for this filter ( yet ).
- lv : number of levels in the hierarchal prediction of the motion vectors.
Default is 5. The higher, the better. However, 2^lv * sx must be lower
than the width of the picture ( and the same goes for sy and the height ).
- mmx and isse : defaults to true, set them to false to disable
optimizations ( you won't notice much differences, there aren't much
optimizations yet )
- rl : strength of the motion blur ( between 0 and 1, default to 1
which is too much in fact ). It's the maximum relative length by
which a block may be moved during the motion blur. 1 means that the block
moves to its position in the previous frame.
- nb : precision of the motion blur : it's the number of interpolations that
are made between the current frame, and the frame (1 - rl) * frame + rl * (frame - 1).
- fth : parameter allowing a 'denoising' of the motion vectors.
Default is 0, and for 8x8 blocs, I would recommend around 20 ( use ShowMotion
to see its effects ).The algorithm is the following : I fetch the motion vector ( mv ) for a block, and I copy and paste this block on the picture, moved by a vector which is k * mv * rl / 'nb', with k = 0..'nb - 1'. Each copy is also weighted by 'nb' - k.
(Edited to fit the screen)
Aaaah! English documentation!
I looked at the original French documentation some time ago -- but my French is almost as good as my Chinese ;)
- Didée
scharfis_brain
8th May 2004, 10:19
Didée, are you talking about languages? :D
Manao: would it be possible to use (nearly) the same technique to produce some kind of crappy motioncompensation?
Just move the block in the vectors direction by a user definded amount (like fizick's delta).
remaining holes may be filled with unmoved original data.
Mug Funky
8th May 2004, 11:15
manao: you rock! :D
and as scharfi says, it could be very useful for motion compensation (standard conversion could be made very nice with this too, but that would involve a fair amount of work... stuff like mesh warping using the vectors as guides.)
this could be good news for the video community - a GPL competitor to such things as motionperfect and twixtor.
Originally posted by Mug Funky
a GPL competitor to such things as motionperfect and twixtor.
I've recently been playing a bit with MotionPerfect and its mismatches have given me ideas. Maybe we should get together and throw some ideas in a basket?
scharfis_brain
8th May 2004, 12:46
the mismatches motionperfect produces could be aesily knocked out using the same masking technique like I have used in the genmotion motioncompensator for morsa.
1) motionperfect always tries to compensate static parts of the video.
motionmasking (and motioncompensation these masks) will nail down the static parts.
2) false motion compensation can be slightly fixed by comparing fwd and bckwd. compensation.
all parts, that are not equal after fwd & bckwd. compensation should be replaced by a weighted blend of the uncompensated neighboring frames.
I've used 1) and 2) in the genmotion-mocomp to fix non-global motion artifacts with success
but this cannot been applied to Motionperfect, because we cannot compensate anything else thna the video itself :(
scharfi : yeah, it would be very easy, but you may not like the result ( it will be blocky as hell ). I'm still searching for an idea to avoid the blocks.
Another thing : with the 'fth' parameter well used, my filter won't find vectors on static areas :) ( except on vertical & horizontal edges, but I can't do nothing about it ( yet ))
Manao
11th May 2004, 09:31
scharfi : not yet what you're expecting, but try that : http://www.geocities.com/manao47/Filters/mvtools-v0.9.zip
With a script like that :inter = source.MVInterpolate(nb = 5,bl = 0.4, el = 0.6, wf = "hat")
return Interleave(inter,source)
Mug Funky
11th May 2004, 13:47
very cool, manao.
here's one that gives a tiny bit more:
inter1 = last.MVInterpolate(sx=8,sy=8,nb = 4,bl = 0.5, el = 0.5)
inter2 = last.duplicateframe(1).reverse().MVInterpolate(sx=8,sy=8,nb = 4,bl = 0.5, el = 0.5)
inter = overlay(inter1,inter2.reverse(),opacity=0.5).funkydeblock()
Interleave(inter,last)
basically does forward and backward...
Manao
11th May 2004, 13:55
Mug Funky : wait for my next filter : it will allow converting like ConvertFPS does, but with interpolated frames.
Oh, and nb = 4 is useless with el = bl : you should do el = 0.6 and bl = 0.4, and use wf = 'hat'. It will do a slight motion blur and the interpolated frame, but it will look nicer ( blurring helps hiding the artifacts )
Mug Funky
11th May 2004, 14:58
ah, cool. i basically increased nb until i got something other than garbage. to be honest i have no idea what it does :)
but thanks all the same for these filters - i've been able to use this to step up 25i video to 100fps and still look pretty good.
Manao
11th May 2004, 16:01
I'll update the documentation to make it clearer. But, for example, with bl = 0.4, el = 0.6 and nb = 5, 5 frames will be built, one at 0.4, one at 0.45, 0.5, 0.55 and 0.6. Then, these 5 frames will be weighted and blended together. In our case, with wf = 'hat', the weights will be respectively 1, 2, 3, 2, 1.
Hence, if bl = el, you always build the same frame.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.