Live recorder described

English - October 03, 2007

Live-rec allows you to continuously record an audio source and make long term storage, usually for legal purposes, sometimes for later retrieval. If you choose right the balance between quality Vs storage, you will be able to have many months of broadcasted backup.

Recorded audio files are only erased when you reach a predefined capacity limit. When you reach the limit, live-rec will erase just the needed files to keep recording until it check again.

Live-rec is a somewhat simple set of scripts made in Bash and Perl, however they are very effective. Live-rec features are:

  • Audio source is encoded on the fly to mp3 or ogg, while maintaining low cpu usage;
  • Crontab infrastructure is used to schedule the more intrincate recording times you need;
  • Enabling the web interface, you can download your recorded files remotely;
  • Audio recording quality can be tuned for your convenience, allowing you to balance between quality Vs recording capacity. The lower the quality, the longest time you can record;
  • With one 120GB hard disk, you can easily record more than 14 months of broadcasted content;
  • Data is stored in a tree of dates for easy indexing, while allowing for a quick filesystem listings;
  • You can cleanup old recordings based on used capacity in MBytes or as a percentage of the usage for the partition where the recording lies;
  • By default, there is a 15Khz filter that cuts-off higher frequencies that should not be present in the recordings;
  • All scripts are easily available for you to customize. License is GPL;
  • You can configure inputs, levels and directories;
  • You can set an MP3 ID3 tag with your own info;

Enjoy! (and give feedback of your failure or successes to digiplan!pt()gmail!com)

Download live-rec-1.4.tar.gz

Live recorder installation under openSUSE 11.0

English - January 05, 2009

You should create a user dedicated to this task (assume it is 'rec'):

First, install some needed software. As root, do:

# wget http://download.opensuse.org/repositories/home:/driesverachtert/SLE_10/noarch/perl-Filesys-DiskFree-0.06-10.1.sle10.rf.noarch.rpm
# rpm -ivh perl-Filesys-DiskFree-0.06-10.1.sle10.rf.noarch.rpm
# mv /usr/lib/perl5/vendor_perl/5.8.8/Filesys /usr/lib/perl5/vendor_perl/5.10.0/
# yast -i alsa-utils
# rmdir /usr/lib/perl5/vendor_perl/5.8.8
# yast -i libsndfile
# wget http://packman.links2linux.org/download/Lame/199786/libmp3lame0-3.98.2-0.pm.3.i586.rpm
# rpm -ivh libmp3lame0-3.98.2-0.pm.3.i586.rpm # wget http://packman.links2linux.org/download/17/199780/lame-3.98.2-0.pm.3.i586.rpm
# rpm -ivh lame-3.98.2-0.pm.3.i586.rpm

now proceed, creating the user 'rec':

# useradd -m rec
# passwd rec
# usermod -g dialout,video,audio rec
# mkdir /opt/recordings
# chown rec.users /opt/recordings

Change to user 'rec', and unpack the files in the new user directory

rec@recorder:~> wget http://digiplan.eu.org/files/live-rec/live-rec-1.4.tar.gz
rec@recorder:~> tar -zxvf live-rec-1.4.tar.gz
rec@recorder:~> ln -s live-rec-1.4 live-rec
rec@recorder:~> ln -s /opt/recordings
rec@recorder:~> mkdir live-rec/log

Download live-rec-1.4.tar.gz

Live recorder installation under Fedora Core 2 or 3

English - October 01, 2007

You should create a user dedicated to this task (assume it is 'rec'):

As root, do:

# useradd -m rec
# passwd rec
# usermod -g audio rec
# mkdir /opt/recordings
# chown rec.users /opt/recordings

Change to user 'rec', and unpack the files in the new user directory

rec@recorder:~> wget http://digiplan.eu.org/files/live-rec/live-rec-1.4.tar.gz
rec@recorder:~> tar -zxvf live-rec-1.4.tar.gz
rec@recorder:~> ln -s live-rec-1.4 live-rec
rec@recorder:~> ln -s /opt/recordings
rec@recorder:~> mkdir live-rec/log

Download live-rec-1.4.tar.gz

Live recorder configuration

Now it's time to configure file live-rec.conf with your custom parameters. Most important parameters to configure are:

'RECORDDIR' usually set to /opt/recordings

and 'INPUT' usually set to 'Line'

'LIMIT' usually set to '90%' of the partition where RECORDDIR lies. This defines a threshold in order to keep that percentage of disk space used by recordings, and allowing a separate script called 'check-limits' to delete always the oldest recordings, to enforce the size limit defined.

Then you can edit his crontab, and call live-recorder whenever you want. The argument after the command start-record states the number of minutes you want to record. Do not overlap the times, because just one will prevail.

0 * * * * ~rec/live-rec/start-record 60 >> ~rec/live-rec/log/live-rec.log 2>&1 &
5 * * * * ~rec/live-rec/check-limits >> ~rec/live-rec/log/live-rec.log 2>&1 &

Publishing recorded sounds in a web page

English - April 30, 2007

The httpd directory have the files needed to publish the recording library of the Live-recorder program. For this to work, you need a Linux system and a running Apache web server.

recordings.conf should be copied to /etc/httpd/conf.d Remaining files should go to /var/www/cgi-bin, and /var/www/icons for the icon files.

    Files are:
        recordings.conf
        index.pl
        header.html
        footer.html
    Subdirectories are:
        icons/

recordings.conf

This file have the Apache web server virtual directory configuration. Do not forget to change the path to the recordings directory

Alias /recordings "/opt/recordings/"

<Directory /opt/recordings/>
    DirectoryIndex /cgi-bin/index.pl
</Directory>

In this example, recordings are kept under /opt/recordings

index.pl

You do not need to change anything in this file. This is responsible for creating the directory index under any recording directory. You can change it if you want. If they exist, index.pl will read the contents of header.html and footer.html to begin and end the index page respectively.

header.html

This is an html format file, that precedes any of the directory contents created by index.pl. Please include and tags.

footer.html

This is an html format file, that ends any of the directory contens created by index.pl. Please include the tags and .

Troubleshooting live recorder

English - October 03, 2007

In Fedora Core 2, groups does not return "audio" group membership, and amixer sometimes gives "Permission denied"
  • Check audio group with 'cat /etc/group | grep audio'
  • Create audio group with 'groupadd audio'
  • Add your user to the audio group with 'usermod -G audio rec'
  • Check /dev/snd directory permissions 770 root:audio
  • Check /dev/snd/* file permissions with 660 root:audio
  • Check /etc/security/console.perms, and change
0600 0600 root
to
0660 0660 root.audio
In Fedora Core 3, same error as above
  • Do the same as for FC2 and additionally:
  • Check /etc/udev/permissions.d, and change
snd/*:root:root:0660
to
snd/*:root:audio:0660
In Fedora Core 4 this was not really tested
  • Do the same as for FC2 and additionally:
  • Check /etc/udev/rules.d/50-udev.rules, and change
# audio devices ... KERNEL=="snd/*", MODE="0660" to
# audio devices ... KERNEL=="snd/*", GROUP="audio", MODE="0660"

Posted under Live-rec | October 2007