astarte: (Vidding - I vid)
Add MemoryShare This Entry
posted by [personal profile] astarte at 10:31am on 07/01/2008 under
So I promised doing this for [livejournal.com profile] giandujakiss and hope it can be useful for others as well.

First of all I’m not an Avisynth expert, there might be simpler, better and more straight forward ways to get these masks and changes done. This is my method. It works for me, but feel free to change stuff or tell me what you would do differently.

Second there are more tech oriented guides out there and I believe also several updates to the software versions offered as AMVapp. I would recommend to read AMVapp intro carefully to get the necessary software and understand how it basically works. It might be a long read, but it will pay off even if it probably doesn’t make much sense at first, you will get there. There is also a lot of information gathered at Avisynth.org and for the newest developments and filters it’s always good to take a look at doom9 avisynth forums.

Third I use avisynth in Premiere 6.5 because I don’t need to reencode footage this way and can use my original vob-, mkv- and avi-files. It might not work in other applications or upgrades. I know that there is a way to make it work in Vegas, but this is something you need to look into for yourself. I will not go into how to prepare your DVD footage for Premiere or get rid of the watermark in downloaded files. If there is any interest I will do a short one on the watermarks, but otherwise you will find all the info in the above links.

Because this tutorial is about the result you get from your editing software, everybody should be able to try it.

So you edited a video, it’s finished and ready to be published, although it looks a bit boring and you want to enhance it. What I do now is exporting my video from Premiere as Huffyuv v2.1.1 – CCESP Patch v0.2.5 – Huffy is a fast, lossless codec that gives you your footage 1:1 without any loss in quality as an output. The file you get is around 1,5 GB – 2,5 GB for a three minute music vid. It’s huge, but also top-quality or as good as your input was. I do this for years, previously only to get a good input for my various web encoders, but now we will play with this specific file in avisynth.

First get AvsP – It is an avisynth text editor with fancy stuff like sidebars for easy manipulation and an excellent preview function. This preview function will be your friend soon enough and F5 was never more interesting. So you drag and drop your avi-file there and get something like that:

AVISource("C:\Your.avi")

If you preview you see that it is your file 1:1. But we will do some tweaking soon, so you better change the colourspace before you offend your filter.

AVISource("C:\Your.avi")
ConvertToYUY2

If you preview nothing interesting has happened at least not for your eye, so lets change that.

AVISource("C:\Your.avi")
ConvertToYUY2
clip1 = AVISource("C:\Your.avi")
Overlay(clip1, opacity=0.25, mode="add")

Things got brighter. We made an overlay of the original source.

There are countless way to achieve brighter footage in avisynth – level, contrast, brightness -, but I figured I introduce this overlay method early on. Anyone familiar with graphic programs like Photoshop or even the overlay function in Premiere will be familiar with the modes shown in the sidebar next to your preview. Changing the opacity and modes for fun and you get the principle behind an overlay. So moving on:

AVISource("C:\Your.avi")
ConvertToYUY2
clip1 = AVISource("C:\Your.avi")
Overlay(clip1, opacity=0.25, mode="add")
farbe1 = ImageReader("C:\Maske.bmp", start=1, end=4358, fps=25)
Overlay(farbe1, opacity=0.1, mode="hardlight")

I overlayed this bmp-picture here. It’s a colour gradient mask I made in PS and thought would look good on top. Of course you can go wild here, even use textures you would normally use in PS or general go over the top. I just wanted to fade the edges a bit and make the emphasis on the middle.
I vid with PAL DVDs, so my framrate is 25 frames per second or fps=25, change these to your own framerate. The start and end just does exactly that. So you could in theory make different overlays on different parts of your vid.

Now let me introduce you to a denoiser I use dfttest. You need to install it in your windows library, so we need to load the plug-in from there. Avisynth recognises plug-ins and filters in its own library, so you usually don’t need to use LoadPlugin, if you stuff your filters into the plugin folder of Avisynth. But like I said, this denoiser needs to be in the windows library so we do:

