File: mpeg_stat.1

package info (click to toggle)
ucbmpeg 1r2-6
  • links: PTS
  • area: non-free
  • in suites: hamm, potato, slink
  • size: 9,504 kB
  • ctags: 7,643
  • sloc: ansic: 79,920; tcl: 2,985; perl: 313; asm: 284; makefile: 269; csh: 13
file content (238 lines) | stat: -rw-r--r-- 8,090 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
.\" @(#)mpeg_stat.1 1.4 93/01/27 SMI;
.TH MPEG_STAT 1 "1 December 1994"
.SH NAME
mpeg_stat \- analyzes MPEG-1 encoded bitstreams
.SH SYNOPSIS
.B mpeg_stat
[
.B -all basename
] [
.B -block_info filename
] [
.B -dct
] [
.B -end N
] [
.B -histogram filename
] [
.B -offsets filename
] [
.B -qscale filename
] [
.B -quiet
] [
.B -rate filename
] [
.B -ratelength N
] [
.B -time
] [
.B -size filename
] [
.B -start N
] [
.B -syslog filename
] [
.B -userdata filename
] [
.B -verify
]
.B [ file_name ]
.SH DESCRIPTION
.B mpeg_stat
decodes mpeg-1 encoded bitstreams collecting varying amounts of statistics.
Errors are sent to stderr, basic statistics to stdout.
.LH
The basic information is the pattern of frames used, number of bytes for
each frame type, the specified parameters, and lengths of vectors.  For each frame
type, the average size, compression rate, Q-factor, and time to decode are given.
.LH
Wherever a filename is requested - can be used to denote stdin/out.
.SH OPTIONS
.HP
.B -all basename
: records information from all options (qscale, block_info, etc.) into
files with basenames of basename (For wizards, -all foo -block_info bar
will record all options BUT -block_info into files of the form foo.*).
.HP
.B -block_info filename
: records information about every block into file filename.  Useful for
detailed analysis and to make specifics files for re-encoding (see
block2spec).  The format is: 
.RS
.HP
frame frame# IPB-type mv-scale temporal_ref
.HP
slice slice# q-scale
.HP
block block# IPB-type Q-scale bits block-type <vectors-if-any> <cbp> <dct decode>
.RE
Numbering starts at 0 (except slices) and all motion vectors are in
half-pel units <X Y>.
.HP
.B -dct
: enables the decoded dct values to be output into the block file.
.HP
.B -end N
: causes mpeg_stat to finish collecting statistics at frame N.
.HP
.B -histogram filename
: summaries the overall statisitcs for each frame type into the file.
.HP
.B -offsets filename
: record the offset of every picture, GOP, and slice into file filename.
.HP
.B -quiet
: toggles the display of the frame-types as they are parsed (and custom
quantization matrices) [default: on].
.HP
.B -qscale filename
: writes Q factor and custom quantization matrix information into file
filename.  The Q-factor and number of blocks of that quality (ignoring
skipped blocks) for each type of frame is recorded.
.HP 
.B -rate filename
: record the bit rate at every picture (after the first second) into the
file filename.  Also collect minimum and maximum bit rate encountered in
the summary information.  (Rate is the number of bits used per second, at
every frame).
.HP 
.B -ratelength N
: Change the measurement period for rate to N, so it will measure the total
rate required over any N frame period (after the first N, of course).
.HP
.B -size filename
: stores information about the type (I,P,B) and size of each frame in file
filename (one frame per line).
.HP
.B -start N
: causes mpeg_stat to begin collecting statistics at frame N.  (Preceding
frames will be parsed, but few statistics are collected (the system layer
counters will sill be running).)
.B -syslog filename
: describes the parsing of the system layer into the file filename.  Note
this option is not turned on by -all.
.B -time 
: prints the amount of time total and per-frame type averages to decode.
This will give an estimate of time in a software player, but is not
generally useful, so it is off by default.
.B -userdata filename
: dumps user data fields into a file.  Can be read in ASCII.
.B -verify
: does more work to check the validity of the sequence.  Slows down the
statistics, so it is optional.
.SH EXAMPLE
Decoding the flowergarden sequence (mpeg_stat -quiet flower.mpg) should
produce the following statistics: 

./mpeg_stat -- MPEG Analyzer for MPEG I video streams (version 2.0)

Reading /u/smoot/mpg/flower.mpg

