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

littlebat dashing.meng at gmail.com
Wed Sep 5 10:20:06 CEST 2012


On Tue, 4 Sep 2012 09:52:09 +0000 (UTC)
Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> littlebat <dashing.meng <at> gmail.com> writes:
> 
> > I found the similar question from : [MPlayer-users] No Video for .TS
> > files (with H.264 Video)
> > http://lists.mplayerhq.hu/pipermail/mplayer-users/2010-January/078763.html
> 
> This discussion is about files that do not play with 
> -demuxer mpegts at all, and I asked for sample files 
> that do not play with -demuxer lavf (the question was 
> if it is a good idea to make -demuxer lavf the default).
> 
> > I has the same viewpoint as Andreas Allacher in the link above, it
> > isn't a good way to add extra parameter "-demuxer lavf" manually.
> > It is the best if the mplayer can select the correct demuxer
> > automatically. So, according to the advice of Carl Eugen in the
> > link above, I post a sample file(10M size). if anyone need this
> > file to hack the mplayer source, you can also download it at:
> > http://www.learndiary.com/test.MTS 
> 
> This file seems to play fine with both -demuxer mpegts and 
> -demuxer lavf so I don't see how it is related to above thread.
> 
> Please understand that the only way to get the exact duration 
> of a mpegts file is to decode the whole file.
> (FFmpeg just estimates, you should get this estimate with 
> .demuxer lavf)

I don't know the technique detail of how to get the duration of a video
file. But, if I need a universal method using mplayer to get the
duration of a video, I need extra parameter "-demuxer lavf" to get it
for a mpegts file. 

I found "mediainfo" and "ffmpeg" can get the duration of a mpegts file
in a universal way. Why can't adopt these estimated ways in mplayer?


More information about the MPlayer-users mailing list