LoadPlugin("C:\Windows\dfttest.dll")
AVISource("C:\Your.avi")
ConvertToYUY2
clip1 = AVISource("C:\Your.avi")
Overlay(clip1, opacity=0.25, mode="add")
farbe1 = ImageReader("C:\Maske.bmp", start=1, end=4358, fps=25)
Overlay(farbe1, opacity=0.1, mode="hardlight")
dfttest(sigma=1.00)

Everything looks smoother now, play a bit around with stigma for example sigma=1.5 and you get a good idea what it does. Denoiser makes things smoother, you only have to be careful so you don’t lose details. So hopefully we get rid of unnecessary noise, which will help you make small file sizes for web download. Like always playing around with stuff is your friend in Avisynth, especially when it is so easy as in AvsP, so do it. Because we now come to the part, where I love to do it. I introduce proudly the tweak function. Hah!

LoadPlugin("C:\Windows\dfttest.dll")
AVISource("C:\Your.avi")
ConvertToYUY2
clip1 = AVISource("C:\Your.avi")
Overlay(clip1, opacity=0.25, mode="add")
farbe1 = ImageReader("C:\Maske.bmp", start=1, end=4358, fps=25)
Overlay(farbe1, opacity=0.1, mode="hardlight")
dfttest(sigma=1.0)
tweak(sat=1.15, bright=-5, cont=1.25, hue=0, coring=false)

So again with the sidebar on your preview – tweak has a lot of additional functions like hue and stuff, but if you click on tweak you see the one you have chosen. Now play wildly with the bars and you will understand what each of these does. Or you can gain from your graphic knowledge. Saturation makes or breaks the colour in your vid. Brightness makes is darker or you guessed correctly brighter. Contrast does exactly that. Hue is included as example – 0 does nothing, but again you can play around. Why I added coring escapes me at the moment, so I guess it is not so important, usually it is true, if you don’t add the function like I did.

Tweak is your friend, play with it. It’s fun.

LoadPlugin("C:\Windows\dfttest.dll")
AVISource("C:\Your.avi")
ConvertToYUY2
clip1 = AVISource("C:\Your.avi")
Overlay(clip1, opacity=0.25, mode="add")
farbe1 = ImageReader("C:\Maske.bmp", start=1, end=4358, fps=25)
Overlay(farbe1, opacity=0.1, mode="hardlight")
dfttest(sigma=1.0)
tweak(sat=1.15, bright=-5, cont=1.25, hue=0, coring=false)
temporalcleaner()

With temporalcleaner() we add another denoiser, the standard one. You should have it already in your plugin folder. As mentioned previously denoiser make things smoother.

LoadPlugin("C:\Windows\dfttest.dll")
AVISource("C:\Your.avi")
ConvertToYUY2
clip1 = AVISource("C:\Your.avi")
Overlay(clip1, opacity=0.25, mode="add")
farbe1 = ImageReader("C:\Maske.bmp", start=1, end=4358, fps=25)
Overlay(farbe1, opacity=0.1, mode="hardlight")
dfttest(sigma=1.0)
tweak(sat=1.15, bright=-5, cont=1.25, hue=0, coring=false)
temporalcleaner()
MSharpen(strength=45)

We want some sharpness back without the noise, so we do that with MSharpen, strength indicates what it says so change it a bit so see what it does.

LoadPlugin("C:\Windows\dfttest.dll")
AVISource("C:\Your.avi")
ConvertToYUY2
clip1 = AVISource("C:\Your.avi")
Overlay(clip1, opacity=0.25, mode="add")
farbe1 = ImageReader("C:\Maske.bmp", start=1, end=4358, fps=25)
Overlay(farbe1, opacity=0.1, mode="hardlight")
dfttest(sigma=1.0)
tweak(sat=1.15, bright=-5, cont=1.25, hue=0, coring=false)
temporalcleaner()
MSharpen(strength=45)
Crop(0, 0, -2, -2)
LanczosResize(720,400)

The next step is easily done – go to Video -> Crop editor.

With DVDs you usually have a small black bar on the sides or on top or bottom of your footage. Most noticeable is the lack of it if you zoom into it a scene and it suddenly disappears. We want to get rid off it. So go to a frame especially bright and do exactly that. (The crop function is awesome if you edit movies and the footage is 2,40:1 and you have the black bars on top and bottom, so do this step ahead if you are doing a movie vid and your editor accepts avs-files.)

