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 12th December 2002, 13:27   #1  |  Link
zyrill
Registered User
 
Join Date: Jan 2002
Location: Germany
Posts: 83
Anti-Flicker Filter

Hi everyone!

Since i am encountering an extremely fluctuating brightness in a film i need to encode i have asked myself if there was any avisynth-filter dealing with this problem. since i found none i'm presuming there are none.
Now, i have thought about coding an own one but since my knowledge of programming is rather inferior (only php, delphi and stuff like that), i came to ask for someone to either write one or help me create one. As i do not have the slightest idea of what an algorithm to compare the brightness of frames (and to correct it) could look like i'd really like somebody to fill this gap. Every possibility i tried so far would raise/decrease the brightness when i don't want it to be changed. any great ideas on how to code this?
zyrill is offline   Reply With Quote
Old 12th December 2002, 13:32   #2  |  Link
Bidoche
Avisynth 3.0 Developer
 
Join Date: Jan 2002
Location: France
Posts: 639
There is an anti-flicker filter for virtualdub made by donald graft.
You can have it on his web site : http://shelob.mordor.net/dgraft/
Bidoche is offline   Reply With Quote
Old 12th December 2002, 13:33   #3  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,907
There is an anti-flicker filter and source code for VirtualDub at my web site (see below). Look under the section called 'Mine'. It works well but really needs to reset at scene changes. That wouldn't be hard to add.

If you converted this to an Avisynth filter, you would not need to use two passes over the source as the VirtualDub version does.

Last edited by Guest; 12th December 2002 at 13:40.
Guest is offline   Reply With Quote
Old 12th December 2002, 14:54   #4  |  Link
zyrill
Registered User
 
Join Date: Jan 2002
Location: Germany
Posts: 83
well basically i want a filter that works within yuv color space (i don't won't to convert to rgb) - does anything like that exist already?

why wouldn't i need two pass when porting it to avisynth?
zyrill is offline   Reply With Quote
Old 12th December 2002, 15:17   #5  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,907
Quote:
Originally posted by zyrill
well basically i want a filter that works within yuv color space (i don't won't to convert to rgb) - does anything like that exist already?
Not that I know of.

Quote:
why wouldn't i need two pass when porting it to avisynth?
Avisynth filters are capable of random frame access.
Guest is offline   Reply With Quote
Old 12th December 2002, 18:45   #6  |  Link
zyrill
Registered User
 
Join Date: Jan 2002
Location: Germany
Posts: 83
i'll be back in about 10 years... when i finally understand your deflicker 1.1 code! ARGH!

i think i need a mentor with lot's of time for understanding that code - where can i find info on what e.g. src (well i figured that one out, but still - there are a whole lot more of those stupid objects i don't know), dst, pfsi are? and wtf is the kernel used in this file? i think i'll go to university first, come back when i've got my title and then i'll have another look... or do you think it's any help when i try to fumble around with it? i mean i'm not stupid but i'm still in school and i only know the very basics about winapi and delphi... never had a look at c++.

Last edited by zyrill; 12th December 2002 at 18:56.
zyrill is offline   Reply With Quote
Old 12th December 2002, 19:07   #7  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,907
Quote:
Originally posted by zyrill
i'll be back in about 10 years... when i finally understand your deflicker 1.1 code! ARGH!

i think i need a mentor with lot's of time for understanding that code - where can i find info on what e.g. src (well i figured that one out, but still - there are a whole lot more of those stupid objects i don't know), dst, pfsi are? and wtf is the kernel used in this file? i think i'll go to university first, come back when i've got my title and then i'll have another look... or do you think it's any help when i try to fumble around with it? i mean i'm not stupid but i'm still in school and i only know the very basics about winapi and delphi... never had a look at c++.
Tell you what... I'll convert it into an Avisynth filter for you. Give me a week or so as I am quite busy these days.
Guest is offline   Reply With Quote
Old 12th December 2002, 20:20   #8  |  Link
Marc FD
XviD fan
 
Marc FD's Avatar
 
Join Date: Jun 2002
Location: France
Posts: 907
[FUN]and just after i load the sources and i low-level optimise them... LOL ^^[/FUN]

@zyrill

i think i'm not much older than you ^^
you know, C/C++ is really easy to code, you just take some time to get used. i started avisynth filters and C/C++ devellopement by converting a VDub filter in Avisynth.... and it really taked a lot of time ^__^ (i finally realised than rewriting it was easier !)

if you have the right tools and the will, read a lot open-source code, that's how you learn the most things.

Cheers,
MarcFD
Marc FD is offline   Reply With Quote
Old 13th December 2002, 15:16   #9  |  Link
zyrill
Registered User
 
Join Date: Jan 2002
Location: Germany
Posts: 83
Thanks a million, Donald! i can't rival your filters anyway so it's probably a lot better when you do it, anyway.

marc: nice trick, isn't it? but i really are very confused by the code. there are so many code-snippets i don't know i can't even figure out the system with which the filter works. and gee, right then i realized that i was too bad for it! but maybe you can help me learn some stuff so i get a clue from where to start. may i contact you when i encounter any difficulties while learning?
zyrill is offline   Reply With Quote
Old 13th December 2002, 17:40   #10  |  Link
Marc FD
XviD fan
 
