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 28th February 2005, 15:09   #221  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
channel-mixer plug-in
http://e-rels.dyndns.org/downloads/chanmix.rar
chanmix(float r, float g, float b)
E-Male is offline   Reply With Quote
Old 28th February 2005, 15:15   #222  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,337
It should be forbidden to release stuff without documentation What does channel-mixer do?
Wilbert is offline   Reply With Quote
Old 28th February 2005, 15:40   #223  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
i thought it was obviouse from the previouse posts and the photoshop guide

it creates a greyscale image from a rgb24 source, the 3 paramaters specify how much of each color-channel is used

gray = (red*r + green*g + blue*b) / (r+g+b)

i hope this resembles the photoshop feature well
E-Male is offline   Reply With Quote
Old 28th February 2005, 16:04   #224  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
i just noticed that the "Illumination coloring layer" can be done with blankclip and overlay

so i'll focus on the other 2 plug-ins
i think i can finish them today
E-Male is offline   Reply With Quote
Old 28th February 2005, 23:52   #225  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
Quote:
Originally posted by E-Male
"Illumination coloring layer"
is missing
can be done with blankclip and overlay i think


Personally I didn't care for that so I left it out when I did the method in Photoshop, if you could figure it out in AVISynth, that'd be good for others.

Quote:
"Grain Layer"
is missing aswell
could be done without an additional layer
by using addgrain on the result IMO
Another I left out because I felt it wasn't needed and enough grain was made from the sharpening.

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

Quote:
still to do for me are these plug-ins:
channel-mixer & L-curve (& new overlay ?)
I'll try your plugin tonight.

Quote:
posssible improvements / modifications on the procedure:
do artefact removal before the film-look procedure
add grain after it with addgrain
try different sharpeners
.....
I was thinking of a deblocker too, grain again I'm iffy on but I will try it in the script, and I'm pretty happy with the sharpener now but again there is always room to play around.

Also the blankclip and color I'll do tonight also.

As is though, the script emulates what I did in PS just about to the T. Anything from here on is improving on the original method, IMO.
Backwoods is offline   Reply With Quote
Old 1st March 2005, 01:20   #226  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
This crashes VDub when advancing one frame when replacing DETAIL, AVISynth didn't know what DETAIL meant on that line:
DETAIL=FILM.ConvertToYUY2()
DETAIL=DETAIL.subtract(DETAIL.VariableBlur(6, 6, 3, 3, 3, false, false, false))
DETAIL=DETAIL.TweakColor(sat=.5)""