Then resize it to your original size or anything you want it to be with LanczosResize(720,400)

LoadPlugin("C:\Windows\dfttest.dll")
AVISource("C:\Your.avi")
ConvertToYUY2
clip1 = AVISource("C:\Your.avi")
Overlay(clip1, opacity=0.25, mode="add")
farbe1 = ImageReader("C:\Maske.bmp", start=1, end=4358, fps=25)
Overlay(farbe1, opacity=0.1, mode="hardlight")
dfttest(sigma=1.0)
tweak(sat=1.15, bright=-5, cont=1.25, hue=0, coring=false)
temporalcleaner()
MSharpen(strength=45)
Crop(0, 0, -2, -2)
LanczosResize(720,400)
water = ImageReader("C:\signature.jpg", start=1, end=4358, fps=25)
Overlay(water, opacity=0.6, mode="add")

Now I only added my watermark with this two lines. Again you should be by now familiar with the overlay function.

We are now finished with the script, but what to do with it? If you installed the AMVapp you get VirtualDubMod. Open the program go File -> open video file via Avisynth. Now go to Video -> Compression and select Huffy again, press okay. Go to File -> Save as… Select a appreciate name – something like yourfile-filter.avi. Don’t overwrite your original avi-file.

With all the filters it can take some time for VirtualDubMod to process your file, usually it takes half an hour for me, but that solely depends on your processor. Once you have the Huffy put it through your web encoder like AutoGK or DivX Converter. I use the later with the setting to Home Theater and nothing changed from the original settings and get files around 30 MBs for a three minute vid. So drag & drop again and convert.

Like I said I’m not an expert, but if you have questions I try my best to answer them and I hope this was helpful for Avisynth novices and people who already worked with the program.
Mood:: 'geeky' geeky
There are 34 comments on this entry. (Reply.)
 
posted by [identity profile] xandra-ptv.livejournal.com at 09:33am on 07/01/2008
i felt the need to comment first. and my icon shows clearly how i feel about the subject.
 
posted by [identity profile] astartexx.livejournal.com at 09:40am on 07/01/2008
Or about my non-evil ways. Damn.
 
posted by [identity profile] xandra-ptv.livejournal.com at 10:09am on 07/01/2008
don't worry you made up for it tonight.
 
posted by [identity profile] astartexx.livejournal.com at 10:20am on 07/01/2008
I always make it up to you - That's one of the countless reasons, why you love me in the first place!
 
posted by [identity profile] xandra-ptv.livejournal.com at 11:58pm on 13/01/2008
i hate you so much, i actually know the basics of this now. its all your fault.
 
posted by [identity profile] astartexx.livejournal.com at 09:23pm on 15/01/2008
Oh you don't hate me, you just hate the fact that you kinda getting my point now. See my victory dance... *salsa*

And sorry about Saturday, I lost my connection and didn't realize it for hours and when I did, restarting the router and the ten minute wait were more than I could bear so I fell into bed with a guilty conscience!

 
posted by [identity profile] xandra-ptv.livejournal.com at 09:41pm on 15/01/2008
i learned to do the watermark thing. and you signed off just as i had a test export for you.
 
posted by [identity profile] astartexx.livejournal.com at 06:20pm on 16/01/2008
We'll do our joined vidding sessions this weekend, love, without tech issues... Oh, oh, one thing? I found a way to fix the premiere crashes:

mpeg2source("F:\TXF Rip\Index\txf4x13-4x16.d2v",cpu=4) ++ mpeg2source("F:\TXF Rip\Index\txf4x17-4x20.d2v",cpu=4) ++ mpeg2source("F:\TXF Rip\Index\txf4x21-4x24.d2v",cpu=4)
Telecide(order=1,guide=2)
Crop(8,72,-8,-72)
LanczosResize(720,596)
ConvertToRGB32()

Any idea what this particular script does, besides resizing to 16:9, fixing the interlacing issues and changing the colourspace? It gets you half a season of XF and my crashes suddenly are history.

I had to replace the old avs in the project, but it was worth the trial, even when scanning through the preview with 9+ hours is a bitch, I don't need to export segments any longer...

