[MPlayer-users] How to get the duration(ID_LENGTH) of a Sony MTS video file use "mplayer"?

littlebat dashing.meng at gmail.com
Thu Sep 13 15:00:09 CEST 2012


On Wed, 29 Aug 2012 14:38:12 +0200
Nico Sabbi <nicola.sabbi at poste.it> wrote:

> 
> $ mplayer 00142.MTS  -ao null -vo null -vc null        or
> $ mencoder -ovc copy -oac copy -o /dev/null  00142.MTS
> 
> At the end watch the duration expressed in seconds in the status bar.
> 

"mplayer -identify -vo null -ao null -frames 0 filename" will output
viedo information quickly. Your ways need some time to play or to
remux, so it can't used in a situation only need the information of a
video file.

And, in my test, "mencoder -ovc copy -oac copy -o /dev/null filename"
give the wrong information. 
"mencoder -ovc copy -oac copy -o /dev/null test.MTS" output:
Video:5321.769 kbit/s (665221 B/s) Size:9419532 Bytes  14.160
Seconds 331 Frames
Audio: 256.000 kbit/s (32000 B/s) Size:210944 Bytes  6.592 Seconds

The real duration is: 7.5 Seconds, checked with playing in mplayer.

And, "mencoder -demuxer lavf -ovc copy -oac copy -o /dev/null test.MTS"
output:
Video:11100.260 kbit/s (1387532 B/s) Size:8352946 Bytes  6.020
Seconds 332 Frames
Audio:262144.000 kbit/s (32768000 B/s) Size:211968 Bytes  0.006
Seconds

So, it seems "mencoder -ovc copy -oac copy -o /dev/null filename" isn't
a way works correctly 100% of the times :-(

In your other reply:
http://lists.mplayerhq.hu/pipermail/mplayer-users/2012-September/085327.html
you
have ever said "mplayer -demuxer lavf ..." or "ffmpeg -i filename"
guessing ways for MPEG-TS file are "partial solutions that work most of
the times for pure luck", can you post a sample file this "ffmpeg -i
filename" guessing way works wrong?

You can download my sample file "test.MTS" in the command above at:
http://www.learndiary.com/test.MTS

Thanks.


More information about the MPlayer-users mailing list