fIcy.pod 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. # pod source for fIcy/fResync/fPls man page. Build with:
  2. # pod2man -s1 -r1.0.18 --stderr -nFICY -c'SlackBuilds.org'
  3. =pod
  4. =head1 NAME
  5. fIcy - an icecast/shoutcast stream grabber suite
  6. =head1 SYNOPSIS
  7. fIcy B<[options]> B<server [port [path]]|url>
  8. The main program. Takes directly a stream url and dumps the tracks on
  9. the specified file/s and standard output, depending on the settings.
  10. fPls B<[options]> B<file|url> B<[fIcy options]>
  11. Playlist manager. Reads a playlist (local or remote) and manages fIcy
  12. retries/timeouts/errors, forwarding the specified flags.
  13. fResync B<[options]> B<file>
  14. MPEG resyncing utility. Re-aligns head frame headers on dumped or
  15. broken files. Usually needed for embedded hardware decoders or editing
  16. software.
  17. =head1 DESCRIPTION
  18. fIcy is a small icecast/shoutcast stream grabber suite for use under shell
  19. environment. Its goal is to automatically rip a stream into user customisable
  20. files. It will work with ICY compatible streams, allowing you to either to save
  21. the stream to disk or to pipe the output to a media player, or even both. fIcy,
  22. among other uses, is ideal for batch/unattended recording of radio programs and
  23. stream debugging.
  24. The fIcy package includes:
  25. =over
  26. =item -
  27. fIcy itself, a stream separator/multiplexer,
  28. =item -
  29. fResync, a fast MPEG-resyncing utility,
  30. =item -
  31. fPls, a playlist frontend for fIcy.
  32. =back
  33. =head1 OPTIONS
  34. =head2 fIcy options
  35. -d Do not dump the output to stdout.
  36. Useful when only ripping.
  37. -E num Enumerate files when song title [metadata] changes, starting at
  38. num. When 0, fIcy will try to find the highest unused file
  39. number automatically. Uses -o as a prefix.
  40. -h Help
  41. -c Do not clobber files.
  42. -m Use song title [metadata] when naming files. Uses -o as prefix.
  43. -n If the file exists create new one with .n as suffix.
  44. -p When dumping to stdout consider writing errors as transient
  45. (that is: flush the output buffer until stdout is ready).
  46. Useful when you pipe the output to a media player and want to
  47. kill it while not interrupting the rip.
  48. -o file Dump the output to file or use file as a prefix (depending on
  49. other settings). Hint: to dump without a prefix use "./".
  50. -s suffix Use sfx as a suffix for new files.
  51. Hint: the .mp3/.m4a extension is NOT implicit.
  52. -t Display song title [metadata] while ripping.
  53. -r Remove/don't save partial chunks. This will skip the first
  54. chunk and remove the last one upon termination which are
  55. (supposedly) incomplete. To use in combination with -m or -E.
  56. -q file Append "file name" sequence to file. The file name is written
  57. upon file completition. This may be used to trigger events and
  58. rejoin splitted parts with an external tool without -E.
  59. fResync will use this file in the future.
  60. -x regex Save only files whose title (NOT filename) matches against this
  61. (or one of these) extended regular expressions. Multiple -x can
  62. be specified on the command line to form OR conditions. Dump
  63. unaffected. Can be combined with -X.
  64. -X regex Do NOT save files whose title matches against this extended
  65. regular expression. Same semantics as -x.
  66. -I file Load include/exclude REs from file. Each line must be prefixed
  67. with + or - to indicate whether it's a positive or negative
  68. expression (-xX).
  69. -f expr Filter titles through the specified coprocessor expression. The
  70. raw title is passed to the expression (doesn't include any
  71. additional prefixes/suffixes). As the result will be used
  72. internally, some limitations apply. Read carefully the
  73. Filtering_ section.
  74. -F file Filter titles through the specified coprocessor script. Same
  75. semantics as -f, but the expressions are loaded from a file
  76. instead. Conflicts with -f.
  77. -C path Specify the path of the external title rewriting coprocessor.
  78. Defaults to "sed". The executable must support the '-e', '-f'
  79. flags and operate through stdin/out, like "sed".
  80. -M time Maximum recording time. See Notes_.
  81. -i time Maximum network idle time. Stops recording after the specified
  82. amount of time is passed without network activity. Defaults to
  83. 0 (default tcp timeout).
  84. -a file Read authentication credentials from file (the file must
  85. contain a line of the form user:password). Note that only the
  86. Basic HTTP authentication scheme is supported.
  87. -l num Redirect follow limit. Defaults to 1. 0 disables redirection
  88. entirely.
  89. =head2 fResync options
  90. -b By default fResync maps the entire file into memory when
  91. operating. However this can create problems on loaded systems
  92. with large files or when simulating. This reverts to a
  93. buffered I/O mode. This flag is also implicit when simulating.
  94. -s Simulate the process. Print on the standard output the starting
  95. sync offset and stream length, but don't modify the source
  96. file.
  97. -v Verbose.
  98. -n frames Require/decode at least n valid consecutive frames to validate
  99. the sync offset. Defaults to 6.
  100. -m len Maximum frame length. Defaults to 1597. fResync uses this value
  101. to determine the maximal region of the file to be checked.
  102. =head2 fPls options
  103. -P path Specify a different name or full path for the fIcy executable
  104. (defaults to "fIcy").
  105. -v Verbose.
  106. -R max Specifies the maximal number of retries to do for each stream
  107. upon connection/read failure.
  108. -L max Specifies the maximal number of loops to do for the entire
  109. playlist (-1 for infinite).
  110. -T time Wait time to pause after each failure.
  111. -M time Maximum cumulative recording time. See Notes_.
  112. -i time Maximum network idle time. Same as fIcy's when loading a
  113. playlist via http. Forwarded to fIcy.
  114. -a file Read authentication credentials from file. Same as fIcy's when
  115. loading a playlist via http. The credentials are automatically
  116. forwarded to fIcy, but you can override them when needed.
  117. -l num Redirect follow limit. Same as fIcy's when loading a playlist
  118. via http. Forwarded to fIcy.
  119. -d file Run as a daemon, redirecting messages to file. fIcy's -d
  120. option is enforced. As the process is chdir-ed to the root
  121. directory you also have to specify absolute paths for all
  122. options, including fIcy's ones.
  123. =head1 EXAMPLES
  124. Use fIcy to display ICY titles while playing::
  125. fPls http://example.com:8080/listen.pls -t | mpg123 -
  126. Rip a station until stopped::
  127. fPls -L-1 http://netradio.invalid/listen.pls -s.mp3 -o./ -cmrd
  128. Connect directly to the stream with server:port and /path::
  129. fIcy -s .mp3 -o ./ -md 123.123.123.123 8080 /path/to/stream
  130. Rip an .mp3 stream while playing, but allows the player to be restarted later
  131. by using a named fifo (note that you can re/open "fifo" with any player)::
  132. $ mkfifo fifo
  133. $ fIcy -p ... > fifo
  134. $ mpg123 fifo
  135. Record your favourite program "XYZ" usually on-air between 16:30-17:00::
  136. at 16:30
  137. fPls -M 30m http://example.com/listen.pls -o program.mp3 -x XYZ
  138. ^D
  139. Cleanup a ripped and/or damaged mp3 file::
  140. fResync file.mp3
  141. =head1 NOTES
  142. The output files produced by fIcy may miss audio framing information and
  143. headers since the separation does not consider the audio data. For this reason,
  144. your player 'may' (but should not) fail to reproduce the dump or output some
  145. initial noise: this is expected. fResync can be used to cleanup MPEG files
  146. after processing.
  147. You can also use other tools such as mpgedit for cutting the file in arbitrary
  148. positions without diminishing the quality. Assuming that your song spans across
  149. three files (use -q to know which ones), that's how to proceed::
  150. cat 1.mp3 2.mp3 3.mp3 > temp.mp3 && xmpgedit temp.mp3
  151. Do *not* resync the files if you're going to post-process them this way:
  152. fResync would remove at least one boundary frame on each file, while other
  153. tools could also insert extra empty frames to silence the decoder!
  154. The -M flag supported by both fIcy and fPls accepts a time specification in
  155. seconds, `HH:MM` or `N minutes/hours/days`. Time starts just after the
  156. connection has been established, but without counting further delays. Also
  157. beware that -M specified in fPls means `cumulative recording time` (time
  158. accumulates across retries/timeouts), while -M specified in fIcy means `single
  159. stream recording time` (recording stops at the first error or when the
  160. specified time has elapsed).
  161. =head1 FILTERING
  162. Most online radio stations tend to put banners in the title that will be shown
  163. in the player, and eventually result in the filename. To overcome to this (and
  164. more), fIcy offers the possibility to rewrite each title through a normal sed
  165. script via the "-fF" flags. A real sed coprocess is used along the execution so
  166. all of sed's power is available, but some limitations apply:
  167. * Each line of input should result in one output line, and ONE ONLY.
  168. * Two consecutive identical titles will result in the second one
  169. being ignored (thus NOT splitting the stream). Consider this rule,
  170. as removing carefully the banner could result in a better separation.
  171. * The resulting title will still apply for -xXI as usual.
  172. * Please note that the *title* is filtered, not the filename (which may
  173. still have some characters removed/modified). Use -tv to see what is
  174. actually sent to the filter.
  175. You can actually use any executable that works as a stream editor by specifying
  176. the path with '-C'. The executable must support the '-e' (inline expression)
  177. and '-f' (script file) flags or, at least, ignore them. This allows for any
  178. script or custom executable to be used when a "sed" script is considered
  179. inadequate.
  180. =head2 Filtering examples
  181. As an example, suppose your titles look like this::
  182. Artist - Title (radiobanner)
  183. You can write a sed expression or script containing::
  184. s/ (radiobanner)$//
  185. to remove the trailing part. This facility can also be used to uniform file
  186. names, invert Artist/Title positions and so on. Clever use of the pattern space
  187. can also be used to merge albums. sed alone can be used to debug expressions,
  188. eg::
  189. echo "test title" | sed -e 'expr'
  190. Refer to the sed(1) manual for a complete list of commands you can use.
  191. =head1 DISCLAIMER
  192. We would like to remind you that saving streams containing copyrighted material
  193. without explicit consent is *ILLEGAL*. For stream administrators, please see
  194. our statement in the FAQ.
  195. =head1 SEE ALSO
  196. bfr <http://www.glines.org/software/bfr>
  197. Audio-oriented rebuffering tool. Ideal for lousy streams.
  198. mpgedit <http://www.mpgedit.org/>
  199. Frame-level mp3 cutting tool.
  200. =head1 AUTHORS
  201. fIcy was written by Yuri D'Elia (I<wavexx@users.sf.net>) and
  202. David Leonardi (I<david@mediavitamin.com>)
  203. This manual page by B. Watson for the SlackBuilds.org project. It may
  204. be used by anyone.