Search This Blog

Saturday, May 7, 2011

Using sharpening filter with mencoder (h264 codec). Easy tutorial

To use this method you’ll need mencoder.exe which is part of the mplayer distribution. Download it here.
There is the “-vf” switch that stands for “video filter”. The unsharp filter is used both for blurring and sharpening. Negative values are blurr, positive sharpening. Remember to put the –vf switch in the beginning of the command.

the parameter is:
-vf unsharp=7:7:2.5:7:7:2.5
for both luma & chroma sharpening.

Values stand for:
luma_msize_x:luma_msize_y:luma_amount:chroma_msize_x:chroma_msize_y:chroma_amount

EXAMPLE:
mencoder INPUT_FILE -vf unsharp=7:7:2.5:7:7:2.5 -ofps 30000/1001 -ovc x264 -x264encopts subq=1:frameref=1:pass=1:threads=2 -nosound –o OUTPUT_FILE.x264.avi

HELP:
Negative values for the amount will blur the input video, while positive values will sharpen. All parameters are optional and default to the equivalent of the string '5:5:1.0:0:0:0.0'.
`luma_msize_x'

Set the luma matrix horizontal size. It can be an integer between 3 and 13, default value is 5.
`luma_msize_y'
Set the luma matrix vertical size. It can be an integer between 3 and 13, default value is 5.
`luma_amount'
Set the luma effect strength. It can be a float number between -2.0 and 5.0, default value is 1.0.
`chroma_msize_x'
Set the chroma matrix horizontal size. It can be an integer between 3 and 13, default value is 0.
`chroma_msize_y'
Set the chroma matrix vertical size. It can be an integer between 3 and 13, default value is 0.
`luma_amount'
Set the chroma effect strength. It can be a float number between -2.0 and 5.0, default value is 0.0.

# Strong luma sharpen effect parameters
unsharp=7:7:2.5

# Strong blur of both luma and chroma parameters
unsharp=7:7:-2:7:7:-2

3 comments:

  1. or if you are using a resizing filter then -ssf (simple sharpening) can work.

    ReplyDelete
  2. The suggested format "unsharp=7:7:-2:7:7:-2 " does not work, while the format used made referenced from the manual "unsharp=l7x7:-2:c7x7:-2" works. This may due to different version of mencoder being used. If you can't work you may try this command format.

    ReplyDelete
  3. That did not happen. During the pre trial hearing on April 8 and 9, prosecutor Eva Wilson exposed flaws in the testing methodology and analysis. She did so with the assistance of Frederick Smith, at the time a forensic chemist and associate professor of correctional justice at the University of Alabama at Birmingham, who acted as an witness for the prosecution..

    I turned my horse and galloped back MK Outlet Online with all haste to his side and got Best Yeezys there in time to catch him as he was falling. I Jordan Shoes For Sale lifted him onto my horse in front of me and succeeded in getting him safely to the Fort. Capt. But, given the times, she was forced to quit when Coach Outlet Online she got married again, to Montreal business man, William Newlands (Newt) Coburn on Nike Air Force 1 Cheap Outlet April 8, 1949. The couple had two daughters, Teri and Devon, and lived in Montreal, with a country house in Melbourne, in Quebec's Eastern Townships. Evelyn Ray Ban Outlet embraced motherhood Coach Outlet Clearance Sale and became a consummate homemaker. Cheap Michael Kors Handbags.

    ReplyDelete

If you like this post, please leave a comment :)