Computer Woes

Woes from advanced computer use - programming, open-source-undocumentatia, it-support-for-friends-and-family etc.

2005-11-14

Good TV transcoding with mencoder

Since I got my PVR working (I'll backpost on this later) I suddenly have a need to transcode my TV captures from their 720x576 MPEG2 space-devouring format to something more manageable, like XVID. For this I use mencoder, the command-line encoding tool that comes with MPlayer.

Two examples:

1) Transcode to 352 pixels width, AR 4:3 square pixels (for computer screens) with deinterlacing:

>mencoder.exe -vf pp=lb,scale=352:264 -oac mp3lame -ovc xvid -xvidencopts fixed_quant=4 %1 -o %1-352.avi

-vf invokes video filters, in this case pp (= deinterlace), scale to a fixed with to get the right AR.
-oac chooses audio encoder (lame)
-ovc chooses video encoder (xvid)
-xvidencopts sends parameters to the xvid encoder, here to use a fixed quality setting (between 1 and 31, where 1 is the best)
-o specifies outfile name, here using original filename with a "-352.avi" suffix.

2) Transcode to 640 pixels width, AR 16:9 square pixels cropping black borders, deinterlace:

>mencoder.exe" -vf pp=lb,crop=768:400,scale=640:360 -oac mp3lame -ovc xvid -xvidencopts bitrate=1150 %1 -o %1-640.avi

-vf: pp for deinterlace, crop to crop the source (remove borders top and bottom), scale to 640, 16:9
-oac-ovc like above
-xvidencopts: bitrate 1150 kbps (like a vcd) specified as quality instead of fixed_quant. It's a matter of taste which quality setting to use, but they can't be combined.

My only grief now is that my wardrobe server is a dual CPU and mencoder like most encoders is single-threaded and only uses one CPU. On the other hand this leaves the server fully usable during encoding.
---------------------------------------------------------------
#wapmarks - WAP links and personal phone startpage

0 Comments:

Post a Comment

<< Home