Log in

View Full Version : Help with script that can "brighten up" a video


ricardo.santos
3rd May 2009, 12:21
Hi everyone!

I have a 20 minute dv video that i want to convert to dvd, unfortunally even with the ligt compensation option on the video is a bit dark.

Upon reading the forum someone (Smok3) sugested using the HDRAGC plugin for avisynth
http://strony.aster.pl/paviko/hdragc.htm

i read the documentation and managed to bright up the video a little but some grain appears and the colour changes a bit.

This is the avs script i'm using at the moment:
LoadCPlugin("C:\Programas\AviSynth 2.5\plugins\yadif.dll")
DirectShowsource("C:\video.avi")
HDRAGC(max_gain=3)
converttoyv12()
yadif(mode=0)

Can someone help me finding out a better script or perhaps tell me what i'm doing wrong?

heres a 20 second sample from the original dv footage, i've hosted it on mediafire and megaupload in case someone is willing to test it:

http://www.mediafire.com/?tg3im3x4omm
http://www.megaupload.com/?d=9P3TVVRT

here's a split screenshot between the edited video and the original, it gets "blue-ish" and grainy on the edited video:
http://img361.imageshack.us/img361/6313/darkz.jpg (http://img361.imageshack.us/my.php?image=darkz.jpg)

Thanks

Who Am I ?
3rd May 2009, 14:47
Colormill would probably be your most versatile and gui-ish option to decide on the color's/brightness .

Its a virtualdubmod filter so yeah you might have to get it to get colormill working .

As how to use colormill in avisynth , look here : http://forum.doom9.org/showthread.php?p=919833#post919833

source :
http://www.grinshare.com/img/OZT16L.jpg (http://www.grinshare.com/)

touched :
http://www.grinshare.com/img/EWESH5.jpg (http://www.grinshare.com/)

source :
http://www.grinshare.com/img/AZ4V3I.jpg (http://www.grinshare.com/)

touched interlaced :
http://www.grinshare.com/img/1BX4PN.jpg (http://www.grinshare.com/)

touched simple field bob (vdm):
http://www.grinshare.com/img/2ZHDUA.jpg (http://www.grinshare.com/)

http://www.grinshare.com/img/HVD1Q7.jpg (http://www.grinshare.com/)

http://www.grinshare.com/img/MOW3JX.jpg (http://www.grinshare.com/)

colormill(25700, 25700, 25700, 25700, 18532, 40843, 25700, 25444, 24925, 26460, 121, 5)

is what I used in avisynth , I know it still has a blue-ish tint and smearing/tearing is present , just gave it a fast shot , you'd be rather able to get much better results if you spend some time on getting the right values and denoised/cleaned the video a bit .

Also deinterlacing/bobbing or not is completely a desicion upto you , your video already has pal attrbutes ( 720 x 576 for the resolution and 25 fps frame rate ) , if you have a progressive scan dvd played on which you want to play it , I'd rather suggest you not to deinterlace as it is also contributing to loss off details on already such a dark video also because your player would take care off the interlacing lines .

Just tweak the color's and make it mpeg2 dvd compliant and your good to go :rolleyes:

P.s : not taking anything away from agc as well , i'm a big fan off that as well and paviko deserve's props for the work he's done on that as well , eventually comes down to different sources needing different treatments i guess ..

ricardo.santos
3rd May 2009, 19:35
Thanks Who am i for the tips and advices.

I'm not an expert on avisynth/virtualdub (just basics), will try and tweak your values and see what i can come up with.

I would prefer to have a progressive output but i can always export to a lossless format interlaced if it helps editing the video and then deinterlace when converting to mpeg2/dvd, right?

Anyone has other suggestions? How to remove the "blue-ish" effect? Even if it takes a long time processing the video as the footage is important.

Thanks

