1mpg123(1) General Commands Manual mpg123(1)
2
3
4
6 mpg123 - play audio MPEG 1.0/2.0/2.5 stream (layers 1, 2 and 3)
7
9 mpg123 [ options ] file-or-URL...
10
12 mpg123 reads one or more files (or standard input if ``-'' is speci‐
13 fied) or URLs and plays them on the audio device (default) or outputs
14 them to stdout. file/URL is assumed to be an MPEG audio bit stream.
15
17 The following operands are supported:
18
19 file(s) The path name(s) of one or more input files. They must be
20 valid MPEG-1.0/2.0/2.5 audio layer 1, 2 or 3 bit streams. If a
21 dash ``-'' is specified, MPEG data will be read from the stan‐
22 dard input. Furthermore, any name starting with ``http://'' is
23 recognized as URL (see next section).
24
26 mpg123 options may be either the traditional POSIX one letter options,
27 or the GNU style long options. POSIX style options start with a single
28 ``-'', while GNU long options start with ``--''. Option arguments (if
29 needed) follow separated by whitespace (not ``=''). Note that some
30 options can be absent from your installation when disabled in the build
31 process.
32
34 -k num, --skip num
35 Skip first num frames. By default the decoding starts at the
36 first frame.
37
38 -n num, --frames num
39 Decode only num frames. By default the complete stream is
40 decoded.
41
42 --fuzzy
43 Enable fuzzy seeks (guessing byte offsets or using approximate
44 seek points from Xing TOC). Without that, seeks need a first
45 scan through the file before they can jump at positions. You
46 can decide here: sample-accurate operation with gapless features
47 or faster (fuzzy) seeking.
48
49 -y, --no-resync
50 Do NOT try to resync and continue decoding if an error occurs in
51 the input file. Normally, mpg123 tries to keep the playback
52 alive at all costs, including skipping invalid material and
53 searching new header when something goes wrong. With this
54 switch you can make it bail out on data errors (and perhaps
55 spare your ears a bad time). Note that this switch has been
56 renamed from --resync. The old name still works, but is not
57 advertised or recommened to use (subject to removal in future).
58
59 -F, --no-frankenstein
60 Disable support for Frankenstein streams. Normally, mpg123 stays
61 true to the concept of MPEG audio being just a concatenation of
62 MPEG frames. It will continue decoding even if the type of MPEG
63 frames varies wildly. With this switch, it will only decode the
64 input as long as it does not change its character (from layer I
65 to layer III, changing sampling rate, from mono to stereo),
66 silently assuming end of stream on such occasion. The switch
67 also stops decoding of compatible MPEG frames if there was an
68 Info frame (Xing header, Lame tag) that contained a length of
69 the track in MPEG frames. This comes a bit closer to the notion
70 of a MP3 file as a defined collection of MPEG frames that belong
71 together, but gets rid of the flexibility that can be fun at
72 times but mostly is hell for the programmer of the parser and
73 decoder ...
74
75 --resync-limit bytes
76 Set number of bytes to search for valid MPEG data once lost in
77 stream; <0 means search whole stream. If you know there are
78 huge chunks of invalid data in your files... here is your ham‐
79 mer. Note: Only since version 1.14 this also increases the
80 amount of junk skipped on beginning.
81
82 -p URL | none, --proxy URL | none
83 The specified proxy will be used for HTTP requests. It should
84 be specified as full URL (``http://host.domain:port/''), but the
85 ``http://'' prefix, the port number and the trailing slash are
86 optional (the default port is 80). Specifying none means not to
87 use any proxy, and to retrieve files directly from the respec‐
88 tive servers. See also the ``HTTP SUPPORT'' section.
89
90 -u auth, --auth auth
91 HTTP authentication to use when recieving files via HTTP. The
92 format used is user:password.
93
94 --ignore-mime
95 Ignore MIME types given by HTTP server. If you know better and
96 want mpg123 to decode something the server thinks is image/png,
97 then just do it.
98
99 --no-icy-meta
100 Do not accept ICY meta data.
101
102 --streamdump filename
103 Dump a copy of the input data (as read by libmpg123) to the
104 given file. This enables you to store a web stream to disk
105 while playing, or just create a concatenation of the local files
106 you play for ... why not?
107
108 --icy-interval bytes
109 This setting enables you to play a stream dump containing ICY
110 metadata at the given interval in bytes (the value of the icy-
111 metaint HTTP response header). Without it, such a stream will
112 play, but will cause regular decoding glitches with resync.
113
114 --no-seekbuffer
115 Disable the default micro-buffering of non-seekable streams that
116 gives the parser a safer footing.
117
118 -@ file, --list file
119 Read filenames and/or URLs of MPEG audio streams from the speci‐
120 fied file in addition to the ones specified on the command line
121 (if any). Note that file can be either an ordinary file, a dash
122 ``-'' to indicate that a list of filenames/URLs is to be read
123 from the standard input, or an URL pointing to a an appropriate
124 list file. Note: only one -@ option can be used (if more than
125 one is specified, only the last one will be recognized).
126
127 -l n, --listentry n
128 Of the playlist, play specified entry only. n is the number of
129 entry starting at 1. A value of 0 is the default and means
130 playling the whole list, a negative value means showing of the
131 list of titles with their numbers...
132
133 --continue
134 Enable playlist continuation mode. This changes frame skipping
135 to apply only to the first track and also continues to play fol‐
136 lowing tracks in playlist after the selected one. Also, the
137 option to play a number of frames only applies to the whole
138 playlist. Basically, this tries to treat the playlist more like
139 one big stream (like, an audio book). The current track number
140 in list (1-based) and frame number (0-based) are printed at exit
141 (useful if you interrupted playback and want to continue later).
142 Note that the continuation info is printed to standard output
143 unless the switch for piping audio data to standard out is used.
144 Also, it really makes sense to work with actual playlist files
145 instead of lists of file names as arguments, to keep track posi‐
146 tions consistent.
147
148 --loop times
149 for looping track(s) a certain number of times, < 0 means infi‐
150 nite loop (not with --random!).
151
152 --keep-open
153 For remote control mode: Keep loaded file open after reaching
154 end.
155
156 --timeout seconds
157 Timeout in (integer) seconds before declaring a stream dead (if
158 <= 0, wait forever).
159
160 -z, --shuffle
161 Shuffle play. Randomly shuffles the order of files specified on
162 the command line, or in the list file.
163
164 -Z, --random
165 Continuous random play. Keeps picking a random file from the
166 command line or the play list. Unlike shuffle play above, ran‐
167 dom play never ends, and plays individual songs more than once.
168
169 -i, --index
170 Index / scan through the track before playback. This fills the
171 index table for seeking (if enabled in libmpg123) and may make
172 the operating system cache the file contents for smoother oper‐
173 ating on playback.
174
175 --index-size size
176 Set the number of entries in the seek frame index table.
177
178 --preframes num
179 Set the number of frames to be read as lead-in before a seeked-
180 to position. This serves to fill the layer 3 bit reservoir,
181 which is needed to faithfully reproduce a certain sample at a
182 certain position. Note that for layer 3, a minimum of 1 is
183 enforced (because of frame overlap), and for layer 1 and 2, this
184 is limited to 2 (no bit reservoir in that case, but engine spin-
185 up anyway).
186
187
189 -o module, --output module
190 Select audio output module. You can provide a comma-separated
191 list to use the first one that works. Also see -a.
192
193 --list-modules
194 List the available modules.
195
196 -a dev, --audiodevice dev
197 Specify the audio device to use. The default as well as the
198 possible values depend on the active output. For the JACK out‐
199 put, a comma-separated list of ports to connect to (for each
200 channel) can be specified.
201
202 -s, --stdout
203 The decoded audio samples are written to standard output,
204 instead of playing them through the audio device. This option
205 must be used if your audio hardware is not supported by mpg123.
206 The output format per default is raw (headerless) linear PCM
207 audio data, 16 bit, stereo, host byte order (you can force mono
208 or 8bit).
209
210 -O file, --outfile
211 Write raw output into a file (instead of simply redirecting
212 standard output to a file with the shell).
213
214 -w file, --wav
215 Write output as WAV file. This will cause the MPEG stream to be
216 decoded and saved as file file , or standard output if - is used
217 as file name. You can also use --au and --cdr for AU and CDR
218 format, respectively. Note that WAV/AU writing to non-seekable
219 files, or redirected stdout, needs some thought. Since 1.16.0,
220 the logic changed to writing the header with the first actual
221 data. This avoids spurious WAV headers in a pipe, for example.
222 The result of decoding nothing to WAV/AU is a file consisting
223 just of the header when it is seekable and really nothing when
224 not (not even a header). Correctly writing data with prophetic
225 headers to stdout is no easy business.
226
227 --au file
228 Does not play the MPEG file but writes it to file in SUN audio
229 format. If - is used as the filename, the AU file is written to
230 stdout. See paragraph about WAV writing for header fun with non-
231 seekable streams.
232
233 --cdr file
234 Does not play the MPEG file but writes it to file as a CDR file.
235 If - is used as the filename, the CDR file is written to stdout.
236
237 --reopen
238 Forces reopen of the audiodevice after ever song
239
240 --cpu decoder-type
241 Selects a certain decoder (optimized for specific CPU), for
242 example i586 or MMX. The list of available decoders can vary;
243 depending on the build and what your CPU supports. This options
244 is only availabe when the build actually includes several opti‐
245 mized decoders.
246
247 --test-cpu
248 Tests your CPU and prints a list of possible choices for --cpu.
249
250 --list-cpu
251 Lists all available decoder choices, regardless of support by
252 your CPU.
253
254 -g gain, --gain gain
255 [DEPRECATED] Set audio hardware output gain (default: don't
256 change). The unit of the gain value is hardware and output mod‐
257 ule dependent. (This parameter is only provided for backwards
258 compatibility and may be removed in the future without prior
259 notice. Use the audio player for playing and a mixer app for
260 mixing, UNIX style!)
261
262 -f factor, --scale factor
263 Change scale factor (default: 32768).
264
265 --rva-mix, --rva-radio
266 Enable RVA (relative volume adjustment) using the values stored
267 for ReplayGain radio mode / mix mode with all tracks roughly
268 equal loudness. The first valid information found in ID3V2 Tags
269 (Comment named RVA or the RVA2 frame) or ReplayGain header in
270 Lame/Info Tag is used.
271
272 --rva-album, --rva-audiophile
273 Enable RVA (relative volume adjustment) using the values stored
274 for ReplayGain audiophile mode / album mode with usually the
275 effect of adjusting album loudness but keeping relative loudness
276 inside album. The first valid information found in ID3V2 Tags
277 (Comment named RVA_ALBUM or the RVA2 frame) or ReplayGain header
278 in Lame/Info Tag is used.
279
280 -0, --single0; -1, --single1
281 Decode only channel 0 (left) or channel 1 (right), respectively.
282 These options are available for stereo MPEG streams only.
283
284 -m, --mono, --mix, --singlemix
285 Mix both channels / decode mono. It takes less CPU time than
286 full stereo decoding.
287
288 --stereo
289 Force stereo output
290
291 -r rate, --rate rate
292 Set sample rate (default: automatic). You may want to change
293 this if you need a constant bitrate independent of the mpeg
294 stream rate. mpg123 automagically converts the rate. You should
295 then combine this with --stereo or --mono.
296
297 --resample method
298 Set resampling method to employ if forcing an output rate.
299 Choices (case-insensitive) are NtoM, dirty, and fine. The fine
300 resampler is the default. It employs libsyn123's low-latency
301 fairly efficient resampler to postprocess the output from
302 libmpg123 instead of the fast but very crude NtoM decoder (drop
303 sample method) that mpg123 offers since decades. If you are
304 really low on CPU time, choose NtoM, as the resampler usually
305 needs more time than the MPEG decoder itself. The mpg123 pro‐
306 gram is smart enough to combine the 2to1 or 4to1 downsampling
307 modes with the postprocessing for extreme downsampling.
308
309 -2, --2to1; -4, --4to1
310 Performs a downsampling of ratio 2:1 (22 kHz from 44.1 kHz) or
311 4:1 (11 kHz) on the output stream, respectively. Saves some CPU
312 cycles, but of course throws away the high frequencies, as the
313 decoder does not bother producing them.
314
315 --pitch value
316 Set a pitch change (speedup/down, 0 is neutral; 0.05 is 5%
317 speedup). When not enforcing an output rate, this changes the
318 output sampling rate, so it only works in the range your audio
319 system/hardware supports. When you combine this with a fixed
320 output rate, it modifies a software resampling ratio instead.
321
322 --8bit Forces 8bit output
323
324 --float
325 Forces f32 encoding
326
327 -e enc, --encoding enc
328 Choose output sample encoding. Possible values look like f32
329 (32-bit floating point), s32 (32-bit signed integer), u32
330 (32-bit unsigned integer) and the variants with different num‐
331 bers of bits (s24, u24, s16, u16, s8, u8) and also special vari‐
332 ants like ulaw and alaw 8-bit. See the output of mpg123's
333 longhelp for actually available encodings.
334
335 -d n, --doublespeed n
336 Only play every n'th frame. This will cause the MPEG stream to
337 be played n times faster, which can be used for special effects.
338 Can also be combined with the --halfspeed option to play 3 out
339 of 4 frames etc. Don't expect great sound quality when using
340 this option.
341
342 -h n, --halfspeed n
343 Play each frame n times. This will cause the MPEG stream to be
344 played at 1/n'th speed (n times slower), which can be used for
345 special effects. Can also be combined with the --doublespeed
346 option to double every third frame or things like that. Don't
347 expect great sound quality when using this option.
348
349 -E file, --equalizer
350 Enables equalization, taken from file. The file needs to con‐
351 tain 32 lines of data, additional comment lines may be prefixed
352 with #. Each data line consists of two floating-point entries,
353 separated by whitespace. They specify the multipliers for left
354 and right channel of a certain frequency band, respectively.
355 The first line corresponds to the lowest, the 32nd to the high‐
356 est frequency band. Note that you can control the equalizer
357 interactively with the generic control interface.
358
359 --gapless
360 Enable code that cuts (junk) samples at beginning and end of
361 tracks, enabling gapless transitions between MPEG files when
362 encoder padding and codec delays would prevent it. This is
363 enabled per default beginning with mpg123 version 1.0.0 .
364
365 --no-gapless
366 Disable the gapless code. That gives you MP3 decodings that
367 include encoder delay and padding plus mpg123's decoder delay.
368
369 --no-infoframe
370 Do not parse the Xing/Lame/VBR/Info frame, decode it instead
371 just like a stupid old MP3 hardware player. This implies dis‐
372 abling of gapless playback as the necessary information is in
373 said metadata frame.
374
375 -D n, --delay n
376 Insert a delay of n seconds before each track.
377
378 -o h, --headphones
379 Direct audio output to the headphone connector (some hardware
380 only; AIX, HP, SUN).
381
382 -o s, --speaker
383 Direct audio output to the speaker (some hardware only; AIX,
384 HP, SUN).
385
386 -o l, --lineout
387 Direct audio output to the line-out connector (some hardware
388 only; AIX, HP, SUN).
389
390 -b size, --buffer size
391 Use an audio output buffer of size Kbytes. This is useful to
392 bypass short periods of heavy system activity, which would nor‐
393 mally cause the audio output to be interrupted. You should
394 specify a buffer size of at least 1024 (i.e. 1 Mb, which equals
395 about 6 seconds of audio data) or more; less than about 300 does
396 not make much sense. The default is 0, which turns buffering
397 off.
398
399 --preload fraction
400 Wait for the buffer to be filled to fraction before starting
401 playback (fraction between 0 and 1). You can tune this pre‐
402 buffering to either get faster sound to your ears or safer unin‐
403 terrupted web radio. Default is 0.2 (wait for 20 % of buffer to
404 be full, changed from 1 in version 1.23).
405
406 --devbuffer seconds
407 Set device buffer in seconds; <= 0 means default value. This is
408 the small buffer between the application and the audio backend,
409 possibly directly related to hardware buffers.
410
411 --smooth
412 Keep buffer over track boundaries -- meaning, do not empty the
413 buffer between tracks for possibly some added smoothness.
414
415
417 -t, --test
418 Test mode. The audio stream is decoded, but no output occurs.
419
420 -c, --check
421 Check for filter range violations (clipping), and report them
422 for each frame if any occur.
423
424 -v, --verbose
425 Increase the verbosity level. For example, displays the frame
426 numbers during decoding.
427
428 -q, --quiet
429 Quiet. Suppress diagnostic messages.
430
431 -C, --control
432 Enable terminal control keys. This is enabled automatically if a
433 terminal is detected. By default use 's' or the space bar to
434 stop/restart (pause, unpause) playback, 'f' to jump forward to
435 the next song, 'b' to jump back to the beginning of the song,
436 ',' to rewind, '.' to fast forward, and 'q' to quit. Type 'h'
437 for a full list of available controls.
438
439 --no-control
440 Disable terminal control even if terminal is detected.
441
442 --title
443 In an xterm, rxvt, screen, iris-ansi (compatible, TERM environ‐
444 ment variable is examined), change the window's title to the
445 name of song currently playing.
446
447 --name name
448 Set the name of this instance, possibly used in various places.
449 This sets the client name for JACK output.
450
451 --long-tag
452 Display ID3 tag info always in long format with one line per
453 item (artist, title, ...)
454
455 --utf8 Regardless of environment, print metadata in UTF-8 (otherwise,
456 when not using UTF-8 locale, you'll get ASCII stripdown).
457
458 -R, --remote
459 Activate generic control interface. mpg123 will then read and
460 execute commands from stdin. Basic usage is ``load <filename> ''
461 to play some file and the obvious ``pause'', ``command. ``jump
462 <frame>'' will jump/seek to a given point (MPEG frame number).
463 Issue ``help'' to get a full list of commands and syntax.
464
465 --remote-err
466 Print responses for generic control mode to standard error, not
467 standard out. This is automatically triggered when using -s N.
468
469 --fifo path
470 Create a fifo / named pipe on the given path and use that for
471 reading commands instead of standard input.
472
473 --aggressive
474 Tries to get higher priority
475
476 -T, --realtime
477 Tries to gain realtime priority. This option usually requires
478 root privileges to have any effect.
479
480 -?, --help
481 Shows short usage instructions.
482
483 --longhelp
484 Shows long usage instructions.
485
486 --version
487 Print the version string.
488
490 In addition to reading MPEG audio streams from ordinary files and from
491 the standard input, mpg123 supports retrieval of MPEG audio files or
492 playlists via the HTTP protocol, which is used in the World Wide Web
493 (WWW). Such files are specified using a so-called URL, which starts
494 with ``http://''. When a file with that prefix is encountered, mpg123
495 attempts to open an HTTP connection to the server in order to retrieve
496 that file to decode and play it.
497
498 It is often useful to retrieve files through a WWW cache or so-called
499 proxy. To accomplish this, mpg123 examines the environment for vari‐
500 ables named MP3_HTTP_PROXY, http_proxy and HTTP_PROXY, in this order.
501 The value of the first one that is set will be used as proxy specifica‐
502 tion. To override this, you can use the -p command line option (see
503 the ``OPTIONS'' section). Specifying -p none will enforce contacting
504 the server directly without using any proxy, even if one of the above
505 environment variables is set.
506
507 Note that, in order to play MPEG audio files from a WWW server, it is
508 necessary that the connection to that server is fast enough. For exam‐
509 ple, a 128 kbit/s MPEG file requires the network connection to be at
510 least 128 kbit/s (16 kbyte/s) plus protocol overhead. If you suffer
511 from short network outages, you should try the -b option (buffer) to
512 bypass such outages. If your network connection is generally not fast
513 enough to retrieve MPEG audio files in realtime, you can first download
514 the files to your local harddisk (e.g. using wget(1)) and then play
515 them from there.
516
517 If authentication is needed to access the file it can be specified with
518 the -u user:pass.
519
521 When in terminal control mode, you can quit via pressing the q key,
522 while any time you can abort mpg123 by pressing Ctrl-C. If not in ter‐
523 minal control mode, this will skip to the next file (if any). If you
524 want to abort playing immediately in that case, press Ctrl-C twice in
525 short succession (within about one second).
526
527 Note that the result of quitting mpg123 pressing Ctrl-C might not be
528 audible immediately, due to audio data buffering in the audio device.
529 This delay is system dependent, but it is usually not more than one or
530 two seconds.
531
532
534 In verbose mode, mpg123 updates a line with various information center‐
535 ing around the current playback position. On any decent terminal, the
536 line also works as a progress bar in the current file by reversing
537 video for a fraction of the line according to the current position. An
538 example for a full line is this:
539
540 > 0291+0955 00:01.68+00:28.22 [00:05.30] mix 100=085 192 kb/s
541 576 B acc 18 clip p+0.014
542
543 The information consists of, in order:
544
545 > single-character playback state (``>'' for playing, ``='' for
546 pausing/looping, ``_'' for stopped)
547
548 0291+0955
549 current frame offset and number of remaining frames after the
550 plus sign
551
552 00:01.68+00:28.22
553 current position from and remaining time in human terms (hours,
554 minutes, seconds)
555
556 [00:05.30]
557 fill of the output buffer in terms of playback time, if the buf‐
558 fer is enabled
559
560 mix selected RVA mode (possible values: mix, alb (album), and ---
561 (neutral, off))
562
563 100=085
564 set volume and the RVA-modified effective volume after the equal
565 sign
566
567 192 kb/s
568 current bitrate
569
570 576 B size of current frame in bytes
571
572 acc if positions are accurate, possible values are ``acc'' for accu‐
573 rate positions or ``fuz'' for fuzzy (with guessed byte offsets
574 using mean frame size)
575
576 18 clip
577 amount of clipped samples, non-zero only if decoder reports that
578 (generic does, some optimized ones not)
579
580 p+0.014
581 pitch change (increased/decreased playback sampling rate on user
582 request)
583
584
586 MPEG audio decoding requires a good deal of CPU performance, especially
587 layer-3. To decode it in realtime, you should have at least an
588 i486DX4, Pentium, Alpha, SuperSparc or equivalent processor. You can
589 also use the -m option to decode mono only, which reduces the CPU load
590 somewhat for layer-3 streams. See also the -2 and -4 options.
591
592 If everything else fails, have mpg123 decode to a file and then use an
593 appropriate utility to play that file with less CPU load. Most proba‐
594 bly you can configure mpg123 to produce a format suitable for your
595 audio device (see above about encodings and sampling rates).
596
597 If your system is generally fast enough to decode in realtime, but
598 there are sometimes periods of heavy system load (such as cronjobs,
599 users logging in remotely, starting of ``big'' programs etc.) causing
600 the audio output to be interrupted, then you should use the -b option
601 to use a buffer of reasonable size (at least 1000 Kbytes).
602
604 Up to version 1.25.x, mpg123 always returned exit code 0 also for com‐
605 plete junk on the input side. Fatal errors were only considered for
606 output. With version 1.26.0, this changed to the behaviour described
607 below.
608
609 When not using the remote control interface (which returns input errors
610 as text messages), the process exit code is zero (success) only if all
611 tracks in a playlist had at least one frame parsed, even if it did not
612 decode cleanly, or are empty, MPEG-wise (perhaps only metadata, or
613 really an empty file). When you decode nothing, nothing is the result
614 and that is fine. When a track later aborts because of parser errors or
615 breakdown of the network communication, this is treated as end of a
616 track, but does not make the process as such fail. One really bad (or
617 non-existing) stream in the playlist results in a non-zero error code,
618 consistent with other UNIX tools.
619
620 An error in audio output results in the process ending with a non-zero
621 exit code immediately, regardless of how much data has been success‐
622 fully played before. The forgiveness is only on the input side.
623
625 Mostly MPEG-1 layer 2 and 3 are tested in real life. Please report any
626 issues and provide test files to help fixing them.
627
628 No CRC error checking is performed.
629
630 Some platforms lack audio hardware support; you may be able to use the
631 -s switch to feed the decoded data to a program that can play it on
632 your audio device.
633
635 Maintainer:
636 Thomas Orgis <maintainer@mpg123.org>, <thomas@orgis.org>
637
638 Original Creator:
639 Michael Hipp
640
641 Uses code or ideas from various people, see the AUTHORS file accompany‐
642 ing the source code.
643
645 mpg123 is licensed under the GNU Lesser/Library General Public License,
646 LGPL, version 2.1 .
647
649 http://www.mpg123.org
650 http://sourceforge.net/projects/mpg123
651
652
653
654 26 Apr 2020 mpg123(1)