Skip to content
MyStreamRecorder - a free and simple LINUX commandline-based stream recorder (PHP) with scheduler and e-mail notification
PHP Shell
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.bash_aliases added example aliases Feb 28, 2015
COPYING initial commit of version 2.11 May 1, 2012 upd Mar 1, 2015
Quindar_tones.ogg initial commit of version 2.11 May 1, 2012
rec.ini updated Deutschlandradio Stream Urls Jun 9, 2017


MyStreamRecorder is a free simple LINUX commandline-based stream recorder and a scheduler with optional e-mail-notification when recording has finished.

It uses "mplayer" for recording and playing internet streams and has been developed and tested on OpenSuse 12.1.

The basic usage is

php rec.php <streamname>


php rec.php --playonly <streamname>


php rec.php

for detailed help.




see also rec.php

  • PHP 5.3.0+ (for getopt --long-options)

  • "mplayer" for recording a stream ( )

  • server time synchronised via "ntp"

$rcntp start

or have "ntp" started in Runlevel 5; make sure to have a working ntp server defined in ntp configuration file

  • "at" for starting and stopping stream recording
$ rcatd start

or have "at" started in Runlevel 5 (see (if you have OpenSuse 12.2 read to fix an atd problem)

  • required system commands:
"atq" to list the queued "at" commands
atq gives you the <id> and some more
use the <id> with at -c as below (id is the first number of the atq result)
at -c id
to give you a huge answer about what will be executed and the environment, so look
at the last part of the answer which will be the script you type.
"atrm" to remove queued "at" command
"postfix" (started) if you want to use the --mailto option for e-mail notifications after recording


(output of rec.php --help)

MyStreamRecorder -- usage:

   php rec.php

       [-k|--killall] [-s|--stop]

       | [|now] [|###min|###m|#.#hours|#.#h]

   Without times, stream recording or playing starts immediately and stops after 2.0 hours of recording.
   If only the starttime is present, stream recording or playing for 2.0 hours will start at startime.
   The default recording filename under /tmp comprises the station name or stream url and the start and stop times.

   Recording starts about 60 seconds before the start time and stops about 60 seconds after the stop time.
   Playback starts about 60 seconds after the recording (--noplayback disables playback while recording).

   --beep            enables beep tones when recording starts or stops.
   --playonly        disables recording and plays the stream now or at scheduled times
   --mailto=   send notification e-mail when recording has finished to  (default: root@localhost)
   --quiet           fully disables screen output
   --noplayback      fully disables sounds while recording
   --label=   additional text which is added to the filename
   --output=     user defined recording filename
   --baseurl=   baseurl for web link to recorded file in e-mail
   --directory= user defined working directory


   php rec.php nova
   php rec.php --playonly dradio 10min
   php rec.php --noplayback kulturradio 20:00 21:30
   php rec.php -b dradio 201112312000 201112312200
   php rec.php 01:00 2h
   php rec.php --directory=/tmp --output=Dradio-Wissen_News.ogg drwissen 30m
   php rec.php --baseurl= dradio

   You may like to define convenience aliases such as

   # alias rec='php rec.php'
   # alias play='php rec.php -p'
   # alias stop='php rec.php -s'
   # alias playnova='php rec.php -p nova'

   (add the definitions to your /etc/bash.bashrc, /etc/bash.bashrc.local,
   /etc/profile.d/*.sh, /.bashrc, or ~/.alias file to make them permanent)

   for shortening the program calls to

   rec  dradio 1h
   play dradio 1h

   pre-programmed stations:

   P##: station name and alternative names - station homepage

   P1 : dradiokultur deutschlandradiokultur dradio deutschlandradio dkultur drk dr -
   P2 : kulturradio rbbkulturradio kulturradiorbb kradio kr rbb -
   P3 : deutschlandfunk dlf df -
   P4 : funkhauseuropa fhe wdrfunkhauseuropa -
   P5 : radioeins radio1 rbbradioeins re r1 -
   P6 : dradiowissen drwissen drw -
   P7 : deutschewelle dwelle dw -
   P8 : multicult multicultfm multicult2.0 mc -
   P9 : radionova novaradio novaplanet nova -
   P10: 90elf -
   P11: radio-b2-berlin-brandenburg b2 -

   administrative information:

   sources to look up stream urls:
   using /usr/bin/mplayer for playing and stream recording
   /usr/bin/at task scheduler found and atd task scheduler daemon running with pid 1040
   recorded streams will be stored in the working directory /tmp
   MyStreamRecorder will generate a script /tmp/ which can be used for killing all scheduled actions
   (or type 'php rec.php -s').
You can’t perform that action at this time.