-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmp3chop.1
112 lines (100 loc) · 4.49 KB
/
mp3chop.1
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
.TH MP3CHOP 1 "12th January 2013"
.SH NAME
mp3chop \- A tool for chopping up ADTS MP3 and AAC files.
.SH SYNOPSIS
\fBmp3chop\fP [ -b \Fitime\Fp | --begin=\FiTIME\Fp ] [ -e \FiTIME\Fp | --end=\Fitime\Fp ]
[ --strip-id3=1 | -s 1 ] [ --strip-id3=2 | -s 2 ]
[ --copyright=0|1 | -c 0|1 ] [ --original=0|1 | -o 0|1 ]
[ --dump-header | -d ] [ \fIINPUT FILE\fP ]
.SH DESCRIPTION
\fBmp3chop\fP is a tool for extracting one part of an MP3 (MPEG 1 or 2
audio) file or an ADTS AAC (MPEG 4 audio) file. It does not (yet) support
files in an MPEG 4 container.
\fBmp3chop\fP works by walking the frames of the file knowing how much
audio each frame generates and enables/disables output as appropriate
depending on the timecode associated with the frame. It doesn't actually
understand the contents of the frames. MP3 frames can contain references to
other frames and often do. This means that mp3chop can generate output that
contains references to frames that do not exist in the output. Because the
MP3 is a streaming format decoders should deal with this correctly and
glean what information they can from the frames before discarding them if
they cannot produce audio from them. Some decoders may output a diagnostic
such as "frame discarded" when this happens. AAC ADTS frames are always
self contained so this problem does not occur.
Whilst processing the file \fBmp3chop\fP also checks for obvious corruption
within the frame headers by checking that they occur at the specified
offset from the previous frame. Any frames that fail this test are not
output until a good header is found.
\fBmp3chop\fP can also be used for dumping the headers of frames, forcing
the copyright and original flags and stripping \fIID3v1\fP and \fIID3v2\fP
tags.
\fBmp3chop\fP expects to read the input file either on standard input or
from the supplied filename. It always writes to standard output and reports
errors on standard error.
.SH OPTIONS
.TP
\fB-b TIME\fP, --begin\fP=\fITIME\fP
Do not output any of the frames that are before \fITIME\fP in the
input. \fITIME\fP must be in the form '\fBmm:ss.hh\fP' where \fBmm\fP
indicates minutes, \fBss\fP indicates seconds and \fBhh\fP indicates
hundredths of a second.
.TP
\fB-e TIME\fP, \fB--end\fP=\fITIME\fP
Do not output any of the frames that are after \fITIME\fP in the input.
\fITIME\fP must be in the form '\fBmm:ss.hh\fP' where \fBmm\fP indicates
minutes, \fBss\fP indicates seconds and \fBhh\fP indicates hundredths of a
second.
.TP
\fB-s VERSION\fP, \fB--strip-id3\fP=\fIVERSION\fP
Do not output ID3 tags of the specified version (either 1 or 2). This
option may be specified multiple times for different versions.
.TP
\fB-h\fP, \fB--help\fP
Display short usage information and exit.
.TP
\fB-d\fP, \fB--dump-header\fP
Output a description of the header of the first valid frame to standard
output. Disables the output of any MP3 data to standard output.
.TP
\fB-D\fP, \fB--dump-all-headers\fP
Output a description of the header of every frame in the file to standard
output. Disables the output of any MP3 data to standard output.
.TP
\fB-c 0|1\fP, \fB--copyright\fP=\fI0\fP|\fI1\fP
Ensure that the copyright flag is set to the specified value in any frames
that are output.
.TP
\fB-o 0|1\fP, \fB--original\fP=\fI0\fP|\fI1\fP
Ensure that the original flag is set to the specified value in any frames
that are output.
.SH ADTS AAC
AAC-encoded audio can be stored in various container formats. The most
common container format is an ISO MPEG4 container which is a derivative
of Apple's QuickTime container format. Files in this format often have a
".m4a" extension. \fBmp3chop\fP cannot (currently) handle files in this
format.
AAC-encoded audio can also be stored in the ADTS format. This is a raw
stream of frames with simple headers that are similar to those found in MP3
files. \fBmp3chop\fP can handle files in this format.
\fBffmpeg\fP's \fBavconv\fP command line tool (previously known as
\fBffmpeg\fP) can be used to convert from ISO contained AAC to ADTS AAC
with a command line similar to:
.IP
.B avconv -i input.m4a -vn -acodec copy output.aac
.SH EXAMPLES
Extract ten seconds from the file \fBtune.mp3\fP starting at thirty seconds
in and write to \fBtune_edit.mp3\fP:
.IP
.B mp3chop -b 0:30.00 -e 0:40.00 tune.mp3 > tune_edit.mp3
.PP
Validate the frames in the file \fBtune.mp3\fP and output the clean version
to \fBtune_clean.mp3\fP:
.IP
.B mp3chop < tune.mp3 > tune_clean.mp3
.PP
.SH AUTHOR
Written by Mike Crowe.
.SH BUGS
Report bugs to <mac@mcrowe.com>
.SH SEE ALSO
\fIlame\fP(1), \fImpg123\fP(1), \fIavconf\FP(1)