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

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st February 2005, 10:54   #201  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
I've stumbled on this thread a little late but I was playing around with the methods listed on the original website (Photoshop method). For the most part it is a straight port of his method, except the green mask is toned down a bit and I merged the original base layer with the final result.

On the left is the "film" look and on the right is the original video. Xvid@Q5:

http://rapidshare.de/files/665159/Li..._xvid.avi.html

Tomorrow I'll see how it looks on my TV and play around with the FPS. Also, I suck at Subtitle(), can anyone post a sample of a simple Subtitle line for showing text on the bottom right?
Backwoods is offline   Reply With Quote
Old 21st February 2005, 20:57   #202  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
nice effect, looks really good IMO

only thing i'd add would be addgrain with very mild settings

and please post your complete script/procedure

http://www.avisynth.org/Subtitle
maybe subtitle(text="abc", align=3)
E-Male is offline   Reply With Quote
Old 21st February 2005, 21:19   #203  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
First I captured footage from my HDR-FX1, saved a portion of my cousin's lizard eating in DGIndex, used this script to export BMPs from Virtual Dub:
Code:
Mpeg2Source("00.d2v")
SeparateFields()
Lanczos4Resize(960,540)
Then applied the procedure listed @ http://www.dcs.gla.ac.uk/~jhw/filmy/ in Photoshop to each frame using the batch feature (I would post the action file, but not sure where it saves.)

Then this script was used to compare the two and lower the green a little bit in the "film" clip.

Code:
a=AVISource("Lizard_FILM.avi").crop(0,0,-480,0).RGBAdjust(1, .955, 1, 1, 0, 0, 0, 0).subtitle("FILM",-1,-1,0,900,"arial",30,$ffffff)
b=AVISource("Lizard_VIDEO.avi").crop(480,0,0,0).subtitle("VIDEO",-1,-1,0,900,"arial",30,$ffffff)

return StackHorizontal(a,b)
Now some of this was done after a night of drinking, so I'm sure I could have done some things differently and I'll hopefully figure that out today and tonight. Oh and another thing I'd like to figure out is ImageSource, another thing that escapes me. So I can import the series of BMPs instead of making a lossless AVI.

Quote:
Originally posted by E-Male
http://www.avisynth.org/Subtitle
maybe subtitle(text="abc", align=3)
Yea I've read up on that and searched the forums, still not settling in for me. And that line gives an error. Sooner or later I'll get it(something simple like this escapes me sometimes). Thanks though.

Last edited by Backwoods; 21st February 2005 at 21:27.
Backwoods is offline   Reply With Quote
Old 22nd February 2005, 03:00   #204  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
ah, i see
didn't know photoshop does allow batch processing

my goal is to do everything in avisynth

since you understand that photoshop guide, would help me porting it by answering some questions?
E-Male is offline   Reply With Quote
Old 22nd February 2005, 03:06   #205  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
As best as I can, sure. I'm actually about to start trying the same method in AVISynth now.

EDIT: The procedure listed on that website can definitely be done in AVISynth...I think to the T. It might take me a bit to get it, have to learn all about Overlay() but I think it will work. And I'm sure it'll be MIGHTY slow. For now, I loaded up two AMP files with your plugin and they worked just like how they should.

Last edited by Backwoods; 22nd February 2005 at 04:46.
Backwoods is offline   Reply With Quote
Old 23rd February 2005, 04:23   #206  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
i'll go through the guide step by step tomorrow (or when i have time)

i'll then post which steps will work in avisynth now and which will need new plug-ins
i'll also post which steps i don't undertsand
E-Male is offline   Reply With Quote
Old 23rd February 2005, 04:49   #207  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
Which features do you think AVISynth can't do? From what I can tell, all can be done. The only problem I see is when the image has to be converted to LAB color and effects applied to certain layers.

LoadPlugin("C:\Program Files\AviSynth 2.5\yea\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\yea\GiCoCU.dll")


Mpeg2Source("menu.d2v")

#base=Mpeg2Source("menu.d2v")
#FILM=Mpeg2Source("menu.d2v")
#Mpeg2Source("menu.d2v")
ConvertToRGB()
SeparateFields()

#FILM Layer
GiCoCU("C:\download\filmy.amp",photoshop=true)

#Sharpen & Gaussian Blur [Unsharp Mask on Luminance Layer + GB on A/B Channels]

#Contrast Layer 1 [Dup FILM layer - (70% blue, 10% green, 20% red) Opacity 20%]

#Highlight Layer [Dup FILM Layer - Gaussian Blur Radius 5 pixels Layer blend Screen, Opacity 52%]