I so love gathering random avisynth-knowlege, because you always know you're just a line away from getting things fixed!
ext_7850: by ev_vy (vidder malfunction)
posted by [identity profile] giandujakiss.livejournal.com at 09:38am on 07/01/2008
I love you so much!!

It'll take me a while to absorb all this, but thank you!
 
posted by [identity profile] astartexx.livejournal.com at 10:16am on 07/01/2008
Heh. Doing the tut was cool - I hope this will demystifies avisynth for you.

AvsP is a great program to get into the basics and you see an instant result in the preview and tracking along the timeline. So it is fun and only half theory there.
 
posted by [identity profile] buffyann.livejournal.com at 12:53pm on 07/01/2008
Thanks very much. I had just recently started to work with AviSynth and didn't worked on PostProcessing yet so a simple first access to this is very much welcome :) Thanks !

if anyone interested in AviSynth with Vegas, the trick is to use VFAPI to "convert" the avisynth script into an avi file that trick Vegas into believing it's an avi file.
The down side being that everytime you update your avs script, you need to generate a new avi file with VFAPI.
I've tried that in my recent projects and it works. :)
 
posted by [identity profile] astartexx.livejournal.com at 02:00pm on 07/01/2008
I vidded with avisynth-files for almost two years and I still gathered most of this information just over the last three months. I tried to include the most useful and common solutions for problems here.

I truly hope this is helpful and I’m happy you thought it was a simple first access, because I had mostly vidders in mind, who didn’t work with avisynth till now or were afraid to use it. The scripts can be intimidating at first, especially if they don’t work because you forgot a comma or such minor mistake.
 
posted by [identity profile] buffyann.livejournal.com at 03:24pm on 07/01/2008
I'm in the computer science so scripts aren't intimadating to me ;) but what every option and code means as a result is a bit confusing at first, especially when you don't see an immediate result in your vid.
So it's cool to have access to a few options you can try out and a script example and then you can go on and find more precise info once you get much more confortable with it :)
 
posted by [identity profile] astartexx.livejournal.com at 04:26pm on 07/01/2008
Yeah, this is one reason why I fell in love with AsvP - it’s preview. You see the script, the actual picture and therefore the changes when you press F5. In addition to the sidebars which make tweaking around so much easier. Instead of slowly increase your effect you can just slide along with it and stop at the point you want to get to. And also browse through the timeline to see if the effect looks good on different scenes.

I think with that program people aren’t just copy & paste this script and instead work it to their own preferences and change stuff quickly to their liking or get rid off the effects they don’t need or want. Because it is so easy compared to when I started out and had to start up my media player to actually see a tweak.
 
posted by [identity profile] countessmary.livejournal.com at 04:02pm on 07/01/2008
I shall have to save this and use it when I go home tonight. i'm just about finished with a vidlet... even just the overlay stuff will be good for it I think... especially because it's a light and fluffy vid. :) Thanks. This is AWESOME!~
 
posted by [identity profile] astartexx.livejournal.com at 04:30pm on 07/01/2008
Hah. Perfect timing for you, Mary, what more can I ask for. Have fun tweaking around with it and I hope this will still make sense once you actually open AvsP. But I’m confident. And of course you’re welcome, I aim to please.
 
posted by [identity profile] countessmary.livejournal.com at 03:33am on 26/02/2008
Okay... I'm just getting around to using this bit for real... Um. dfttest? I love you! That's just freakishly brilliant. Thanks!
 
posted by [identity profile] astartexx.livejournal.com at 06:03pm on 26/02/2008
Heh. I felt the same way discovering it - It makes everything so shiny and clear. So much love for this filter, one of my favourites.
amalthia: (Default)
posted by [personal profile] amalthia at 07:06pm on 07/01/2008
thanks for posting this. :) I've been playing around with avs scriptings for awhile but never could quite figure out if I really need it and how best to use it.
 
