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.
Mug Funky
11th May 2004, 17:07
aah. thought it might be something like that after your last post.
what other averaging functions are there to choose from?
Manao
11th May 2004, 17:57
It's all in the documentation ( there is one in the 0.9 version ) : "hat", "uniform", "ramp", "revramp". They'll be a "gaussian", and whatever weighting curves you might find interesting ( though "hat" and "uniform" seem enough, imho )
scharfis_brain
11th May 2004, 22:28
will your mvconvertfps() have built-in forward & backwards compensation?
Manao
11th May 2004, 23:36
http://www.geocities.com/manao47/Filters/mvtools-v0.9.1.zip
New filter : MVConvertFPS. Look at the documentation for further details.
It has built-in forward and backward compensation. To interpolate a frame 'c' between 'a' and 'b', there are several steps :
- building frame(s) from forward and backward compensation, from 'c' - 'rl' / 2 to 'c' + 'rl' / 2.
- weighting them according to 'wf'
- then merging the forward and backward compensation weighted by 'c' - 'a' and 'b' - 'c' , because I assume that the longer the vector, the worse the compensation ( that's not a very good euristic, others will be used later ).
This algorithm recreates well the motion, but fails when hidden areas are discovered. With defaults ( 'rl' = 0 and 'nb' = 1 ), the interpolated frames shows artifacts which can be reduced by setting 'rl' = 0.1 and 'nb' = 5, if you can afford a slight motion blur.
I got some artifacts at scene changes, I'll try to see what happened.
Finally : the filter is quite slow ( 5-7 fps for 25 -> 30 fps on a Athlon 2000+ )
scharfis_brain
11th May 2004, 23:54
cannot get it working.
It always claims:
You have to increase the Frame per Number in order this Filter to work
What is Frame per Number ?!?
Manao
12th May 2004, 00:07
Sorry, a very baaaad translation : I was meaning : 'You have to set a higher framerate than the original clip' ( it's late here in France :) )
@Manao
I think you need some more bandwidth - can't access your file(s)
regards
Simon
PS Neuron2 is usually very obliging in hosting files :)
PS I could probably take the hit as well if the file is small
Manao
12th May 2004, 00:47
Damn it, since when is there a bandwidth limit on geocities ? Well, I'll host them somewhere else tomorrow morning ( definitely too late now ), but thanks for proposing hosting :)
scharfis_brain
12th May 2004, 00:59
this means, I have to convert NTSC Video to PAL this way:
kernelbob(8)
mvconvertfps(fps=100)
overlay(last,last.trim(1,0),opacity=0.5)
selectodd()
and I REALLY like the output!
btw, in Germany, it is late (or shall I say early ?!?), too! 02:10 in the morning.
Manao, could you write a plugin, to compensate time? I have insufficency in that... :devil:
Its always had a limit - your file is just a bit too popular thats all :)
regards
Simon
Mug Funky
12th May 2004, 06:18
manao: i wish i was a girl. then i could have your babies :)
this is the best christmas ever!
Manao
12th May 2004, 09:16
I now host my filters here :
http://jourdan.madism.org/~manao/
Note : the masktools' version number has changed, but I only updated the documentation.
Concerning the error message, with half a night of sleep, I realize it was really dumb to prevent users from reducing the framerate. I'll disable it on the next version.
scharfis_brain
12th May 2004, 13:29
feature request:
If I compensate motion completely (using el=bl=1), I need the underlying frame to be the frame to compensate to.
or : the underlying frame should be a weighted blend (using (el+bl)/2 as weighting factor) of the frames surrounding the compensated frame.
This would significantly reduce the artifacts on compensations > 0.5
bug report:
mvconvertfps(fps=8*framerate(last)) doesn't return smooth motion
@moderator: Did I do something wrong? This topic "producing film-like motion blur has interested my for some years, have been working on my own primitive motion blur function for AviSynth, but keep running into a wall, when I try to grow or smooth my masks. Was hoping someone could help by porting Vdub's BoxBlur from internal to external filter. But this post has dissapeared? Hope I didn't do something wrong, but if I did I'll be happy to repost somewhere else,...
Wilbert
13th May 2004, 15:03
But this post has dissapeared? Hope I didn't do something wrong, but if I did I'll be happy to repost somewhere else,...
What post? This one
http://forum.doom9.org/showthread.php?s=&postid=491158#post491158
I can't find any other posts by you with the word boxblur in it.
@Wilbert: Oooopsss, err...humm..never mind.
Manao
13th May 2004, 17:54
Scharfi : I didn't understand what you meant with your feature request in your last post here. For the bug report, I've no problem on my computer with such framerates, but I already made a lot of modifications to the filter, so may be the bug was solved somehow.
Soulhunter
13th May 2004, 19:58
Not so serious... ;)
Today I watched a nice movie (Fulltime Killer PAL/R2) with PowerDVD5 @ my friends PC !!!
The movie was interlaced....
Nothing special, but the way PowerDVD5 handles it !!!
No "real" interlacing artefact's at all, but motion-blur like hell... :scared:
So, PowerDVD5 is a "expensive" motion-blur generator ???
Bye
scharfis_brain
13th May 2004, 22:20
@Soulhunter:
Powerdvd is not a motionblur generator.
It is a STUPID blender.
it only blends the two fields together, resulting in motionblur, if shutterspeed is 1/60 (NTSC) or 1/50 (PAL).
or resulting in ghosting, if shutterspeed is shorter than 1/60 or 1/50.
@Manao:
I've built a motioncompensated deinterlacer to your suggestion doing a FULL compensation (el=bl=1). It works REALLY good, but it leaves a lot of artifacts of the prev & next field into the current frame, because of the underlying frame....
I assume your filter works like this:
drawing the current frame,
then move its blocks to the vectors new position.
the potential holes, that may occur due to block moving are filled with the previously drawed (underlying) frame.
but for a full compensation, it would be clever to use the actual frame as source for the moved blocks and the prev. frame as hole filler.
This will dramatically reduce remaing artifacts on full compensation.
Another request I have:
could you allow a free range of el & bl?
currently the range is 0...1
where 1 comensates the current frame to its predecessor.
what about also impementing negative values and a range more than 1...0...-1. So we could compensate 2, 3 or four frames...
Manao
13th May 2004, 22:54
Scharfi : the reason I didn't allowed el and bl outside of the 0..1 range was that I didn't want to check whether the block was moving outside of the frame or not. I'll check this on the next release ( it's already implemented ), and allow full range. But be warned that the compensated frame will quickly become a total mess ( a lot more blocks will recover one another, leaving a lot of space unfilled ).
For the underlying stuff, I now understand what you meant. It's indeed the right idea for a full compensation, but the filter wasn't meant to do that in the first place. I'll add it ( it's just a single line to change ) in the next release.
I now have to find how to fill the holes when I interpolate a frame with el = bl = 0.5 ( for example ).
scharfis_brain
13th May 2004, 23:25
either fill the holes with a weighted blend of the neighboring frames.
Using (el+bl)/2 as weight for the prev Frame and 1-(al+bl)/2 for the curr Frame.
or do some hole filling stupid interpolation, that builds a bridge ofver the holes.
maybe you can use the direction of the surrounding vectors as direction for the interpolation of the missing pixels.
Maximus_G
14th May 2004, 12:43
Originally posted by Manao
I now host my filters here :
http://jourdan.madism.org/~manao/
I get "server not found" error message trying to open that page. Is it working normally?
scharfis_brain
14th May 2004, 13:21
It does work for me.
try to delete your DNS entries or restart your system.
Edit:The heart of this Motion blur script is Donald Graft's excellent MSharpen and Smart Deinterlace filters. It could be better if VirtualDub's fantastic Box Blur filter were ported to AviSynth or at least (BoxBlur.vdf). This is no real time function (1 fps on my system)
This first frame is one field from a video that was shot at very high shutter speeds. This explains why there is no blurring even though the young man in the picture is flailing his arms very rapidly. This is the same problem that a video from a game presents (i.e., high motion but no blur), which is what this thread is all about. I shoot at high speeds to keep my backdrop color from bleeding into the subject. The sharp edges give me good separation but mess up the viewer's impression of movement.
http://www.angelico.hu/theodor/before
This next frame is the same half frame of the video, after passing through my motion blur script. N.B. There is absolutely no blurring of any part of the frame, all is done with alpha manipulation.
http://www.angelico.hu/theodor/after
Here is the script. I'm sorry, I don't have time right now to clean it up, it kind of developed as I was testing. Here's how it works:
I make a mask of the sharp edges of the video with "Msharpen.dll" then I reduce, blur, and enlarge to soften the mask, and use levels to lighten it up again. Then make the mask the video's alpha channel. Then I use layer to lay each frame over the previous frame of the video so that only the edges of the overlay clip appear on the base clip. Actually this overlay process is repeated once again with the frame before the previous frame. This is what gives the temporal blurring. In areas where there is no motion the overlay clip is the same as the base clip so there is no effect, but when there is motion, say an arm moving to the right of the frame, when I lay frame 3, for example, over frame 2, the hand is further to the right in frame 3 and it is blurred when seen over frame 2 because of the blurring of the edge detection mask.
I have another version of this motion blur script that seems to give better results, but is uses some blurring on the edges. If I tried to use blurring the way the above script is set up, the edges would always appear blurred, even when stationary. I get over this problem by running my edge detected mask through Dividee's Motion Mask function. This way, only the lines that are moving appear in the mask and they can be selectively blurred. Then I combine using the alpha channel without further blurring.
N.B. This script is for interlaced PAL video (720x576@25fps). But as you can see it can easily be altered for progressive video of any kind.
##########################################################
Import("VDub_filters.avs")
LoadPlugin("MSharpen.dll")
black=BlankClip(length=2155,width=720,height=288,fps=25,color=$000000)
\.Killaudio
videoX=AviSource("D:\ts\tommi2.avi").SeparateFields
\.ConvertToRGB32.ResetMask
bkgrd=videoX.Trim(1,0)
#bkgrd=BlankClip(length=2155,width=720,height=288,fps=25,
\color=$0000ff).Killaudio
#Turn this on to fill motion areas with solid blue. This is only for #making adjustments
msk=MSharpen(videox,15,0,true,true,false)
\.ReduceBy2.ReduceBy2.Blur(1).BiLinearResize(720,288)
\.Levels(0,1.3,175,0,255)
alpha1=ShowAlpha(videoX)#This is just a white clip since videoX is #opaque
alpha2=Mask(black,msk)
alpha3=Layer(alpha1,alpha2,"add",level=255)#Inverts mask
video=Mask(videoX,alpha3)#Now the video gets an alpha based soley on #edge detection
T0=video
T1=video.Trim(1,0)
T2=video.Trim(2,0)
T3=video.Trim(3,0)
MBfield=Layer(Layer
\(Layer(T0,T1,"add",level=255),T2,"add",level=255),T3,"add",level=255)#MBfield=motion blurred field
MBIframe=Weave(MBfield)#MBIframe=motion blurred interlaced frame
MBPframe=VD_SmartDeinterlace(MBIframe,"Field","all",false,false, \false,false,5,100)#MBPframe=motion blur progressive frame
Return MBPframe
DDogg
19th May 2004, 16:37
scharfis_brain, you mentioned in a our PM's that you might take a look at the Magic Bullet (http://www.redgiantsoftware.com/magbulsuit.html) software that changes DV to a 'film look' progressive. Do you think we will be able to eventually do something similar using Manao's plugin and avisynth script's? I am speaking more of artifact free, judder/jitter free reduction to 24p than the application of emulsion coloring emulation and the other stuff.
I suppose I am asking your opinion on whether you think this is a possibility, or if you see specific problems that can not be overcome. Also, if you did get a chance to look at this 1000 buck commercial software, what did you think of the results it provided?
@All, If anybody is interested, you might want to look at the reviews and examples page for some clips showing what can be done to the original DV footage.
scharfis_brain
19th May 2004, 17:21
Didn't I told you I do not have/own Adobe After Effects ?
thus using Magic Bullet is impossible to me :(
you've not told me how mvconvert60ito24p performs for you.
it is judder free but has to deal with some artifacts.
But Manao said he is working on that issue.
The function mvconvert60ito24p is fully complete from my side.
every improvement has to be done within the plugin it is based on - mvtools.
DDogg
19th May 2004, 21:25
> Didn't I told you I do not have/own Adobe After Effects ?
Nope :)
>you've not told me how mvconvert60ito24p performs for you
Waiting for some better footage. The test footage I use has a broad and fairly quick pan that gives nearly anything a lot of trouble. I get a lot of 'shimmering', near like slightly shiny larger blocks or slices moving around in the pan. Sorry for the poor explanation, but it is the best I can describe it. It is not what I would personally call artifacts, but may well fall into the general category as you perhaps mean it. Hopefully I'll get some decent footage soon to try more.
>The function mvconvert60ito24p is fully complete from my side.
every improvement has to be done within the plugin it is based on - mvtools.
And I thank both of you for your efforts to bring us this level of functionality. I would have never believed it possible a few years ago.
"you've not told me how mvconvert60ito24p performs for you."
Could someone post this function again, ie, "mvconvert60ito24p" or link to it, so I could have a look at it. I glanced quickly through the thread but couldn't find it.
scharfis_brain
20th May 2004, 00:54
look at this thread http://forum.doom9.org/showthread.php?s=&threadid=76041&perpage=20&pagenumber=1
Maximus_G
14th June 2004, 09:41
Returning back to the original question.
I'm having troubles with MVConvertFPS. Tried it with v.0.9.1 and 0.9.3 - doesn't work. The script is:
clip1=AVISource("C:\Temp\2\test.avi")
converttoyv12(clip1)
assumefps(150)
MVConvertFPS()
---
AVS says "Invalid arguments", even when i give it default ones (nb=1, rl=0, fbw=2, sbw=2, rbw=2, bvt=35000, wf="uniform").
It worked only in ver.0.9.1 and only when "fps" argument was the same "150", which is nonsense.
And MVblur works fine at the same time.
WHAT am i doing wrong... :\
could someone please explain, how should the working code look like, if i need to take 150fps video and convert it to 25fps, making motion blur based on 6-frame blocks (150/25), simulating normal camera shutter speed?
Manao
14th June 2004, 09:55
MVConvertFPS needs to be given a value for the argument 'fps' ( source.MVConvertFPS(fps = 30) ). However, in your case, MVConvertFPS won't work. You want to blend 6 frames together, while the MVTools can only interpolate a frame between two frames. So you should use :source = AVISource("C:\Temp\2\test.avi").converttoyv12().assumefps(150)
source = source.temporalsoften(2,255,255,10,2)
ConvertFPS(25)Which will blend 5 frames together and decimate by 6.
scharfis_brain
14th June 2004, 10:00
you already have a 150 fps video to input?
then do something like this:
assumefps(150)
mvblur(....)
x0=selectevery(6,0)
x1=selectevery(6,1)
x2=selectevery(6,2)
x3=selectevery(6,3)
x4=selectevery(6,4)
x5=selectevery(6,5)
x23=overlay(x2,x3,opacity=0.5)
x14=overlay(x1,x4,opacity=0.5)
x05=overlay(x0,x5,opacity=0.5)
x1234=overlay(x23,x14,opacity=0.5)
x012345==overlay(x1234,x05,opacity=0.7)
return x012345
this code will, blur the motion between all frames of the input, and then merge every stack of 6 frames into one frame using blending, this will result in a high quality motion blur and 25fps.
morsa
14th June 2004, 10:47
so ,any new way to convert 30p to 24p?
scharfis_brain
14th June 2004, 10:52
@morsa: mvconvertfps(fps=24) ?!?
from mvtools!
maybe syntax has changed due to added server/client structure...
so please read its documentation
morsa
14th June 2004, 12:17
thank you!!
you always save me...:)
Another question:
So it would give a nice result to first deinterlace 60i to 30p and then mvconvertfps=24 ?
scharfis_brain
14th June 2004, 12:43
huh?
if you want to convert real interlaced video (60i) to 24p use either
my function convert60ito24p or mvconvert60ito24p
both functions need a bobbing deinterlacer applied before.
deinterlacing to 30p and then using mvconvertfps will significantly reduce motion and interpolation quality!
Maximus_G
14th June 2004, 13:27
Originally posted by Manao
MVConvertFPS needs to be given a value for the argument 'fps' ( source.MVConvertFPS(fps = 30) ). However, in your case, MVConvertFPS won't work. You want to blend 6 frames together, while the MVTools can only interpolate a frame between two frames.
Sorry to hear that. I've been trying hardly, not having seen anything about that in readme files...
So you should use :source = AVISource("C:\Temp\2\test.avi").converttoyv12().assumefps(150)
source = source.temporalsoften(2,255,255,10,2)
ConvertFPS(25)Which will blend 5 frames together and decimate by 6.
For the good quality motion blur in fast-moving scenes, 150fps of static images isn't enough. So some good interpolation between frames IS needed - that's why your plugins are highly appreciated by me :) I just thought that MVConvertFPS can make interpolations not only between 2 adjacent frames, but also between "remote" ones, using frames between'em as keypoints. I've specially made a hi-fps video in order to use precise MV-maps.
---
OK, i got it!
Bug_report:
function mvconvertfps(fps = X) works fine in mvtools-v0.9.1 and MVTools-v0.9.2.2 BUT fails in MVTools-v0.9.3.
---
2 scharfis_brain:
Thank you, i'm trying it :)
Manao
14th June 2004, 14:23
Scharfi's answer is far better than mine, except that I would do the final blending with a TemporalSoften(2,255,255,10,2)
Maximus_G
15th June 2004, 01:15
I tried it. At last, i see a REAL motion blur in a game video :)
Moreover, there appears some kind of a film grain effect.
But there's also a ghosting effect - in fast-motion scenes. Trying to eliminate that.
2 Manao:
Your filters could be very useful in restoring dropped frames. Only some automation of the process is needed.
scharfis_brain
15th June 2004, 01:35
please provide a link of your 150 fps video. (PM me)
then I am able to create script that works....
btw. automated frame-drop interpolation would be possible using avisynths scripting, IF manaos filters would return a compemsated frame, immediately after random seek...
it is not very hard detecting dropped frames, because dropped frames are identical to their predecessors.
Maximus_G
15th June 2004, 07:38
OK, I'll just find an appropriate hosting.
Maximus_G
16th July 2004, 02:17
Thanks again to scharfis_brain :)
(sounds like a poem :D )
Manao's MVconvertFPS is very good for making a high-fps video, so we could temporalsoften adjacent frames and get motion-blur as a result.
Manao, thank you for your work!
I've been using MVtools ver.0.9.2.2 and it understands "MVconvertFPS(fps=1000)" perfectly well.
But ver.0.9.2.2 has difficulties when building motion-vectors for the small objects. So when converting for example 100fps to 1000fps, these small objects just disappear (fade out) at one place, and fade in at another. As a result it looks not as constant motion, but like a ghosting.
So i tried newer versions, using the same MVconvertFPS(fps=1000).
Sadly, ver.0.9.4 says something like "invalid arguments",
and ver.0.9.5 says "Evaluate: Unrecognized exception!"
How can i make this operator work? Maybe there's a need to use some additional parameters?
Manao
16th July 2004, 05:45
The syntax of the filters has changed. You know have first to use an analysing filter, which will give you a vector's stream, and then feed that stream to the processing filter, MVConvertFPS in your case.
Moreover, some filters ( MVConvertFPS, MVDenoise, MVBlur for example ) need two vector's streams : one backward, one forward. Look at the following example :backward_vectors = source.MVAnalyse(isb = true, lambda = 2000)
forward_vectors = source.MVAnalyse(isb = false, lambda = 2000)
result = MVConvertFPS(backward_vectors, forward_vectors, fps = 1000)
return resultYou'll find more informations here (http://forum.doom9.org/showthread.php?s=&threadid=76041), and in the documentation of the set of filters.
Maximus_G
16th July 2004, 12:35
Thank you, it worked!
Looks better.
But renders the hell longer, at st=3 and stp=160...
BTW, there are the results of processing game videos using MVTools:
http://sukhoi.ru/forum/attachment.php?attachmentid=26338
http://sukhoi.ru/forum/attachment.php?attachmentid=26339
http://sukhoi.ru/forum/attachment.php?attachmentid=26340
Manao
16th July 2004, 12:48
But renders the hell longer, at st=3 and stp=160...Lol. Indeed. For each 8x8 blocks, with your settings, you try 320x320 blocks... No wonder why it's slow :). It should be fine with the settings I gave, and much faster
Maximus_G
17th July 2004, 15:14
Yes, i thought that mode would be better in processing high-motion objects (speed of 160 pixels per frame) + quarter-pixel precision to process small objects properly. But the tests proved to be just opposite. st=0 is better.
scharfis_brain
17th July 2004, 15:18
maximus, which way did you finally choose to compute motionblur?
- capping at high framerates like 150 fps?
- preprocessing with deshaker? (to smooth jerky mouse movements)
- blowing up to 1500 fps using mvconvertfps ?
- temporal blur?
Manao
17th July 2004, 15:22
Exhaustive and N-Step algorithms have a restricted search window. Logarithmic & One Time search don't, because they try blocks until they can't reduce the distorsion. Hence, they'll be able to catch longer movements.
But, since there is also a hierarchal analysis, Exhaustive & N-Steps don't perform too bad either. I strongly recommend Logarithmic ( st = 2 ), with an 'stp' of 1 or 2.
quarter-pixel precision to process small objects properly.Huh ? Quarter pixel doesn't help for small objects, it only allows to have more precise motion vectors ( hence smaller SAD ). Also, it allows less blurring & artifacts when using interpolating filters, such as MVConvertFPS & MVBlur.
Maximus_G
18th July 2004, 14:24
Originally posted by Manao
Huh ? Quarter pixel doesn't help for small objects, it only allows to have more precise motion vectors ( hence smaller SAD ). Also, it allows less blurring & artifacts when using interpolating filters, such as MVConvertFPS & MVBlur.
Well, that was just my guess-work.
BTW, here are the results of blowing up the frameate from initial 100fps to 2000fps:
1. using st=2 mode (http://www.very.far.ru/temp/040719_st2.jpg);
2. using quarter-pixel (http://www.very.far.ru/temp/040719_pel4.jpg);
3. and produced by motionperfect (www.very.far.ru/temp/040719_mperf.jpg).
2 scharfis_brain:
Yep, i do capture at 100fps, then blow up to 2000fps, and do the thing:
temporalsoften(3,255,255,mode=2).selectevery(4,0)
temporalsoften(3,255,255,mode=2).selectevery(4,0)
temporalsoften(2,255,255,mode=2).selectevery(5,0)
But there still is a ghosting effect (http://www.very.far.ru/temp/040719_st2_blurred.jpg). So it's definitely not the final way - there's a need to blur more effectively.
And i avoid using deshaker - it's better to make initial movements smooth then dealing with jerky video later :)
scharfis_brain
18th July 2004, 14:42
how long is the resulting motionblur?
if the blurs are touching each other from frame to frame, you'll get a VIDEO-Look.
if the blurs length is of the half length from frame to frame, you'll get the FILM-Look...
Manao
18th July 2004, 14:45
BTW, I forgot to say that on this thread, but if motion search can be made up to the 1/8 pixel, the interpolation can't use it ( and doesn't normalize properly the motion vectors, hence artifacts ).
So I guess that "Also, it allows less blurring & artifacts when using interpolating filters, such as MVConvertFPS & MVBlur." could have been a little misleading : I was speaking theorically.
The screenshots you posted are interesting : could it be possible for you to make available a small video exemple produced by MotionPerfect, to try to guess how it works, and if I can do as good as them ?
Maximus_G
19th July 2004, 01:10
2 scharfis_brain:
I don't remember it's exact length (can't check now), but it should be "full shutter speed", 1/25 sec. To get the half-length, as i understand, we just change the last temporalsoften to (1,255,255,mode=2). And to get the fast shutter of 1/100 sec, we take that temporalsoften out.
I can't figure out the right way to temporalsoften, to get the smooth result. At that video having 2000fps, the bomber is moving much slower than the distance between "ghosts" in blurred result. And it's moving smoothly. So why do they appear? That's the main problem now.
2 Manao:
I think it would be more comfortable if i prepare some sequences of source frames running at 100fps, and you could just download motionperfect (http://www.snapfiles.com/download/dlmotionperfect.html) and run it using parameters you need :) Since i'm limited in hosting space and traffic... Guess 5-frame scenes would be enough?
Manao
19th July 2004, 05:42
Yes, it will do. Thank you
Maximus_G
19th July 2004, 12:32
Manao,
i've made 2 image sequences (http://www.very.far.ru/temp/) (targa, archived with winrar 3). Tell me when you're ready for more :)
scharfis_brain
19th July 2004, 12:42
I am not manao, but your link is not working
it leads to a black site showing two links to your files, but for both I am receiving error 403 (Forbidden).
Maximus_G
19th July 2004, 14:20
Sorry. I've forgot about that site policy :angry:
Should be working now. Just delete that ".zip" extension.
Manao
19th July 2004, 21:53
I downloaded a had a look at MotionPerfect. It does a great job, but I think a may be able to approach their quality, as soon as the ME is working again ( meaning not so soon :( ).
Thanks for the samples, they are great for testing.
scharfis_brain
20th July 2004, 00:09
pros of MP:
- no blocks, or block-like errors
- pleases with natural overall look of the image (not video)
cons of MP:
- it does NOT recognize static parts, like logos etc. they are jittering all the time.
- it morphs/warps the whole image like it would be a film of rubber... this means differential motion is handled very bad
(pumping extremely wide borders)
- configuration (the GUI) is crap.
- they are stating it can repair drops & dupes,but only real framedrops can be handled. dupes are recognized, but not repaired....
dbzgundam
27th July 2004, 06:05
Why is Vdubmod giving me "Unrecognized Exception" upon trying MVtools?
I do have AssumeFPS(150) on too, so aside from that I can't think of anything...... The video is already YV12 as well (if that's necessary).
Manao
27th July 2004, 06:11
Post your avisynth's script, and MVTools version please.
dbzgundam
27th July 2004, 06:21
Simply:
AVISource("...",false)
AssumeFPS(150)
MVConvertFPS(fps=24)
This is using V0.9.5
Still getting "Unrecognized Exception". :mad:
Manao
27th July 2004, 06:28
Indeed, and it's quite normal.
Have a look here (http://forum.doom9.org/showthread.php?s=&threadid=76041&postid=506662#post506662) and in the MVTools' documentation.
dbzgundam
27th July 2004, 06:36
I'm sorry but I still can't make any sense out of that thread or the documentation. I am quite stupid when it comes to understanding how a filter actually works. :rolleyes:
Manao
27th July 2004, 06:54
Alright : since MVTools 0.9.3, the filter doesn't work as before. It works in two stages made by two different filters :
* The first one, MVAnalyse, will take as input a video clip, will analyse it, and will output a 'vector clip', which is basically the motion vectors of the video put into a video stream in order to be given to the next filter.
* the second one, the processing filter, is one of the filters you were using previously. It has to be fed with a video clip ( which will be processed by the filter ), and a vector stream ( in order the filter to know what are the motion vectors ).
So basically, the simplest processing chain would be something like : source = avisource("foo.d2v")
vectors = source.MVAnalyse(isb = false)
result = source.MVShow(vectors)
return resultNow, you may ask what the paremeter 'isb' is doing. It tells the analysis filter in which direction it has to search the motion vectors. It stands for 'is backward', isb = true will search backward, isb = false, forward. It has to be specified, because some filters need not only a forward vector's stream, but also a backward's one.
It's the case for example for MVDenoise, MVConvertFPS, MVBlur and MVInterpolate. For these filters, you have to provide as input a video clip, and two vector's stream.
The script becomes source = avisource("foo.d2v").assumefps(150)
backward_vectors = source.MVAnalyse(isb = true)
forward_vectors = source.MVAnalyse(isb = false)
result = source.MVConvertFPS(backward_vectors, forward_vectors, fps = 24)
return resultBTW, I hope you are familiar with the avisynth's syntax I'm using ( clip_name = clip.filter1(...).filter2(...) ) because you have to use it in order to use the MVTools.
And finally, since you're using the 0.9.5 version, have a look here (http://jourdan.madism.org/~manao/mvtools.htm) in order to have the latest documentation on the filter.
FredThompson
25th February 2005, 00:05
Any progress on these techniques? Long time, no post.
scharfis_brain
25th February 2005, 14:45
here I posted something about motionblurring
http://forum.doom9.org/showthread.php?s=&threadid=89601
if you have zero shutter video footage (maybe CG-stuff)
then you need the following function calls to simulate Film-motionblur.
last.mvfps(framerate(last),6,1) #lowest accuracy, only three framesare used to create moblur
or
last.mvfps(framerate(last),10,2) # better accuracy, five frames
or
last.mvfps(framerate(last),20,5) #eleven frames
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.