-
Notifications
You must be signed in to change notification settings - Fork 2
/
malint.mdoc
179 lines (179 loc) · 6.14 KB
/
malint.mdoc
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
.\" $NiH: malint.1,v 1.7 2004/11/06 02:44:58 dillo Exp $
.Dd November 4, 2004
.Dt MALINT 1
.Os
.Sh NAME
.Nm malint
.Nd validate MPEG audio streams
.Sh SYNOPSIS
.Nm
.Op Fl cCdDEfFgGhIpPtTV
.Op Fl N Ar MIN
.Op Ar file ...
.Sh DESCRIPTION
The
.Nm
utility parses and validates the MPEG audio streams named in the file
arguments (or standard input if none are given) and prints information
about the streams and any format violations it finds.
.Pp
The output for each file is grouped under a line with that file's
name. The diagnostic and informative messages are preceded with the
byte offset they pertain to.
.Ss Options
For options that specify what test should be performed, a lower case
letter turns the test on, and an upper case letter turns it off. For
long options, prepend
.Ar no-
to turn them off.
.Pp
The options are as follows:
.Bl -tag -width "--no-tag-contents" -compact
.It Fl c
.It Fl -crc
Check CRC fields of the MPEG stream (default).
.It Fl C
.It Fl -no-crc
Don't check CRC fields of the MPEG stream.
.It Fl d
.It Fl -duration
Display duration of the stream (default).
.It Fl D
.It Fl -no-duration
Don't display duration of the stream.
.It Fl E
.It Fl -error
Only display error diagnostics: ignore some warnings and don't display
informational messages (tags and duration of the stream).
.It Fl f
.It Fl -header-change
Display frame header field changes that occur in the stream (default).
.It Fl F
.It Fl -no-header-change
Don't display changes in frame header fields.
.It Fl g
.It Fl -gap
Check for unused bytes in bit reservoir.
.It Fl G
.It Fl -no-gap
Don't check for unused bytes in bit reservoir (default).
.It Fl h
.It Fl -help
Display help message.
.It Fl I
.It Fl -fast-info
Display only info (bit rate, length, tags at beginning and end), do
not parse whole file.
.It Fl N
.It Fl -resync-count Ar MIN
If the stream gets out of sync, require at least
.Ar MIN
consecutive frames to accept resync.
.It Fl p
.It Fl -padding
Check for missing padding in last frame (default).
.It Fl P
.It Fl -no-padding
Don't check for missing padding in last frame.
.It Fl t
.It Fl -tag
Display information about ID3 tags (default).
.It Fl T
.It Fl -no-tag
Don't display information about ID3 tags.
.It Fl -tag-contents
Display contents of ID3 tags (default). If tags are not displayed,
their contents aren't displayed, either.
.It Fl -no-tag-contents
Do not display contents of ID3 tags. If tags are displayed, only
their position and version is shown.
.It Fl V
.It Fl -version
Display version information.
.El
.Ss Error and warning messages
.Bl -diag
.It CRC error (calc:XXXX != file:YYYY)
The CRC calculated by
.Nm
for this frame (XXXX) differs from the
CRC stored in the stream (YYYY).
.It frame data overflows frame (M > N)
The length of data in this frame (M, calculated from side-info or
bit-alloc) is more than the frame can contain (N).
.It illegal header XXXXXXXX (AAAA)
A frame header was not found where expected, instead the four bytes
XXXXXXXX (in hex, AAAA in ASCII) were found.
.It bit reservoir spans across ID3 tag
Parts of the bit reservoir are located before an ID3 tag, whereas this
frame is located after it. This is dubious at best, since many
players do not account for tags when finding the bit reservoir for a
frame.
.It main_data_begin overflows bit reservoir (N > R)
main_data_begin says this frame uses N bytes of the bit reservoir, but
the previous frame only left R bytes as bit reservoir.
.It gap in bit stream (N < R)
Only N of the R bytes in the bit reservoir are used. This is not an
error, and some encoder limit the amount of bit reservoir they'll use
(e.g. to one frame), and thus create gaps if it becomes bigger.
.It skipping N bytes
N bytes were skipped during resynchronization.
.It skipping N bytes, reaching EOF
N bytes were skipped during resynchronization, thus reaching the end
of the stream. Resynchronization failed.
.It no sync found in 1mb, bailing out
no sync was found while scanning 1 megabyte. Resynchronization was
given up.
.It short [last] frame N of L bytes (D+P=M missing)
The [last] frame should be L bytes long, but was found to be only N
bytes long. D bytes of frame data and P bytes of padding (giving M
bytes total) are missing.
.It padding missing from [last] frame (P bytes)
All P bytes of padding were found to be missing from the [last] frame.
This shouldn't cause problems if it is the last frame.
.It padding missing from [last] frame (M of P bytes)
M of P bytes padding were found to be missing from the [last] frame.
This shouldn't cause problems if it is the last frame.
.\" vbr toc not strictly increasing
.\" vbr tag with unsupported flags: XXXXXXXX
.\" currently never printed
.\" short vbr tag (M < N)
.\" cannot parse side info
.\" inbuf overflow after N bytes, bailing out
.El
.Ss Info messages
.Bl -diag
.It MPEG V layer L ...
Shows the MPEG version, audio layer and other parameters contained in
the frame header. This is also output if header parameters change
within the stream.
.It play time: HH:MM:SS (N frames)
Play time of this stream is HH:MM:SS, it contains N frames. (The play
time calculation does not work if the sampling frequency is not
constant throughout the stream.)
.It play time: HH:MM:SS (according to vbr tag)
If using fast info mode, the number of frames is not counted.
According to the VBR tag, play time of this stream is HH:MM:SS.
.It play time: HH:MM:SS (aproximately)
If using fast info mode, the number of frames is not counted. Based
on the assumption that bit rate and sampling frequency are constant
throughout the stream, the number of frames is approximated as
file-length/frame-length, giving a play time of HH:MM:SS.
.It ID3vX
ID3 tag version X found.
.It ID3v1 tag (in middle of file)
ID3v1 tags should be stored in the last 128 bytes of the stream. This
tag was found in the middle of the stream, which might not be found by
some players, or even cause problems (loss of sync).
.El
.Sh AUTHORS
.An Dieter Baron Aq [email protected]
.Sh BUGS
VBR only works if the VBR tag is at the beginning of the stream
(possibly after an ID3 tag) and spans to the end of the stream.
.Pp
ID3v2 tags with unsynchronization are not handled properly.
.Pp
Layer 2 CRC calculation is not performed.
.Pp
Validation of the huffman data in layer 3 streams is not performed.