And can you give an example line for your channer mixer?
Backwoods is offline   Reply With Quote
Old 1st March 2005, 06:01   #227  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
please tell me the exact error msg, especially which line/column (if it's mentioned)

#Contrast Layer 1 [Dup FILM layer - (70% blue, 10% green, 20% red) Opacity 20%]
CONT=SG.chanmix(20,10,70)
E-Male is offline   Reply With Quote
Old 13th March 2005, 01:10   #228  |  Link
Guest
Guest
 
Posts: n/a
Is the link down atm?

Great stuff you are doing E-Male!!

Tin2tin
  Reply With Quote
Old 13th March 2005, 22:11   #229  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
my pc didn't stay online over the weekend while i was away
soon i'll have a router that'll fix this
file should be up agai
E-Male is offline   Reply With Quote
Old 14th March 2005, 06:28   #230  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
[V2F] Video2Film

Sony HD cam - Left Original, Right Filtered


Sony HD cam - Left Original, Right Filtered


Sony DV cam - Left Filtered, Right Original


Changes:
Invert for Highpass
No gaussian blur (wasn't happy with the end result)
No blurring of UV channels (didn't seem to matter in the end)
Blankclip() instead of loading BMPs
Added some color values at the bottom of the script for reference
AddGrain (in script for whoever wants to use it)

ToDo:
Use Tweak instead of Tweak color.

What command would be for Saturation? Something so simple escapes me, but I can recreate this Photoshop method easily.


Code:

#[V2F] Video2Film
LoadPlugin("DGDecode.dll")
LoadPlugin("Decomb521.dll")
LoadPlugin("GiCoCU.dll")
LoadPlugin("TweakColor.dll")
LoadPlugin("FFT3DFilter.dll")
LoadPlugin("WarpSharp.dll")
LoadPlugin("AddGrain.dll")
LoadPlugin("Chanmix.dll")

BaseLayer=AVISource("...")#.FieldDeinterlace(blend=false).Lanczos4Resize(720,360)
BaseLayer=MPEG2Source("...")#.FieldDeinterlace(blend=false).Lanczos4Resize(720,360)

#FILM Layer
FILM=BaseLayer.ConvertToRGB24().GiCoCU("film.amp",photoshop=true)

#Sharpen & Gaussian Blur [Unsharp Mask on Luminance Layer + GB on A/B Channels]
SG=FILM.ConvertToYUY2().unsharpmask(400,2,0)

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

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

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

#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=BlankClip(width=720,height=360,color=$C0C0C0)

#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("shadow.amp",photoshop=true)

#Highlight Pull-Down [Layer blend Lighten, Opacity 20% - Base Layer]
HIGHPD=BaseLayer.ConvertToRGB24.GiCoCU("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)

a=Overlay(SG, CONT, mode="Blend", opacity=.2)
b=Overlay(a,HIGH, mode="Add", opacity=0.52)
c=Overlay(b, DETAIL, mode="SoftLight", opacity=.3)
d=Overlay(c, COLORCAST, mode="SoftLight", opacity=.3)
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)
LAST=Overlay(h, BaseLayer, mode="Blend", opacity=0.8)

FINAL=LAST.AddBorders(0,60,0,60)

Return(FINAL)

#ConvertToYV12()
#AddGrain(18,0,0)

#ColorCast Color Values
#blue,medium = 4F4FBD
#blue,dark = 03036B
#blue,pure = 0000FF
#green,medium = 2E703F,22AC1C
#grey,light = C0C0C0
#grey,dark = 808080
#orange,light = F7D6730
#purple, medium = AC4FBD
#red,light = FF4646
#red, medium = A60505
#red, dark = 890101
Backwoods is offline   Reply With Quote
Old 5th April 2005, 08:39   #231  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
Join Date: Mar 2005
Posts: 365
DVX-100A Gamma Curves Chart for inspiration:
Kino-eye
Have fun,
Tin3tin
tin3tin is offline   Reply With Quote
Old 16th April 2005, 14:39   #232  |  Link
onesoul
miau
 
onesoul's Avatar
 
Join Date: May 2002
Location: Lisbon
Posts: 594
Awesome work that is been done here, definitely worthy of going to avisynth shared functions.
__________________
"... but where are those missing pieces of eternal soul, I can feel them but I can't reach them with my vision"
Petition for a software patent free Europe
Another vision of what happened at 9/11
onesoul is offline   Reply With Quote
Old 16th April 2005, 21:21   #233  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
but not before it's finished
E-Male is offline   Reply With Quote
Old 16th April 2005, 23:20   #234  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
Using Overlay really kills the speed of this process. If that was sped up or if a plugin that can do Overlay faster is made, that would be very productive. Now it doesn't seem to matter what you do to each layer, the resolution, or such...it still runs about the same speed.

Since my last post I did a couple changes to the script. I'm always using it and playing with it, so maybe so I'll post that update. I rather have a speed increase to show off. Maybe I should look into MaskTools...don't know as of now.
Backwoods is offline   Reply With Quote
Old 17th April 2005, 08:46   #235  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
yv12lutxy may be what you need. the syntax is a brain-killer though (reverse polish i think it's called). easy when you get the hang of it though.
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 17th April 2005, 12:04   #236  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
that syntax isn't that hard once you got the basics

IIRC there are 2-3 plug-ins missing
i'll do that when i got time

i'll also look into a correct overlay function, that includes all the photoshop modes we need
let's see how fast/slow i can make it
E-Male is offline   Reply With Quote
Old 17th April 2005, 19:01   #237  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
Instead of using overlay use merge:

function merge(clip a,clip b,float "opacity"){
opacity=default(opacity,0.5)
return a.MergeLuma(b,opacity).MergeChroma(b,opacity)
}

It is also faster than it's yv12overlay counterpart:

function yv12overlay(clip a,clip b,float "opacity")
{
aExp="x "+string(opacity)+" * y 1 "+string(opacity)+" - * +"
return yv12lutxy(a,b,yexpr=aExp,uexpr=aExp,vexpr=aExp)
}

Take a look at this thread for actual tested results:

http://forum.doom9.org/showthread.php?s=&threadid=82127


Regards,
joshbm
__________________
Tired of waiting for video encodes? Get a totally new P4 Desktop Computer for FREE.
joshbm is offline   Reply With Quote
Old 17th April 2005, 19:23   #238  |  Link
E-Male
mad computer-scientist
 
Join Date: Mar 2002
Posts: 1,375
erm, we don't need a simple 50:50 mix
we need different algos
E-Male is offline   Reply With Quote
Old 17th April 2005, 22:26   #239  |  Link
Backwoods
ReMember
 
Backwoods's Avatar
 
Join Date: Nov 2003
Posts: 416
-I'll look into merge, yv12overlay, and yv12lutxy today.

-Gaussian Blur is working with a script

-Need to see if it's possible to apply a filter to UV and not the Y channel without using FFT3DFilter

-Overlay's functions mimic Photoshop's exactly. Just with different names. I did comparisons.

Other than that, I forget what else I changed. I'll do some speed tests and post samples tonight or tomorrow. Thanks for the suggestions.
Backwoods is offline   Reply With Quote
Old 17th April 2005, 22:47   #240  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,394
> we need different algos

... and you can put together just anything through yv12lutxy.


Backwoods:

You're doing 11 (eleven) Overlay()'s in a row. I can imagine speed is no big fun with that script.
Using LUTs from MaskTools would increase the speed quite a bit. Plus, the overlay of "colorcast" would not be needed, as it could be packed into the preceeding "detail" overlay.

BTW, you're generating three clips from "baselayer", and do ConvertToRGB24()all three times. One time would be enough:

> baselayer24 = baselayer.ConvertToRGB24()
> FILM=BaseLayer24.GiCoCU("film.amp",photoshop=true)
> SHADOW=BaseLayer24.GiCoCU("shadow.amp",photoshop=true)
> HIGHPD=BaseLayer24.GiCoCU("highlight.amp",photoshop=true)

In similar manner, you could avoid one of those FILM.ConvertToYUY2() that are done two times.


Overall, there are pretty much colorspace conversions going on. Cutting them down as far as possible, and doing all the processing with LUTs, speed should get in acceptable range.

If only you all would come up with some processing description more specific than "PhotoShop Filter XYZ" ...


edit: only thing that can *not* be done with yv12lut/xy is that weird "Hardlight" overlay of Photoshop (with transporting luma over/underflows to the chroma planes), since "inter-plane" operations are not available.

I never understood why PS uses that weird sort of Hardlight'ing. Why not use a clean algo that floors down at 0 resp. 255 ...
For me it's a strange dogma that something is "right", only because Photoshop is doing somthing just as it does
__________________
- 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!)

Last edited by Didée; 17th April 2005 at 22:57.
Didée 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 06:06.


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