PDA

View Full Version : Levels Equalizer in mencoder?


JoeMiller
28th December 2006, 21:58
Hi,

I have some DVB-S Files here where the picture is quite dark. I want to encode them to MPEG4 using mencoder, but obviously mencoder doesn't offer a levels transformation filter like VirtualDub does.

I need to expand [0:167] to [0:255].

The -vf eq2 might offer a similar functionality, but I only made it to manipulating brightness and contrast, which is not the same.

Any ideas on how to do it with only using mencoder?

DarkZell666
29th December 2006, 16:49
Just found this: al/autolevels[:f/fullyrange]
automatic brightness / contrast correction
f/fullyrange: Stretch luminance to (0-255). in the post-processing section (-vf switch)

So adding "-vf pp=al:f" should do the trick ;)

mplayer/mencoder doc: http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.txt

DarkZell666
1st January 2007, 11:17
No news is good news ? Did this work for you or not ?

JoeMiller
2nd January 2007, 13:05
So adding "-vf pp=al:f" should do the trick ;)



The result was unchanged, no matter whether I applied the "-vt pp=al:f" option or not. I guess that as long as there is only one pixel with luminance>250, the filter won't stretch anything.
Anyway, "automagically" doesn't sound very predictable to me, so I set up an AviSynth-Script which uses the "Level"-Command. mencoder now gets its input from this AviSynth-Script.

...
Levels(0, 1.0, 200, 0, 255) # stretch [0..200] -> [0..255]
...


Unfortunately, the whole command chain (deinterlace, crop, resize, levels) has now become much slower compared to mencoder-only...