fIcy.1 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. .\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.20)
  2. .\"
  3. .\" Standard preamble:
  4. .\" ========================================================================
  5. .de Sp \" Vertical space (when we can't use .PP)
  6. .if t .sp .5v
  7. .if n .sp
  8. ..
  9. .de Vb \" Begin verbatim text
  10. .ft CW
  11. .nf
  12. .ne \\$1
  13. ..
  14. .de Ve \" End verbatim text
  15. .ft R
  16. .fi
  17. ..
  18. .\" Set up some character translations and predefined strings. \*(-- will
  19. .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
  20. .\" double quote, and \*(R" will give a right double quote. \*(C+ will
  21. .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
  22. .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
  23. .\" nothing in troff, for use with C<>.
  24. .tr \(*W-
  25. .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
  26. .ie n \{\
  27. . ds -- \(*W-
  28. . ds PI pi
  29. . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
  30. . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
  31. . ds L" ""
  32. . ds R" ""
  33. . ds C` ""
  34. . ds C' ""
  35. 'br\}
  36. .el\{\
  37. . ds -- \|\(em\|
  38. . ds PI \(*p
  39. . ds L" ``
  40. . ds R" ''
  41. 'br\}
  42. .\"
  43. .\" Escape single quotes in literal strings from groff's Unicode transform.
  44. .ie \n(.g .ds Aq \(aq
  45. .el .ds Aq '
  46. .\"
  47. .\" If the F register is turned on, we'll generate index entries on stderr for
  48. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  49. .\" entries marked with X<> in POD. Of course, you'll have to process the
  50. .\" output yourself in some meaningful fashion.
  51. .ie \nF \{\
  52. . de IX
  53. . tm Index:\\$1\t\\n%\t"\\$2"
  54. ..
  55. . nr % 0
  56. . rr F
  57. .\}
  58. .el \{\
  59. . de IX
  60. ..
  61. .\}
  62. .\"
  63. .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
  64. .\" Fear. Run. Save yourself. No user-serviceable parts.
  65. . \" fudge factors for nroff and troff
  66. .if n \{\
  67. . ds #H 0
  68. . ds #V .8m
  69. . ds #F .3m
  70. . ds #[ \f1
  71. . ds #] \fP
  72. .\}
  73. .if t \{\
  74. . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
  75. . ds #V .6m
  76. . ds #F 0
  77. . ds #[ \&
  78. . ds #] \&
  79. .\}
  80. . \" simple accents for nroff and troff
  81. .if n \{\
  82. . ds ' \&
  83. . ds ` \&
  84. . ds ^ \&
  85. . ds , \&
  86. . ds ~ ~
  87. . ds /
  88. .\}
  89. .if t \{\
  90. . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
  91. . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
  92. . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
  93. . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
  94. . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
  95. . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
  96. .\}
  97. . \" troff and (daisy-wheel) nroff accents
  98. .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
  99. .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
  100. .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
  101. .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
  102. .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
  103. .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
  104. .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
  105. .ds ae a\h'-(\w'a'u*4/10)'e
  106. .ds Ae A\h'-(\w'A'u*4/10)'E
  107. . \" corrections for vroff
  108. .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
  109. .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
  110. . \" for low resolution devices (crt and lpr)
  111. .if \n(.H>23 .if \n(.V>19 \
  112. \{\
  113. . ds : e
  114. . ds 8 ss
  115. . ds o a
  116. . ds d- d\h'-1'\(ga
  117. . ds D- D\h'-1'\(hy
  118. . ds th \o'bp'
  119. . ds Th \o'LP'
  120. . ds ae ae
  121. . ds Ae AE
  122. .\}
  123. .rm #[ #] #H #V #F C
  124. .\" ========================================================================
  125. .\"
  126. .IX Title "FICY 1"
  127. .TH FICY 1 "2013-05-12" "1.0.18" "SlackBuilds.org"
  128. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  129. .\" way too many mistakes in technical documents.
  130. .if n .ad l
  131. .nh
  132. .SH "NAME"
  133. fIcy \- an icecast/shoutcast stream grabber suite
  134. .SH "SYNOPSIS"
  135. .IX Header "SYNOPSIS"
  136. fIcy \fB[options]\fR \fBserver [port [path]]|url\fR
  137. .PP
  138. The main program. Takes directly a stream url and dumps the tracks on
  139. the specified file/s and standard output, depending on the settings.
  140. .PP
  141. fPls \fB[options]\fR \fBfile|url\fR \fB[fIcy options]\fR
  142. .PP
  143. Playlist manager. Reads a playlist (local or remote) and manages fIcy
  144. retries/timeouts/errors, forwarding the specified flags.
  145. .PP
  146. fResync \fB[options]\fR \fBfile\fR
  147. .PP
  148. \&\s-1MPEG\s0 resyncing utility. Re-aligns head frame headers on dumped or
  149. broken files. Usually needed for embedded hardware decoders or editing
  150. software.
  151. .SH "DESCRIPTION"
  152. .IX Header "DESCRIPTION"
  153. fIcy is a small icecast/shoutcast stream grabber suite for use under shell
  154. environment. Its goal is to automatically rip a stream into user customisable
  155. files. It will work with \s-1ICY\s0 compatible streams, allowing you to either to save
  156. the stream to disk or to pipe the output to a media player, or even both. fIcy,
  157. among other uses, is ideal for batch/unattended recording of radio programs and
  158. stream debugging.
  159. .PP
  160. The fIcy package includes:
  161. .IP "\-" 4
  162. fIcy itself, a stream separator/multiplexer,
  163. .IP "\-" 4
  164. fResync, a fast MPEG-resyncing utility,
  165. .IP "\-" 4
  166. fPls, a playlist frontend for fIcy.
  167. .SH "OPTIONS"
  168. .IX Header "OPTIONS"
  169. .SS "fIcy options"
  170. .IX Subsection "fIcy options"
  171. .Vb 2
  172. \& \-d Do not dump the output to stdout.
  173. \& Useful when only ripping.
  174. \&
  175. \& \-E num Enumerate files when song title [metadata] changes, starting at
  176. \& num. When 0, fIcy will try to find the highest unused file
  177. \& number automatically. Uses \-o as a prefix.
  178. \&
  179. \& \-h Help
  180. \&
  181. \& \-c Do not clobber files.
  182. \&
  183. \& \-m Use song title [metadata] when naming files. Uses \-o as prefix.
  184. \&
  185. \& \-n If the file exists create new one with .n as suffix.
  186. \&
  187. \& \-p When dumping to stdout consider writing errors as transient
  188. \& (that is: flush the output buffer until stdout is ready).
  189. \& Useful when you pipe the output to a media player and want to
  190. \& kill it while not interrupting the rip.
  191. \&
  192. \& \-o file Dump the output to file or use file as a prefix (depending on
  193. \& other settings). Hint: to dump without a prefix use "./".
  194. \&
  195. \& \-s suffix Use sfx as a suffix for new files.
  196. \& Hint: the .mp3/.m4a extension is NOT implicit.
  197. \&
  198. \& \-t Display song title [metadata] while ripping.
  199. \&
  200. \& \-r Remove/don\*(Aqt save partial chunks. This will skip the first
  201. \& chunk and remove the last one upon termination which are
  202. \& (supposedly) incomplete. To use in combination with \-m or \-E.
  203. \&
  204. \& \-q file Append "file name" sequence to file. The file name is written
  205. \& upon file completition. This may be used to trigger events and
  206. \& rejoin splitted parts with an external tool without \-E.
  207. \& fResync will use this file in the future.
  208. \&
  209. \& \-x regex Save only files whose title (NOT filename) matches against this
  210. \& (or one of these) extended regular expressions. Multiple \-x can
  211. \& be specified on the command line to form OR conditions. Dump
  212. \& unaffected. Can be combined with \-X.
  213. \&
  214. \& \-X regex Do NOT save files whose title matches against this extended
  215. \& regular expression. Same semantics as \-x.
  216. \&
  217. \& \-I file Load include/exclude REs from file. Each line must be prefixed
  218. \& with + or \- to indicate whether it\*(Aqs a positive or negative
  219. \& expression (\-xX).
  220. \&
  221. \& \-f expr Filter titles through the specified coprocessor expression. The
  222. \& raw title is passed to the expression (doesn\*(Aqt include any
  223. \& additional prefixes/suffixes). As the result will be used
  224. \& internally, some limitations apply. Read carefully the
  225. \& Filtering_ section.
  226. \&
  227. \& \-F file Filter titles through the specified coprocessor script. Same
  228. \& semantics as \-f, but the expressions are loaded from a file
  229. \& instead. Conflicts with \-f.
  230. \&
  231. \& \-C path Specify the path of the external title rewriting coprocessor.
  232. \& Defaults to "sed". The executable must support the \*(Aq\-e\*(Aq, \*(Aq\-f\*(Aq
  233. \& flags and operate through stdin/out, like "sed".
  234. \&
  235. \& \-M time Maximum recording time. See Notes_.
  236. \&
  237. \& \-i time Maximum network idle time. Stops recording after the specified
  238. \& amount of time is passed without network activity. Defaults to
  239. \& 0 (default tcp timeout).
  240. \&
  241. \& \-a file Read authentication credentials from file (the file must
  242. \& contain a line of the form user:password). Note that only the
  243. \& Basic HTTP authentication scheme is supported.
  244. \&
  245. \& \-l num Redirect follow limit. Defaults to 1. 0 disables redirection
  246. \& entirely.
  247. .Ve
  248. .SS "fResync options"
  249. .IX Subsection "fResync options"
  250. .Vb 4
  251. \& \-b By default fResync maps the entire file into memory when
  252. \& operating. However this can create problems on loaded systems
  253. \& with large files or when simulating. This reverts to a
  254. \& buffered I/O mode. This flag is also implicit when simulating.
  255. \&
  256. \& \-s Simulate the process. Print on the standard output the starting
  257. \& sync offset and stream length, but don\*(Aqt modify the source
  258. \& file.
  259. \&
  260. \& \-v Verbose.
  261. \&
  262. \& \-n frames Require/decode at least n valid consecutive frames to validate
  263. \& the sync offset. Defaults to 6.
  264. \&
  265. \& \-m len Maximum frame length. Defaults to 1597. fResync uses this value
  266. \& to determine the maximal region of the file to be checked.
  267. .Ve
  268. .SS "fPls options"
  269. .IX Subsection "fPls options"
  270. .Vb 2
  271. \& \-P path Specify a different name or full path for the fIcy executable
  272. \& (defaults to "fIcy").
  273. \&
  274. \& \-v Verbose.
  275. \&
  276. \& \-R max Specifies the maximal number of retries to do for each stream
  277. \& upon connection/read failure.
  278. \&
  279. \& \-L max Specifies the maximal number of loops to do for the entire
  280. \& playlist (\-1 for infinite).
  281. \&
  282. \& \-T time Wait time to pause after each failure.
  283. \&
  284. \& \-M time Maximum cumulative recording time. See Notes_.
  285. \&
  286. \& \-i time Maximum network idle time. Same as fIcy\*(Aqs when loading a
  287. \& playlist via http. Forwarded to fIcy.
  288. \&
  289. \& \-a file Read authentication credentials from file. Same as fIcy\*(Aqs when
  290. \& loading a playlist via http. The credentials are automatically
  291. \& forwarded to fIcy, but you can override them when needed.
  292. \&
  293. \& \-l num Redirect follow limit. Same as fIcy\*(Aqs when loading a playlist
  294. \& via http. Forwarded to fIcy.
  295. \&
  296. \& \-d file Run as a daemon, redirecting messages to file. fIcy\*(Aqs \-d
  297. \& option is enforced. As the process is chdir\-ed to the root
  298. \& directory you also have to specify absolute paths for all
  299. \& options, including fIcy\*(Aqs ones.
  300. .Ve
  301. .SH "EXAMPLES"
  302. .IX Header "EXAMPLES"
  303. Use fIcy to display \s-1ICY\s0 titles while playing::
  304. .PP
  305. .Vb 1
  306. \& fPls http://example.com:8080/listen.pls \-t | mpg123 \-
  307. .Ve
  308. .PP
  309. Rip a station until stopped::
  310. .PP
  311. .Vb 1
  312. \& fPls \-L\-1 http://netradio.invalid/listen.pls \-s.mp3 \-o./ \-cmrd
  313. .Ve
  314. .PP
  315. Connect directly to the stream with server:port and /path::
  316. .PP
  317. .Vb 1
  318. \& fIcy \-s .mp3 \-o ./ \-md 123.123.123.123 8080 /path/to/stream
  319. .Ve
  320. .PP
  321. Rip an .mp3 stream while playing, but allows the player to be restarted later
  322. by using a named fifo (note that you can re/open \*(L"fifo\*(R" with any player)::
  323. .PP
  324. .Vb 3
  325. \& $ mkfifo fifo
  326. \& $ fIcy \-p ... > fifo
  327. \& $ mpg123 fifo
  328. .Ve
  329. .PP
  330. Record your favourite program \*(L"\s-1XYZ\s0\*(R" usually on-air between 16:30\-17:00::
  331. .PP
  332. .Vb 3
  333. \& at 16:30
  334. \& fPls \-M 30m http://example.com/listen.pls \-o program.mp3 \-x XYZ
  335. \& ^D
  336. .Ve
  337. .PP
  338. Cleanup a ripped and/or damaged mp3 file::
  339. .PP
  340. .Vb 1
  341. \& fResync file.mp3
  342. .Ve
  343. .SH "NOTES"
  344. .IX Header "NOTES"
  345. The output files produced by fIcy may miss audio framing information and
  346. headers since the separation does not consider the audio data. For this reason,
  347. your player 'may' (but should not) fail to reproduce the dump or output some
  348. initial noise: this is expected. fResync can be used to cleanup \s-1MPEG\s0 files
  349. after processing.
  350. .PP
  351. You can also use other tools such as mpgedit for cutting the file in arbitrary
  352. positions without diminishing the quality. Assuming that your song spans across
  353. three files (use \-q to know which ones), that's how to proceed::
  354. .PP
  355. .Vb 1
  356. \& cat 1.mp3 2.mp3 3.mp3 > temp.mp3 && xmpgedit temp.mp3
  357. .Ve
  358. .PP
  359. Do *not* resync the files if you're going to post-process them this way:
  360. fResync would remove at least one boundary frame on each file, while other
  361. tools could also insert extra empty frames to silence the decoder!
  362. .PP
  363. The \-M flag supported by both fIcy and fPls accepts a time specification in
  364. seconds, `HH:MM` or `N minutes/hours/days`. Time starts just after the
  365. connection has been established, but without counting further delays. Also
  366. beware that \-M specified in fPls means `cumulative recording time` (time
  367. accumulates across retries/timeouts), while \-M specified in fIcy means `single
  368. stream recording time` (recording stops at the first error or when the
  369. specified time has elapsed).
  370. .SH "FILTERING"
  371. .IX Header "FILTERING"
  372. Most online radio stations tend to put banners in the title that will be shown
  373. in the player, and eventually result in the filename. To overcome to this (and
  374. more), fIcy offers the possibility to rewrite each title through a normal sed
  375. script via the \*(L"\-fF\*(R" flags. A real sed coprocess is used along the execution so
  376. all of sed's power is available, but some limitations apply:
  377. .PP
  378. * Each line of input should result in one output line, and \s-1ONE\s0 \s-1ONLY\s0.
  379. .PP
  380. * Two consecutive identical titles will result in the second one
  381. being ignored (thus \s-1NOT\s0 splitting the stream). Consider this rule,
  382. as removing carefully the banner could result in a better separation.
  383. .PP
  384. * The resulting title will still apply for \-xXI as usual.
  385. .PP
  386. * Please note that the *title* is filtered, not the filename (which may
  387. still have some characters removed/modified). Use \-tv to see what is
  388. actually sent to the filter.
  389. .PP
  390. You can actually use any executable that works as a stream editor by specifying
  391. the path with '\-C'. The executable must support the '\-e' (inline expression)
  392. and '\-f' (script file) flags or, at least, ignore them. This allows for any
  393. script or custom executable to be used when a \*(L"sed\*(R" script is considered
  394. inadequate.
  395. .SS "Filtering examples"
  396. .IX Subsection "Filtering examples"
  397. As an example, suppose your titles look like this::
  398. .PP
  399. .Vb 1
  400. \& Artist \- Title (radiobanner)
  401. .Ve
  402. .PP
  403. You can write a sed expression or script containing::
  404. .PP
  405. .Vb 1
  406. \& s/ (radiobanner)$//
  407. .Ve
  408. .PP
  409. to remove the trailing part. This facility can also be used to uniform file
  410. names, invert Artist/Title positions and so on. Clever use of the pattern space
  411. can also be used to merge albums. sed alone can be used to debug expressions,
  412. eg::
  413. .PP
  414. .Vb 1
  415. \& echo "test title" | sed \-e \*(Aqexpr\*(Aq
  416. .Ve
  417. .PP
  418. Refer to the \fIsed\fR\|(1) manual for a complete list of commands you can use.
  419. .SH "DISCLAIMER"
  420. .IX Header "DISCLAIMER"
  421. We would like to remind you that saving streams containing copyrighted material
  422. without explicit consent is *ILLEGAL*. For stream administrators, please see
  423. our statement in the \s-1FAQ\s0.
  424. .SH "SEE ALSO"
  425. .IX Header "SEE ALSO"
  426. bfr <http://www.glines.org/software/bfr>
  427. .PP
  428. .Vb 1
  429. \& Audio\-oriented rebuffering tool. Ideal for lousy streams.
  430. .Ve
  431. .PP
  432. mpgedit <http://www.mpgedit.org/>
  433. .PP
  434. .Vb 1
  435. \& Frame\-level mp3 cutting tool.
  436. .Ve
  437. .SH "AUTHORS"
  438. .IX Header "AUTHORS"
  439. fIcy was written by Yuri D'Elia (\fIwavexx@users.sf.net\fR) and
  440. David Leonardi (\fIdavid@mediavitamin.com\fR)
  441. .PP
  442. This manual page by B. Watson for the SlackBuilds.org project. It may
  443. be used by anyone.