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

Nico Sabbi nicola.sabbi at poste.it
Thu Sep 13 17:47:27 CEST 2012


littlebat ha scritto:
> 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 :-(
as long as the file is not broken it's a correct method, but your test.MTS
contains a video stream that the decoder chokes on.
A more correct method consists in adding -nosound, so mencoder won't skip or
duplicate video frames.


>
> 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?
>
I analysed too many samples to remember which one insn't correctly 
identified
by ffmpeg, but this is not the point.

I don't need to prove that guessing is not a correct solution, nor that 
it's a
workaround respect to a full processing; do I? :)
If you have enough patience and will you can browse the ML archives or the
samples repository in mphq.





More information about the MPlayer-users mailing list