posted by [identity profile] astartexx.livejournal.com at 01:31am on 08/01/2008
Playing is the best approach to avisynth, you will learn the most and get comfortable with the scripts in no time. And I would say, that post-processing in avisynth will always add to a vid, even if it’s such a minor change in contrast and saturation. It will look better and the denoiser improve the picture quality in my opinion immensely.
amalthia: (Default)
posted by [personal profile] amalthia at 02:55am on 08/01/2008
I have noticed the quality of your vids but never could figure out what it was you were doing. :) Will have to experiment with my next vid and try this stuff out. You're right the more you play with the scripting the easier it gets.

today I did a lot of reading about filters and plugins and saved links. :)
 
posted by [identity profile] astartexx.livejournal.com at 12:15am on 09/01/2008
With this tutorial most of my secrets are out of the closet – I have to get back in my dungeon to figure out new ways to improve the quality further. Heh.

And a big fat yes to the playful approach. If you just let yourself run loose for a few hours, you’ll understand the basics and what each function does in a way that doesn’t drive you up the wall. Opposite to trying to puzzle something specific out and not getting the expected result, which is just frustrating and you’re tempted to never open another script again. Especially if you start out with avisynth. That happened to me four years ago and I didn't touch the program for the following two years. Seems ridiculous in retrospect.
 
posted by [identity profile] millylicious.livejournal.com at 12:04am on 08/01/2008
Bookmarking this for future reference. Thank you!
 
posted by [identity profile] astartexx.livejournal.com at 01:33am on 08/01/2008
No problem! Hope this will be useful.
amalthia: (Default)
posted by [personal profile] amalthia at 05:06am on 08/01/2008
I deleted last comment because well somehow or another it started working. I guess copying and pasting was all it needed?
 
posted by [identity profile] astartexx.livejournal.com at 12:17am on 09/01/2008
Sometimes this does the trick... *laughs*
 
posted by [identity profile] speakfree.livejournal.com at 09:42pm on 19/03/2008
This is fantastic! Premiere's giving me problems with my avi's. And this tut and the link to that forum is helping a lot, thanks! ♥
 
posted by [identity profile] astartexx.livejournal.com at 09:11am on 31/03/2008
You’re very welcome, I’m happy I could clear some problems up and point in the right direction for others.
 
posted by [identity profile] lcsbanana.livejournal.com at 02:12am on 25/03/2008
okay, this has not only been awesomely helpful and led me to conquer my fear of avisynth, but it also indirectly led me to realize that i've been exporting wrong from Premiere ALL THIS TIME and that's why my video looks like (comparative) shit. and now it is fixed! so, you know, thanks for that :DDDD
 
posted by [identity profile] astartexx.livejournal.com at 09:41am on 31/03/2008
You’re very, very welcome and yay for more shiny videos. And yeah, there are so many ways to export a video, but Huffy is the easiest and best for me. Especially since it is easier to compress into a useable format and you always have the option of reencoding it to a newer codec later on, if you keep the Huffy file.
ext_7843: (Default)
posted by [identity profile] untrue-accounts.livejournal.com at 01:48pm on 26/11/2008
Thank you for putting all this together! I found it really helpful.
 
posted by [identity profile] astartexx.livejournal.com at 06:30pm on 26/11/2008
You’re welcome and so glad that I could be of some help.
ext_16275: (Sherlock Holmes - Watson Sunburst)
posted by [identity profile] legoline.livejournal.com at 08:55pm on 13/12/2011
Thank you so much! A few of these things didn't work for me in AsvP (temporalcleaner and MSharpen; it couldn't find the plugins) but still, very helpful. I successfully adjusted brightness and saturation in Avisynth--that's a win in my book!
 
posted by [identity profile] astartexx.livejournal.com at 03:54pm on 15/12/2011
I think these were included in AMVapp. But try this page (http://avisynth.org/warpenterprises/) - I don't know, if it's still maintained, but it has a nice filter collection going. If it doesn't work, I can zip you the plugins and upload them. Another good filter collection is stored here (http://avisynth.org/mediawiki/External_filters) on the avisynth wiki (http://avisynth.org/mediawiki/Main_Page) and is therefore updated regulary.

And I'm so happy you did find the tut useful.

Links

December

SunMonTueWedThuFriSat
        1 2
 
3
 
4
 
5 6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18 19
 
20 21
 
22
 
23
 
24
 
25 26
 
27
 
28
 
29
 
30
 
31