[MPlayer-users] help! (Mplayer -identify gives wrong video length)
Ognjen Bezanov
Ognjen at mailshack.com
Thu Nov 22 12:42:12 CET 2007
Alexander Roalter wrote:
> Ognjen Bezanov wrote:
>> Hello Everyone!
>>
>> I'm having an issue with mplayer -identify. When I try to get the length
>> of a MPEG from a DVD track (dumped with mplayer dvd://1 -dumpstream
>> -dumpfile etc...) It gives me the wrong value. It says the movie file is
>> 3h:59m long, even though if I watch it, the movie finishes after 1h and
>> 42mins.
>>
>> The command I type to get the info is:
>>
>> mplayer -identify -endpos 0 /path/to/file 2>&1 | grep -i length
>>
>> (I also tried "mplayer -identify -frames 0 /path/to/file 2>&1 | grep -i
>> length" as someone recommended on the list)
>>
>> Both of these give me ID_LENGTH=14369.74. Also when I play the file and
>> select the time on the OSD, it tells me 3h 59mins remaining, but if I
>> fast forward the movie ends at 1h 42min.
>>
>> Am I doing something wrong? How can I get the actual length of the video
>> file?
>>
>> Thanks!
>
> 3:59 is quite suspiciously looking. AFAIK the length via -identify is
> not obtained by looking at the entire file, but trusting what's written
> in the headers. If I chop a mpeg at 1MB, -identify still should display
> the same length as before. So it's safe to assume the authoring of the
> DVD track was not done well.
>
> Just to make sure: the movie finishes regularly at 1:42, not that it is
> cut off at that point with 2:28 still to go?
>
Yes, the movie finishes at 1h 42 mins. But I knew that from the DVD case
and from when I started watching to when it finished (I timed it). The
OSD itself does not display 1h 42min as the elapsed time. in fact the
time elapsed keeps changing, but never goes past 5 mins.
so It would be 2:38, then go to 0:00, then go to 5:00, then to 0:00
etc... I suspect that these are the different chapters of the DVD? so it
resets each time?
I tried first using mencoder to copy the streams from the file, like this:
mencoder -ovc copy -oac copy /path/to/file -o /path/to/file.avi
And then I get the right time (1h 42mins, ID_LENGTH reports 6130.36). So
I can get hold of the proper length. I am just hoping that there is some
faster way that does not involve copying the streams to another format
first.
Indeed is there some particular way of dumping the original track which
would not cause this? The current setup is such that the computer with
mplayer does not have a DVD drive, so can only accept files that are
already dumped.
So I either need a more reliable way of getting the length (but which is
faster than having to copy the streams as I did before) or a method of
dumping the DVD's that would remove this issue.
Currently I dump the streams using:
mplayer dvd://[track] -dumpstream -dumpfile /path/to/file
Thanks!
More information about the MPlayer-users
mailing list