#Detail Layer [Dup FILM layer - Highpass Radius 6 pixels Image/Adjust/Desaturate Layer blend Soft Light, opacity 30%]

#Color Cast [Fill with color cast choice; medium dark green or orange are good Layer blend Soft Light, Opacity 40%. Use lower opacity for less dramatic effect]

#Original Blend [Dup base (unmodified) layer. Layer blend normal, opacity 30%. Adjust this opacity to get a balance between contrast and smoothness.]

#Shadow Pull-up [Layer blend Lighten, Opacity 15% - Base Layer]
GiCoCU("C:\download\shadow.amp",photoshop=true)

#Highlight Pull-Down [Layer blend Lighten, Opacity 20% - Base Layer]
GiCoCU("C:\download\highlight.amp",photoshop=true)

#Contrast Layer 2 [Dup FILM Layer - Desaturate by 50% Layer blend Soft Light, Opacity 10%]

That is the script so far, just loading 2 AMP files and commenting on what else is needed. The use of Overlay and naming commands, then applying certain effects to them is still needed.

I've done an other test using PS and it came out pretty good I think, have to make a couple AVIs comparing again and output to TV. I'll post an Xvid of it tonight or tomorrow.

Last edited by Backwoods; 23rd February 2005 at 04:51.
Backwoods is offline   Reply With Quote
Old 23rd February 2005, 11:30   #208  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
OK, here is mylist:


Original:
baselayer=dv.deinterlace...
not sure which deinterlacer, should be tested
also we have to convert to rgb

FILM Layer:
filmlayer=baselayer.gicocu....
i see no problem here

Sharpen and Grain:
filmlayer=filmlayer.limitedsharpen...
filmlayer=filmlayer.addgrain...
modified for avisynth, other filter can be used here aswell
also i skipped the chroma blurring for now
we need yuv colorspace here

Contrast Layer 1 :
contrastlayera=filmlayer.channelmixer...
AFAIK there is no channelmixer in avisynth
but it should be very easy to code

Highlight Layer:
highlightlayer=filmalyer.gaussianblur...
there is a gaussian blut plug-in

Detail Layer:
detaillayer=filmlayer.highpass...
detaillayer=detaillayer.tweak...
desaturatino can be done with tweak i suppose
for highpass filterign there is no plug-in i know off
but if seen it done in a script by subtracting a blurred image from the original
not sure if this is what we need here

Color Cast:
colorcast=blankclip....
not sure if this really needs an extra layer
EDIT:
rgblut should be able to do the same job
:EDIT

Original Blend:
no problem

Shadow Pull-up / Highlight Pull-Down
here we'd need LAB colorspace
EDIT:
i got some code in my test-app that looks good
i think i can implement processing of L-curves
:EDIT

Contrast Layer 2:
no problem

Illumination coloring layer:
don't knwo of a filter doing a "Gradient Map"
but i think i can code such a filter for yuv colorspace

Grain Layer:
no problem
addgrain should do the job in avisynth

For black and white [optional]:
no problem i think

then we just have to overlay everything properly
EDIT:
i found a site with algorithms for "lighten", "screen", ...
i think they'll be doable in rgblut
:EDIT


so, i'll wait for some comments now, before i start looking into coding the missing plug-ins

Last edited by E-Male; 23rd February 2005 at 18:02.
E-Male is offline   Reply With Quote
Old 23rd February 2005, 21:00   #209  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
Gaussian blur for AVISynth: http://forum.doom9.org/showthread.php?s=&threadid=88645

Unsharp Mask for AVISynth shouldn't be too hard for someone to code. I believe there is such a plugin for VDub.

Overlay can do lighten but I do not see screen, so screen would be needed.

LAB color I have no idea about.

The LAB color part was the only thing I saw as a problem, but like you mentioned: "then we just have to overlay everything properly." Scripting that would take me some trial and error but I'm confident in that.

By the looks of it, we have just about everything.
Backwoods is offline   Reply With Quote
Old 23rd February 2005, 21:59   #210  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
yep, that the gausian blur i meant

i think we don't have to use the same sharpener

lighten, but not softlighten
rgblut IMO is the best solution, fast and programabel

as long as the curve only manipulated tha L-channel the formulas aren't that hard, but i haven't testet it yet

3 plug-ins and some scripting to go, looks like we'll soon have a test version
E-Male is offline   Reply With Quote
Old 24th February 2005, 09:31   #211  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
Quote:
Originally posted by E-Male
lighten, but not softlighten
rgblut IMO is the best solution, fast and programabel
I'll check out RGBlut tomorrow and work on the script also.
Backwoods is offline   Reply With Quote
Old 24th February 2005, 09:43   #212  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
i just noticed there is no rgblutxy
so i'll have to add the blending features to the plug-ins to do list
this might slow down things again

