[MPlayer-users] video encoding

The Wanderer inverseparadox at comcast.net
Tue Dec 20 08:26:10 CET 2005


(quoting reordered for my sanity's sake)

Please don't top-post. Interleaved posting, as I did, is much preferred.

On 12/20/2005 02:08 AM, Ko Ko wrote:

> The Wanderer <inverseparadox at comcast.net> wrote:
> 
>> 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=. 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.
> 
> Thanks for your reply. Your command lines works. Thanks alot. May I
> ask you a little more? When I use this copy for encoding, the result
> frame is not very smooth. Alot of pixels here and there, and when I
> play with Windows Media Player it is crushed. It is quite essential
> for me to get the output file being able to play with Windows Media
> Player because I am actually wanting to embed the movie as preview
> movie. That's why I want to encode the first 10 second or so of the
> movie in the first place.

With -ovc copy, the resulting file will have exactly the same video data
as the input file. Any problems with the output file which are not
present in the input file come from another source.

> And another question will be,
> 
> "What will happen if I encode the movie longer than the duration of
> the original file? Will the rest of the time it will show blank or?"

I don't know, although you could certainly experiment; I would expect it
to cut off when the input file comes to an end, and possibly give an
error as well.

> And lastly,
> 
> I don't know how to add in more codecs to mplayer. How can I do it? I
> only have
>   copy
>   frameno
>   raw
>   nuv
>   lavc
>   vfw
>   qtvideo
> in my list for now. I wanna add in more codecs.

The only way to do this is to install the necessary files and recompile
MPlayer. However, since 'lavc' actually accounts for at least a dozen
codecs all on its own (22 are listed in the man page), you're less
limited than it would seem at first glance.

The only codecs I have (in the list gotten from '-ovc help') which are
not in your own list are:

libdv
xvid
x264

> Thanks alot for your command lines suggestion. It does miracle.

<shrug> It's nothing you couldn't have come up with on your own by
reading the man page and doing a little experimenting. (How do you think
*I* figure these things out, most of the time?)

Consider yourself lucky to have actually gotten a reply; some at least
of the people who answer questions on these lists have little patience
with questions which can be easily answered by just reading the man
page.

-- 
       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