Marc FD's Avatar
 
Join Date: Jun 2002
Location: France
Posts: 907
zyrill, there's a devellopement on doom9 and UV, if you have really a problem understanding someting, you'ld find help there ^^
Marc FD is offline   Reply With Quote
Old 13th December 2002, 20:45   #11  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,907
OK, I made a quick-and-dirty port of the VirtualDb filter (which sucks, by the way; it was one of my first filters). Use the flick1.avi from the VirtualDub test files as the test file. Then try this script:

loadplugin("..\release\antiflicker.dll")
avisource("flick1.avi")
crop(16,16,-16,-32)
swapuv()
converttoyuy2()
antiflicker()
temporalsoften(3,20,20)

Notes:

1. Omit swapuv() if not required.
2. Antiflicker will take the window size as a named parameter [window=25 is default, range 2-200].
3. Timeline random access NOT supported. So start from frame 0 and play straight through.
4. The temporalsoften() replaces the built-in DNR in the VirtualDub version. Antiflicker() equalizes the frames globally, and TemporalSoften() adds final per-pixel equalization. Both are necessary for acceptable results.

Don't ask for much more. I don't find this very exciting.

Last edited by Guest; 13th December 2002 at 22:06.
Guest is offline   Reply With Quote
Old 13th December 2002, 23:18   #12  |  Link
WarpEnterprises
C64
 
WarpEnterprises's Avatar
 
Join Date: Apr 2002
Location: Austria
Posts: 830
another way to get 2.5 spread

Btw found a really good and short C++ tutorial

http://www.cplusplus.com/doc/tutorial/

I'm also trying to compile/modify/... AviSynth filters but without some tight C++ background before you won't be able to do much.
WarpEnterprises is offline   Reply With Quote
Old 13th December 2002, 23:27   #13  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,907
Quote:
Originally posted by WarpEnterprises
another way to get 2.5 spread
How so? Antiflicker supports only YUY2.
Guest is offline   Reply With Quote
Old 13th December 2002, 23:31   #14  |  Link
WarpEnterprises
C64
 
WarpEnterprises's Avatar
 
Join Date: Apr 2002
Location: Austria
Posts: 830
ohh, thought SwapUV is 2.5.
WarpEnterprises is offline   Reply With Quote
Old 14th December 2002, 05:34   #15  |  Link
FredThompson
Registered User
 
FredThompson's Avatar
 
Join Date: Feb 2002
Location: Charlotte, NC USA
Posts: 1,981
I've just started testing this with some NTSC DV I shot in Europe earlier this year.

The room had huge windows so there was a lot of natural sunshine but the ceiling lights were running on 50 hz. The result is an image background which flickers while the subject is usually just fine.

The "cleaned up" version isn't perfect but it IS nicer.
FredThompson is offline   Reply With Quote
Old 14th December 2002, 05:36   #16  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,907
Can I get an input clip for my torture suite, please?

Let's see... 60Hz-50Hz gives a 10Hz flicker.

What window size did you use?

You can put multiple calls to Antiflicker, you know.

Last edited by Guest; 14th December 2002 at 05:40.
Guest is offline   Reply With Quote
Old 14th December 2002, 05:42   #17  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,907
Quote:
Originally posted by WarpEnterprises
ohh, thought SwapUV is 2.5.
It is.
Guest is offline   Reply With Quote
Old 14th December 2002, 05:56   #18  |  Link
FredThompson
Registered User
 
FredThompson's Avatar
 
Join Date: Feb 2002
Location: Charlotte, NC USA
Posts: 1,981
Quote:
Originally posted by neuron2
Can I get an input clip for my torture suite, please?

Let's see... 60Hz-50Hz gives a 10Hz flicker.

What window size did you use?

You can put multiple calls to Antiflicker, you know.
Yeah, sure. I can grab some stuff for you. Gonna be big, though, it's DV. How many frames will you want?

The difference won't always be 10 Hz. That would only be for one cycle if they start at the same time, won't it? Maybe I don't understand what you're saying.

Don't remember the settings, I played around with the VirtualDub version last night. Give me a day to reproduce the results. Running some long jobs on that computer right now. Can't import DV until they're done.

Geez, I paid over USD$1K last year to have some old film converted. Hindsight...20/20...would have bought a projection hood and a very nice dual CPU mobo set up...

Wonder how this process would work on NTSC shots of a PAL TV. I'll take some next time I'm over there so it can be tested.
FredThompson is offline   Reply With Quote
Old 14th December 2002, 06:11   #19  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,907
>Yeah, sure. I can grab some stuff for you. Gonna be big, though,
>it's DV. How many frames will you want?

Transcode to DivX or Xvid.

>The difference won't always be 10 Hz. That would only be for one
>cycle if they start at the same time, won't it? Maybe I don't
>understand what you're saying.

It's all about beat frequencies.
Guest is offline   Reply With Quote
Old 14th December 2002, 06:40   #20  |  Link
FredThompson
Registered User
 
FredThompson's Avatar
 
Join Date: Feb 2002
Location: Charlotte, NC USA
Posts: 1,981
Oh, I thought it was all about the Benjamins
FredThompson 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 23:45.


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