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. |
12th December 2002, 13:27 | #1 | Link |
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? |
12th December 2002, 13:32 | #2 | Link |
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/ |
12th December 2002, 13:33 | #3 | Link |
Guest
Join Date: Jan 2002
Posts: 21,901
|
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. |
12th December 2002, 15:17 | #5 | Link | ||
Guest
Join Date: Jan 2002
Posts: 21,901
|
Quote:
Quote:
|
||
12th December 2002, 18:45 | #6 | Link |
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. |
12th December 2002, 19:07 | #7 | Link | |
Guest
Join Date: Jan 2002
Posts: 21,901
|
Quote:
|
|
12th December 2002, 20:20 | #8 | Link |
XviD fan
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 |
13th December 2002, 15:16 | #9 | Link |
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? |
13th December 2002, 20:45 | #11 | Link |
Guest
Join Date: Jan 2002
Posts: 21,901
|
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. |
13th December 2002, 23:18 | #12 | Link |
C64
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. |
14th December 2002, 05:34 | #15 | Link |
Registered User
Join Date: Feb 2002
Location: Charlotte, NC USA
Posts: 1,984
|
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. |
14th December 2002, 05:36 | #16 | Link |
Guest
Join Date: Jan 2002
Posts: 21,901
|
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. |
14th December 2002, 05:56 | #18 | Link | |
Registered User
Join Date: Feb 2002
Location: Charlotte, NC USA
Posts: 1,984
|
Quote:
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. |
|
14th December 2002, 06:11 | #19 | Link |
Guest
Join Date: Jan 2002
Posts: 21,901
|
>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. |
Thread Tools | Search this Thread |
Display Modes | |
|
|