[MPlayer-users] MPlayer -identify question

Alexander Bokovikov openworld at uralweb.ru
Sat Mar 1 16:52:52 CET 2008


Krzysztof Duchnowski wrote:

> "-frames 0" means that no data is decoded so if header lacks this info
> then you don't have it.
> Use "-endpos 1". If you use "-frames 1" it could sometime ends with
> ongoing playback to the end of file (or forced manual quit).

Without any luck. MPlayer does not show any information about streams 
_after_  it starts playback. So, all we could use is shown _before_ playback 
startup whatever I use as endpos: 1, 10 or 10000...

>> Finally -- did anybody ever try to exclude all modules from MPlayer but
>> nesessary for -identify command? I beleave such utility would be of much
>> smaller size! How about it?
>
> What for?
> Avinaptic and MediaInfo is not enough?

They're useless for me, because:

-- I need to get this info in my own prohgram. And this program is not just 
a format indicator, but it just indicates main data for source file.

-- Avinaptic is rather complex tool, going with lot of DLL's.

-- MediaInfo does not support such formats as ASF, WMV, MOV etc. At least it 
is not declared in its features list.

Therefore I'd like to create a table like this:

MP4S = 'Microsoft MPEG-4 Video'
SVQ1 = 'Sorenson H-263 Video'

G726 = 'Sharp G-726 Audio'
QDM2 = 'QDesign Music-2 Audio'

etc.

As for video properties, now I see the only more or less reliable way to get 
the info I need. It is MEncoder running with -endpos 1 or -endpos 2 (don't 
know if keyframe rate could affect the results or not). The command line is 
like the next:

mencoder.exe -oac pcm -ovc copy -endpos 2 file.ext -o nul

The algorithm is something like the next (here is ASF file example):

First we check this line:
-----------------------------------------------------------------------------------------
VIDEO:  [MP4S]  176x144  24bpp  1000.000 fps    0.0 kbps ( 0.0 kbyte/s)

-----------------------------------------------------------------------------------------

We look at "fps" value, and, if it is 0 or 1000 then we look at another 
line:

-----------------------------------------------------------------------------------------------------
Video stream:   56.256 kbit/s  (7032 B/s)  size: 14479 bytes  2.059 secs  25 
frames

-----------------------------------------------------------------------------------------------------

We divide 25 by Round(2.059) and get 12.5 fps.

As for video bitrate, we get it from the first line, but if it is zero, then 
we get it from the 'kbit/s' value at the line above.

The same is for audio stream, though (as I see) its bitrate is always more 
or less correct.

What you think about this method?




More information about the MPlayer-users mailing list