[MPlayer-users] video encoding

The Wanderer inverseparadox at comcast.net
Tue Dec 20 07:47:36 CET 2005


On 12/19/2005 11:32 PM, Ko Ko wrote:

> Hi,
> 
> I am still a pretty much newbie with mplayer. I wish to do the
> followings and I am not too sure what kind of command to issue to get
> the result.
> 
> 1. Encode the first 10 seconds of a movie file to another movie file
> (in same format. i.e avi to avi, mpg to mpg)

mencoder input_file -o output_file -ovc copy -oac copy -endpos 10

If that gives you any problems, then try actually transcoding the video
and/or audio, rather than copying them directly. It should be fine,
though.

> 2. Detect the duration of the movie file (5 mins or 10 mins etc)

mplayer -identify -frames 0 input_file

Look for the line reading ID_LENGTH=<number>. The number will be the
total number of seconds in the file; from there, it's just basic math.

> 3. Change the resolution of the movie file (1024x768 to 640x480 etc)

This can be done, although not without loss of quality, but it's
something I've never needed to do so I'm not sure of exactly how. I
believe you need to use -vf scale; read the man page, and don't be
afraid to experiment.

-- 
       The Wanderer

Warning: Simply because I argue an issue does not mean I agree with any
side of it.

Secrecy is the beginning of tyranny.




More information about the MPlayer-users mailing list