[MPlayer-users] Movie Duration

Alexander Roalter alex at roalter.it
Tue Jun 19 11:30:17 CEST 2007


info at danielerossi.net wrote:
> 
> Bastiaan Nelissen wrote:
>> I cant find a way to print the movie duration to my screen with mplayer.
>> like:
>> Title              Time:
>> movie.mp4  01:28:33
>>
>> is this possible, if so, how?
>> _______________________________________________
>>
>>   
> (for windows, should be similar in unix)
> 
> 
> mplayer "yourfile.ext" 2>&1 | findstr "VIDEO AUDIO format Stream"
> or in short :
> mplayer "yourfile.ext" 2>&1 | findstr "VIDEO AUDIO"
> but you have to stop the application.
> (if you use -vo null -ao null you get only video stream information)
> 
> output is:
> 
> VIDEO:  [RV40]  320x240  24bpp  20.000 fps    0.0 kbps ( 0.0 kbyte/s)
> AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)

Although I think pressing the 'o' button for the OSD a few times (until 
00:31:23/01:28:44 or somethink like it appears) is the best solution, 
you can get the length of the video with the -identify parameter and 
grepping for ID_LENGTH. It returns the length in seconds of the video.

In contrast to the current playtime, which is not always reliable (as in 
DVDs it often resets once during playback), I did never find the total 
runtime wrong yet.

-- 
cheers,
Alex



More information about the MPlayer-users mailing list