Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th January 2005, 03:13   #101  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
glow in film is caused by crap on the lens though... meaning that everything gets the same amount of glow (not just the objects).

bright objects appear to glow more because of overexposure - the effect can be mimiced using high dynamic range images (ie, 32-bit floating-point images captured using multiple images at different exposures).

this can be fudged with a simple gamma curve on the glow mask.
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 19th January 2005, 05:02   #102  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
For NTSC material I bob my clip from 30i to 60p using either TDeint() (then supersample it using TomsMoComp) or MVBob(). Then use scharfis_brain's convert60ito24p() script to convert 60p to 24p.

By doing this you are left with 24 progressive frames per second -- the same as a film camera.

After this I do a Tweak() on saturation in the colors. Of course it depends on what your "film" to look like. If you want it colder, obviously reduce the saturation. If you want it to look like a modern film, where colors are more warm, then increase the saturation. I then use the Histogram() to find out where my blacks need to be and then use Levels() to increase the grayscale.

You can also make your own DOF adapter for your video camera (instead of buying one-- hefty price involved). You can check out a how-to at http://www.marlathemovie.com/, a movie totally shot on DV.

Another good thing to do is to use a sharpener to sharpen your video. Look into LimitedSharpen(). Also adding grain (as mentioned before) does help the illusion of film. 16:9 is always a good thing as well (which I have made a custom script to do for me as well).

Regards,
joshbm
__________________
Tired of waiting for video encodes? Get a totally new P4 Desktop Computer for FREE.

Last edited by joshbm; 19th January 2005 at 05:08.
joshbm is offline   Reply With Quote
Old 19th January 2005, 06:14   #103  |  Link
Macanudo
Registered User
 
Join Date: Jun 2002
Location: Texas
Posts: 59
E-Male,

Here is a photoshop tutorial that may give you some ideas on how to achieve the Depth of Field simulation you are pursuing - Hocus Pocus Focus

It is a mov tutorial, so you will need Quicktime installed to view it. I think you might find the portion dealing with a DOF gradient mask of particular interest. I realize that Avisynth doesn't have an equivalent of a "lens blur" filter found in the tutorial, but IMHO I think that the idea of a "gradient mask" would be the best approach to simulating DOF.

