[MPlayer-users] Analyzing media streams

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Jul 8 23:07:18 CEST 2007


Hello,
On Sun, Jul 08, 2007 at 09:55:08PM +0200, Fredrik Johansson wrote:
[...]
Have a look at TOOLS/midentify in the MPlayer sources.


> * Service method (DVB, ATSC etc)

Do DVB and ATSC captures even result in different data? I guess it
depends on how you capture it though.

> * File format (TS, ES, Program stream etc)

midentify should tell.

> * Video encoding

I assume you mean codec? midentify should tell for all that MPlayer
knows. Even for others you might get a bit of information still.

> * The video frame rate

MPlayer guesses it, bit with all formats it is only a guess. One that
works quite well usually with AVI, while for e.g. asf midentify will
only say "1000 fps". ffmpeg might give some more sane values sometimes,
sometimes they are worse. If only the average frame rate is interesting,
mencoder -noskip -mc 0 -nosound -ovc copy -o /dev/null gives some
statistics at the end. Not that 0-size (aka duplicate) frames are counted
as well, so e.g. for AVIs with mixed 24 and 30 fps content it would give 120 fps.

> * Average video bitrate

mencoder method above for reliable values.
mplayer -v output for asf streams gives the info in the header.

> * Aspect ratio

midentify should tell.

> * Color system

?? No idea what you mean. Colour space? Strictly speaking that is a
property of the decoder you are using, not of the file itself. Though
there are of course choices that make more or less sense. mplayer -v
should say something about it, though very well hidden
(vo_config_request etc. IIRC).

> * Format (1080i/p etc, the big thing here is of course it the video is
> interlaced or progressive)'

Not much of a chance to do it reliably, though you could did into the
codec and see if interlaced motion estimation or dct was used for
encoding. And you forgot the option that will really cause headaches:
telecine.

> Audio:
> Encoding (mp3, acc etc)
> Bitrate
> Sample rate
> Dual mono (or not)

Mostly as for video. Of course use -oac copy instead of nosound to get
audio info out of mencoder.

> Language

midentify, also for subs. But not all formats specify it (e.g. raw vobs,
you'd have to use OCR to find out), or stupid broken formats like ogm
forgot to create specs and whether to e.g. write "English", "eng" or
"en". MPlayer also might not read this info for some formats.

> Subtitles
> Type (dvb-subtitling, teletext or both?)

Why especially these choices?
No idea how DVB does it, but teletext is not normally stored anywhere
when you record... Though you could just check for a black border with
white flicker in the top of the image (and whoever encoded this deserves
a severe punishment for wasting loads of bits).
Or possibly you meant closed captions? Except the stupid way to store
them like teletext there is also a completely different way for DVDs
which MPlayer at least partly supports and thus should be able to tell
you about somehow.
For either of these you'd need a dictionary database or so to get the language
though. In some cases even OCR before that.
As for any other subtitles probably midentify.

Greetings,
Reimar Döffinger



More information about the MPlayer-users mailing list