i daubt working on the script will be worth the effort as long as we don't have the plug-ins/functions for all teh steps
E-Male is offline   Reply With Quote
Old 26th February 2005, 19:02   #213  |  Link
FredThompson
Registered User
 
FredThompson's Avatar
 
Join Date: Feb 2002
Location: Charlotte, NC USA
Posts: 1,960
How about packaging GiCoCu with a readme and a page?
__________________
Reclusive fart.
Collecting Military, Trains, Cooking, Woodworking, Fighting Illini, Auburn Tigers

Last edited by FredThompson; 26th February 2005 at 21:41.
FredThompson is offline   Reply With Quote
Old 26th February 2005, 20:25   #214  |  Link
Dark-Cracker
Registered User
 
Dark-Cracker's Avatar
 
Join Date: Feb 2002
Posts: 1,195
you have an unsharp mask filter in the warpsharp.dll plugin if i right remember.
__________________

AutoDub v1.8 : Divx3/4/5 & Xvid Video codec and .OGG/.MP3/.AC3/.WMA audio codec.
AutoRV10 v1.0 : Use RealVideo 10 Codec and support 2 Audio Streams and Subtitles.

Dark-Cracker is offline   Reply With Quote
Old 27th February 2005, 00:03   #215  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
Quote:
Originally posted by Dark-Cracker
you have an unsharp mask filter in the warpsharp.dll plugin if i right remember.
I tried that and the valves didn't seem to give the same effect as they did in Photoshop.

The script is coming along and I'm taking progress shots to compare to the same procedure in Photoshop. Hopefully by the middle of the week I'll have everything done that I can possibly do as of now.
Backwoods is offline   Reply With Quote
Old 27th February 2005, 10:58   #216  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
i know i'm lazy with readmes, i'll try to improve on that

why do we have to use the same sharpener as in photoshop
there are great sharpeners for avisynth, like limited sharpen
i think some modification of that script might be the best we can get
E-Male is offline   Reply With Quote
Old 27th February 2005, 23:02   #217  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
Sure some modification will have to be done, I was just going along with the original at first and we can always improve from there. Also I think using LimitedSharpen would make the script run slower. That is why I'd like to hold off on that for now.
Backwoods is offline   Reply With Quote
Old 28th February 2005, 00:14   #218  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
then warpsharp (one of them) should be the best for beginning
E-Male is offline   Reply With Quote
Old 28th February 2005, 03:00   #219  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
Original Video from HD cam


Video processed frame by frame in Photoshop


Video processed with AVISynth


E-Male, I think we're there.

Script:
Code:
LoadPlugin("C:\Program Files\AviSynth 2.5\yea\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\yea\Decomb521.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\yea\GiCoCU.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\yea\TweakColor.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\yea\FFT3DFilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\yea\WarpSharp.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\yea\.dll")

BaseLayer=AVISource("Menu_VIDEO2.avi")
ColorLayer=ImageSource("c:\download\color_cast.bmp")

#FILM Layer
FILM=BaseLayer.ConvertToRGB24().GiCoCU("C:\download\filmy.amp",photoshop=true)

#Sharpen & Gaussian Blur [Unsharp Mask on Luminance Layer + GB on A/B Channels]
SG=FILM.ConvertToYUY2().unsharpmask(300,2,0).FFT3dFilter(plane=1,bt=1,sharpen=-5).FFT3dFilter(plane=2,bt=1,sharpen=-5)

#Contrast Layer 1 [Dup FILM layer - (70% blue, 10% green, 20% red) Opacity 20%] 
CONT=SG.Levels(5, 1, 255,0, 255)

#Highlight Layer [Dup FILM Layer - Gaussian Blur Radius 5 pixels Layer blend Screen, Opacity 52%] 
HIGH=FILM.Blur(1)

#Detail Layer [Dup FILM layer - Highpass Radius 6 pixels Image/Adjust/Desaturate Layer blend Soft Light, opacity 30%]
DETAIL=FILM.ConvertToYUY2().TweakColor(sat=.5)

#Color Cast [Fill with color cast choice; medium dark green or orange are good Layer blend Soft Light, Opacity 40%. Use lower opacity for less dramatic effect]
COLORCAST=ColorLayer.BicubicResize(720,540)

#Original Blend [Dup base (unmodified) layer. Layer blend normal, opacity 30%. Adjust this opacity to get a balance between contrast and smoothness.]
OBLEND=BaseLayer