communist
3rd May 2009, 20:34
Anyone has other suggestions? How to remove the "blue-ish" effect? Even if it takes a long time processing the video as the footage is important.
It still looks very gray and washed out - but how else to get it brighter? It is very dark to begin with ;)
Play with the gamma and saturation ( Tweak(sat=1.3) ).
Import("D:\CC\MC_Spuds.avs")
AVISource("D:\Copy of test_doom9.avi")
LeakkernelBob(0,0)
HDRAGC(max_gain=1.7,max_sat=2)
mc_spuds(frames=2,strength=4)
FFT3DFilter(sigma=25.0,plane=3)
SeparateFields.SelectEvery(4,0,3).Weave()
Levels(2, 0.90, 255, 0, 255)

Before:
http://img168.imageshack.us/img168/5168/before.th.png (http://img168.imageshack.us/my.php?image=before.png)
After:
http://img127.imageshack.us/img127/1595/after.th.png (http://img127.imageshack.us/my.php?image=after.png)

Who Am I ?
4th May 2009, 11:37
It still looks very gray and washed out - but how else to get it brighter? It is very dark to begin with ;)
Play with the gamma and saturation ( Tweak(sat=1.3) ).

Before:
http://img168.imageshack.us/img168/5168/before.th.png (http://img168.imageshack.us/my.php?image=before.png)
After:
http://img127.imageshack.us/img127/1595/after.th.png (http://img127.imageshack.us/my.php?image=after.png)

you've hit the nail right on the head , but agc , spuds and holy christ fft3d at sigma off 25 = extensive filtering which works :p , i never cleaned it as i was in a hurry , btw you held back on brightening much isnt it ?

bobbing this is probably the fastest and least detail losing way , deinterlacing or other stuff loses a lot more details .

hope the guy encoding has a good enough pc for the cpu clocks this is going to need

@ ricardo , rather then deinterlacing , you could also leave it interlaced itself if your dvd player can progressive scan ( almost all off them do ) , it will take care off it itself , so you save on encoding time , plus the details remain intact .

Sagekilla
4th May 2009, 14:09
I would do some chroma denoising first as that's (for me) the most annoying kind of noise. Then do your HDRAGC, and any other luma denoising.

Blue_MiSfit
4th May 2009, 19:09
I would do some chroma denoising first as that's (for me) the most annoying kind of noise. Then do your HDRAGC, and any other luma denoising.


+1

Chroma noise == :(

Not sure if MC_Spuds is really necessary!!!

Also, don't deinterlace if you're going to make a DVD from this.

~MiSfit

ricardo.santos
9th May 2009, 12:31
Hi everyone! Been busy so i havent been able to give feedback but weekend is here and im testing all your advices, i thought i could do this without further help but i'm having trouble using the script provided by the communist

@Communist
I received some errors so i went googling and found some plugins i needed but now i have this error message

"there is no function named "mt_binarize" (mc_spudes.avs line 92)

cant get past this, i erase thatt line and then i get 5 more error messages.

I aprreciate all your help but can you zip all the filters needed to make this script work?

@Who am i
I wont deinterlace, about the encoding times...i have a friends quad core for this so i think it will reduce the encoding time a little. you said you didnt have any time to perfect the script but if you can im still interested in your suggestions.

@Sagekilla and Blue_MiSfit
Thanks for your input but can you give me some examples, im not an expert with avisynth

communist
9th May 2009, 18:46
@Communist
I received some errors so i went googling and found some plugins i needed but now i have this error message

"there is no function named "mt_binarize" (mc_spudes.avs line 92)

cant get past this, i erase thatt line and then i get 5 more error messages.

You need Masktools v2. Get em here:
http://forum.doom9.org/showthread.php?t=98985

MadRat
10th May 2009, 04:07
Did you try using autolevels.dll? It works really well but I don't yet know how to configure it so it will recognize where a fade in or fade out is. If autolevels finds a fade it'll try to compensate for it and turn the screen white.

ricardo.santos
11th May 2009, 18:44
Thanks everyone for your advices, it took a bit to get all the filters lol, im faced now with the task of encoding the video, i now know what you guys meant by "it will take long", i just tried encoding with Quenc and it will take 20 hours (on a quadcore) WOW to encode 20 minutes.

my "quest" continues here:
http://forum.doom9.org/showthread.php?t=147003

Once again Thanks for your help