Frame sequence as to be displayed: 
BBPBBPBBPBBPBBIBBPBBPBBPBBPBBIBBPBBPBBPBBPBBIBBPBBPBBPBBPBBIBBPBBPBBPBBPBBI
BBPBBPBBPBBPBBIBBPBBPBBPBBPBBIBBPBBPBBPBBPBBIBBPBBPBBPBBPBBIBBPBBPBBPBBPBB


Searching for constant frame type sequence...pattern detected: IBBPBBPBBPBBPBB


SUMMARY:

Total Bytes read: 0. Total number of frames: 150.  Length is 5.01 sec

Width: 352      Height: 240
Avg. Frame Size: 4786 bytes + 6 bits  (average rate 1147692.76 bits/sec)

Total Compression Rate:  1.89 % of uncompressed 24 bit images
                        =  0.45 bits per pixel

Number of Macroblocks [width * height = sum]: 22 x 15 = 330 per frame
Skipped Macroblocks = 4389 (9.46%), Coded Macroblocks = 41992 (90.54%)

Total Time Decoding: 8.611 secs. 0.05721 sec/frame or 17.11 frames/sec.

MPEG-Viewer requirements:
        Pixel aspect ratio of 0.6735
        Required display speed: 29.97 frames/sec
        Specified bit rate is 1.00 MBits/sec (2500 * 400bits/sec)
        Requested buffer size is 8K ints (16 bits).
        And the constrained parameter flag is on.
	The stream meets the constrained parameter requirements.

Length of vectors in pixels:
        Horizontal forward vectors, maximum :  39       average:   6
        Vertical forward vectors, maximum   :  22       average:   1

        Horizontal backward vectors, maximum:  29       average:   5
        Vertical backward vectors, maximum  :  16       average:   1


Frame specific information:

    10  I FRAMES, average is:
        Size: 17323 bytes + 1 bits (24.13%)
        Compression Rate:  6.84%
        Q Factor [scales quantization matrix]: 11.15
        Time to Decode: 0.114039 secs.

    40  P FRAMES, average is:
        Size: 8031 bytes + 0 bits (44.74%)
        Compression Rate:  3.17%
        Q Factor [scales quantization matrix]: 10.85
        Time to Decode: 0.075342 secs.

    100 B FRAMES, average is:
        Size: 2235 bytes + 4 bits (31.13%)
        Compression Rate:  0.88%
        Q Factor [scales quantization matrix]: 15.01
        50.59% interpolated Macro Blocks
        Time to Decode: 0.044516 secs.


.SH NOTES
The analyzer expects MPEG-1 video streams only. It can handle multiplexed MPEG streams
(video+audio streams), but mostly analyzes the video portion. 
.LP
Some streams do not end with the proper sequence end code and will probably
generate an "Improper sequence end code." error when done.  In general
mpeg_stat attempts to catch and alert its user to errors in the stream.
Such errors are glossed over in mpeg_play.  Be aware that errors can
disturb statistics gathering, generating odd results.
.LP
This player can handle XING data files. Be aware that XING makes no use of temporal 
redundancy or motion vector information. In other words, they do not use any P or 
B frames in their streams. Instead, XING data is simply a sequence of I
frames.
.SH HISTORY
The analyzer is based on the UC Berkeley mpeg_play player by Ketan
Patel, Brian Smith, Henry Chi-To Ma, and Kim Man Liu.  It was modified at
the Technical University of Berlin, Germany, Dept. of Computer Science by
Tom Pfeifer, Jens Brettin, Harald Masche, Alexander Schulze, and Dirk
Schubert.  It has been further modified to collect much more information by
Steve Smoot (UC Berkeley).
.SH BUGS
No statistics should be collected before the
start frame.  Sometimes system layer streams will indicate that they lack
proper end codes, when they have them.  VBV size conformance is not
checked.  Verification is not complete.
Frame numbers should probably be in display numbering not stream numbering.
Other bugs?  Send mail to <mpeg-bugs@plateau.cs.berkeley.edu>.
.SH VERSION
This is version 2.2, contining some new features since 2.1, and several bug
fixes.  It is a major change since version 1.0.
.SH AUTHORS
.HP
Ketan Patel - University of California, Berkeley, kpatel@cs.berkeley.edu
.HP
Brian Smith - University of California, Berkeley, bsmith@cs.berkeley.edu
.HP
Henry Chi-To Ma - University of California, Berkeley, cma@cs.berkeley.edu
.HP
Kim Man Liu - University of California, Berkeley, kliu@cs.berkeley.edu
.HP
Tom Pfeifer - Multimedia systems project - pfeifer@fokus.gmd.de
.HP
Steve Smoot - University of California, Berkeley, smoot@cs.berkeley.edu
.HP