#Shadow Pull-up [Layer blend Lighten, Opacity 15% - Base Layer]
SHADOW=BaseLayer.ConvertToRGB24.GiCoCU("C:\download\shadow.amp",photoshop=true)

#Highlight Pull-Down [Layer blend Lighten, Opacity 20% - Base Layer]
HIGHPD=BaseLayer.ConvertToRGB24.GiCoCU("C:\download\highlight.amp",photoshop=true)

#Contrast Layer 2 [Dup FILM Layer - Desaturate by 50% Layer blend Soft Light, Opacity 10%]
CONT2=SG.ConvertToYUY2().TweakColor(sat=.5)

#Return ()

a=Overlay(SG, CONT, mode="Blend", opacity=.4)
b=Overlay(a,HIGH, mode="Add", opacity=0.52)
c=Overlay(b, DETAIL, mode="SoftLight", opacity=.3)
d=Overlay(c, COLORCAST, mode="SoftLight", opacity=.15)
e=Overlay(d, OBLEND, mode="Blend", opacity=.3)
f=Overlay(e, SHADOW, mode="Lighten", opacity=0.15)
g=Overlay(f, HIGHPD, mode="Lighten", opacity=0.2)
h=Overlay(g, CONT2, mode="SoftLight", opacity=0.1)
Overlay(h, BaseLayer, mode="Blend", opacity=0.7)
I'm sure there are a couple methods that can be changed, but this what I can do quickly and have so far.

I couldn't get AVISynth's Tweak to work for me, so I used TweakColor, I rather not use FFT3DFilter but that came to mind when I had to apply blur to UV only. Not sure if it's doing what it's intended, but maybe someone else can help out before the time it taks me to figure some other methods out. Also I'm not sure if the CONT layer is doing what I want it to. Probably not.

I'm pretty satisfied with the result.

Last edited by Backwoods; 28th February 2005 at 06:40.
Backwoods is offline   Reply With Quote
Old 28th February 2005, 13:49   #220  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
looks pretty nice already


on
"#Sharpen & Gaussian Blur [Unsharp Mask on Luminance Layer + GB on A/B Channels]
SG=FILM.ConvertToYUY2().unsharpmask(300,2,0).FFT3dFilter(plane=1,bt=1,sharpen=-5).FFT3dFilter(plane=2,bt=1,sharpen=-5)"
try
"SG=FILM.ConvertToYUY2()
SG=mergeluma(s.unsharpmask(300,2,0))
SG=SG.VariableBlur(2, 2, 2, 3, 3, true, false, true)"
see
http://www.avisynth.org/Merge
http://forum.doom9.org/showthread.php?s=&threadid=88645

"#Contrast Layer 1 [Dup FILM layer - (70% blue, 10% green, 20% red) Opacity 20%]"
won't work without a channel-mixer plug-in which i yet have to write

"#Highlight Layer [Dup FILM Layer - Gaussian Blur Radius 5 pixels Layer blend Screen, Opacity 52%]"
could also be done with VariableBlur, not sure if i'll be better

"#Detail Layer [Dup FILM layer - Highpass Radius 6 pixels Image/Adjust/Desaturate Layer blend Soft Light, opacity 30%]
DETAIL=FILM.ConvertToYUY2().TweakColor(sat=.5)"
doesn't have the highpass filter
i've seen it done with subtracting a blurred version
try something like
"DETAIL=FILM.ConvertToYUY2()
DETAIL=DETAIL.subtract(DETAIL.VariableBlur(6, 6, 3, 3, 3, false, false, false))
DETAIL=DETAIL.TweakColor(sat=.5)""

for
"#Color Cast [Fill with color cast choice; medium dark green or orange are good Layer blend Soft Light, Opacity 40%. Use lower opacity for less dramatic effect]"
see
http://www.avisynth.org/BlankClip

"#Shadow Pull-up [Layer blend Lighten, Opacity 15% - Base Layer]"
and
"#Highlight Pull-Down [Layer blend Lighten, Opacity 20% - Base Layer]"
can't be done that way, because the cuves are for lab colorspace, not rgb
i'll do a L-curve plug-in

"Illumination coloring layer"
is missing
can be done with blankclip and overlay i think

"Grain Layer"
is missing aswell
could be done without an additional layer
by using addgrain on the result IMO

does "overlay" really supports all needed modes and do they work/look like in photoshop??
can you really just overlay images with different colorspaces?


still to do for me are these plug-ins:
channel-mixer & L-curve (& new overlay ?)


posssible improvements / modifications on the procedure:
do artefact removal before the film-look procedure
add grain after it with addgrain
try different sharpeners
.....

Last edited by E-Male; 28th February 2005 at 14:29.
E-Male is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 16:35.


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