If you duplicate the original clip and apply a "Gaussian Blur" of a radius of say 50.0(I used Didee's suggestion in this thread to simulate the Gaussian Blur.), then using Overlay() sandwich a Gradient mask(I created my mask in Gimp) between the blurred clip and the original clip with the Lightest area of the mask being the most blurred and the Darkest area being the most focused.

Here is the script I used:
Code:
a=AviSource("C:\boats.avi")
b=a.bicubicresize(150,100,1.0,.0).bilinearresize(720,480)
g=ImageReader("C:\gradient-2.bmp").AssumeFPS(29.97)
Overlay(a, b, mask=g, mode="blend", opacity=1.0)
Here is my result:

Original Screen Shot (frame#360)


Gradient Mask (frame#360)


Gaussian Blur Simulation Screen Shot (frame#360)


DOF Simulation Screen Shot (frame#360)


I purposely exaggerated the effect for this test, so you may want to adjust it a little. You can customize this method by creating different gradients, Gaussian Blur radiuses, and Overlay options.

This may not be exactly what you are looking for, but it may give you a jumping off point.

Hope I have contributed,
Macanudo

Edit: Included Gaussian Blur Simulation Screenshot. Don't ask me where the blue band on the Gaussian simulation came from, I suspect it was a side effect of the resizing used to create the blur, but I am not sure.

Didee,
Is the blue band a product of the Bicubic or Bilinear Resizing?
Did I follow your suggested method for creating the Gaussian Blur incorrectly?

Last edited by Macanudo; 19th January 2005 at 07:40.
Macanudo is offline   Reply With Quote
Old 19th January 2005, 07:56   #104  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
the blur looks a little pixelly. try bilinear down, and bicubic(1,0) up to get a smoother blur.
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 19th January 2005, 09:27   #105  |  Link
Macanudo
Registered User
 
Join Date: Jun 2002
Location: Texas
Posts: 59
Quote:
Originally posted by Mug Funky
the blur looks a little pixelly. try bilinear down, and bicubic(1,0) up to get a smoother blur.
Here is the result:


I see a noticeable improvement. What do you think?
Macanudo is offline   Reply With Quote
Old 19th January 2005, 11:04   #106  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
yeah, looks better now.

what's that blue line on the right?
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 19th January 2005, 11:25   #107  |  Link
Macanudo
Registered User
 
Join Date: Jun 2002
Location: Texas
Posts: 59
Quote:
Originally posted by Mug Funky
yeah, looks better now.

what's that blue line on the right?
I am not sure...I think it may have something to do with the resizing used to simulate to Gaussian Blur. If you will look up at the screenshot of just the Blur Simulation that is when it first appears.
Macanudo is offline   Reply With Quote
Old 19th January 2005, 12:10   #108  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,391
Try the intermediate resizing with MOD4 resolutions. You did 150*100, where 150 is only MOD2.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 19th January 2005, 12:16   #109  |  Link
Macanudo
Registered User
 
Join Date: Jun 2002
Location: Texas
Posts: 59
Quote:
Originally posted by Didée
Try the intermediate resizing with MOD4 resolutions. You did 150*100, where 150 is only MOD2.
Bingo...that fixed it. No more blue band.

Thanks Didee!

Later,
Macanudo
Macanudo is offline   Reply With Quote
Old 19th January 2005, 13:32   #110  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
so this means, the higher up a pixel is the more it gets blurred, right?

this works ok for shots like this, when you see a lot of floor (i hope you get what i mean)

but on a close-up this would look odd i assume
E-Male is offline   Reply With Quote
Old 19th January 2005, 13:53   #111  |  Link
Macanudo
Registered User
 
Join Date: Jun 2002
Location: Texas
Posts: 59
Quote:
Originally posted by E-Male
so this means, the higher up a pixel is the more it gets blurred, right?

this works ok for shots like this, when you see a lot of floor (i hope you get what i mean)

but on a close-up this would look odd i assume
It has its limitations, but by gradiently blurring you get a more realistic impression of depth, as opposed to blurring the background uniformly.

You can create gradient masks in a variety of shapes to suit your application. I used a simple linear gradient mask for this test, but you can create radial, diamond, or custom shaped gradient masks.

The major set back with this method is that the gradient mask remains stationary. If your subject moves the gradient mask does not move with it. If there was some way to create a mask that would track the subject you could resolve one of the major limitations IMHO. I think it can be done with motion prediction, but that is way over my head. That would require one of the resident GURUS to work out.

As far as a close up goes, you could try a radial or eliptical gradient mask that encirles the face and/or body of your subject. I think that would give you the desired effect, provided your subject doesn't move their head very much within the frame.

EditOh sorry, Yes, the further up you go the the blurrier.

Last edited by Macanudo; 19th January 2005 at 14:13.
Macanudo is offline   Reply With Quote
Old 19th January 2005, 14:14   #112  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
i see, so we have a "great looking but not automatic" solution

i think i'll use that on some scenes

i should be able to build a focus shift function on that
E-Male is offline   Reply With Quote
Old 19th January 2005, 14:57   #113  |  Link
Macanudo
Registered User
 
Join Date: Jun 2002
Location: Texas
Posts: 59
Here is an example of a radial gradient mask applied to the boat the the far right. It isn't the best example, because it doesn't look very realistic just having the right bottom corner in focus. I just wanted to show you what a different shaped gradient would yield.

Radial Gradient


DOF using Radial Blur (frame#360)
Macanudo is offline   Reply With Quote
Old 19th January 2005, 16:01   #114  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
wow, pretty nice effect

but it's not so easy to make thos masks without some knowledge of graphic programs (which i don't have)

but i'll look into it
E-Male is offline   Reply With Quote
Old 19th January 2005, 16:36   #115  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
i think i got an idea for a plug-in (in fact 2) that will allow creating the masks directly in avisynth
E-Male is offline   Reply With Quote
Old 19th January 2005, 18:51   #116  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
good news
i was able to dublicate both masks
plug-in release later tonight or tomorrow
E-Male is offline   Reply With Quote
Old 20th January 2005, 00:32   #117  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
i finished a little plug-in that can create such masks directly in avisynth

EDIT: see next page

Last edited by E-Male; 21st January 2005 at 04:39.
E-Male is offline   Reply With Quote
Old 20th January 2005, 07:18   #118  |  Link
Macanudo
Registered User
 
Join Date: Jun 2002
Location: Texas
Posts: 59
E-Male,

I think there is a bug.

Here is my script
Code:
LoadPlugin("C:\Program Files\AviSynth 2.5\Filters\maskmaker.dll")
a=AviSource("K:\boats.avi")
b=a.bilinearresize(104,48,1.0,.0).bicubicresize(720,480,1.0,0.0)
g=b.maskmaker(1,3,0,0,500)
Overlay(a, b, mask=g, mode="blend", opacity=1.0)
If you will look at the following screencaps you will see what I mean. These are consecutive frames.

MaskMaker Test Screen Shot #1(frame#430)

MaskMaker Test Screen Shot #2(frame#431)


The masked area shifts back and forth every few frames between these two locations.

I wish there were someway to send you the video, but I don't have any host space. I think you get the idea from my screen shots though.

Question:
Does the mask layer have a transparent or white background? Because, in order to be truly effective as a mask the background of the mask created should be white.

I hope I have helped,
Macanudo

Edit I goofed and posted the wrong frame for screen shot #1. Fixed it with this edit

Last edited by Macanudo; 20th January 2005 at 07:24.
Macanudo is offline   Reply With Quote
Old 20th January 2005, 07:43   #119  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
duplicated it
i'll have a look
E-Male is offline   Reply With Quote
Old 20th January 2005, 08:00   #120  |  Link
Macanudo
Registered User
 
Join Date: Jun 2002
Location: Texas
Posts: 59
Wait a minute...After replacing the Gaussain Blur simulation code in my script with tsp's new filter "Variable Blur" the masked areas shift changes positions again, now they shift between the bottom right corner to the top left corner instead of the bottom left to the top right as before.

Here is the new code:
Code:
LoadPlugin("C:\Program Files\AviSynth 2.5\Filters\variableblur.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\Filters\maskmaker.dll")
a=AviSource("K:\boats.avi").ConverttoYV12()
b=a.VariableBlur(radY=50)
g=b.maskmaker(1,3,0,0,500)
Overlay(a, b, mask=g, mode="blend", opacity=1.0)
The results are far more pleasing using "Variable Blur" as well. I think you will prefer tsp's new filter. By the way I have exaggerated the blur so you could see the contrast between focused to blurred better. Try VariableBlur(radY=10), it is great effect.
Macanudo is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:37.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.