Sharpen those videos

The recent popularity of using h.264 codecs is a good thing. At last we have something we agree upon! The open source implementation of the codec is x264. For the most part, it is fantastic. But, it has an annoying problem; it tends to blur the image. There is a parameter in the x264 called “filter” that controls the deblocking parameter. The default is to leave it at 0,0. But some guys say that you should keep it at -2,-2 or even -3,-3. In my personal opinion, none of these really helps.

The only option is to sharpen the video before you pass it through x264. Now, there are are nifty sharpening filters for Avisynth. One of the very common techniques is to scale the image 4 times then sharpen it using a filter like Xsharpen then resize the video back to the original size. This technique is now done automatically by LimitedSharpen.

Unfortunately, Linux does not have Avisynth. We have mencoder. We don’t have LimitedSharpen. So I tried using the same technique: resize the video to 4 times, use unsharpen, then resize the video to the original size. My mistake, Mplayer on Fedora 10 can’t handle the frame buffer size when I scale a full 1080p video. WTF! I can ofcourse recompile Mplayer, but I decided against it. You know the dependency hell can eat you up alive.

So I did the most lame thing. I simply unsharpend the video using -vf unsharpen with luma only. A value like 3×3:1 works great for me. Then I pass the video to x264. I can live with that for the time being.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s