[MPlayer-users] stupid question: how to set the duration for mplayer? e.g. only player the movie from 00:10:01 to 00:20:44.

The Wanderer inverseparadox at comcast.net
Thu Mar 31 08:07:54 CEST 2005


Xie Bo wrote:

> Hi,
> 
> I know I can use "-ss 00:10:01 -t 00:10:43" in ffmpeg to transcode a
> movie from 00:10:01 to 00:20:44. But How to player the movie from
> 00:10:01 to 00:20:44 using MPlayer? I've checked mplayer man page
> (http://mplayerhq.hu/DOCS/man/en/mplayer.1.html) but only find -ss
> option, no -t option.

I don't believe there's a generic way to do this directly; however, it
should be possible to do it indirectly.

Convert both your desired start time and your desired end time into
seconds - in this case, that gives you 601 and 1244. Then, subtract the
first number from the second - 1244 minus 601 is 643. Then, multiply
that number by your frame rate - I can't give examples there, because
the frame rate depends on the particular file in question. Then, give a
command like the following:

mplayer <filename> -ss 10:01 -frames <number>

where <number> is the number you got by multiplying seconds by frame
rate. This will start at (approximately) the desired start time and play
enough frames to get you to the desired end time; it's clunky and
awkward, and it would be much much nicer if the MEncoder -endpos option
would also work in MPlayer, but although I don't think there's any
inherent reason why it couldn't no one has implemented that yet.

-- 
       The Wanderer

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

A government exists to serve its citizens, not to control them.




More information about the MPlayer-users mailing list