Airrec

From M1Research

Jump to: navigation, search

Contents

Overview

This project was developed for air monitoring, video reports (on DVD media) preparation.

Software complex consists of two parts

  • 1. PVR - video recorder, video preview and audio level monitoring, rotating recorded video (delete older parts to keep spool size in fixed size).
  • 2. web-oriented application for DVD building.

Hardware requirements

PVR uses video capture card with hardware MPEG-2 encoder (see ivtv projects for details).

Recorder MPEG-2 stream saved to hard disk, the large disk space - the more video could be saved. :-))

DirectFB is used for GUI.

Downloads

Current version 1.0 (-r42):

Build

  • 1. Download source code from link above and unpack.
cd /usr/local/src
wget http://research.m1stereo.tv/downloads/airrec/airrec-1.0-r42.tar.bz2
bzip2 -cd airrec-1.0-r42.tar.bz2 | tar xvf - 
  • 2. Make sure that installed additional packets:
    • DirectFB-devel
    • sqlite-devel-3.1.2-3
  • 3. Go to source code dir and compile
cd airrec
cd src
make

If DirectFB was installed from rpm you need fix INCLUDES variable in Makefile.

Install

  • 1. Directory structure preparation:
    • /opt/airrec - programs and scripts dir.
    • /var/spool/airrec/live - directory for db file and live streams.
    • /var/spool/airrec/live/ch0 - directory for saving MPEG-2 fragments for channel 0.
    • /var/spool/airrec/dvd/master - built dvd storage
    • /var/spool/airrec/dvd/temp - temparatiry storage for dvd building.
  • 2. Copying files:
#main executable
cp /usr/local/src/airrec/src/airrec /opt/airrec

# database file for storing info about fragments
cp /usr/local/src/airrec/src/airrec.db /var/spool/airrec/live

# mpeg coder setup scripts and srt file making scripts
cp /usr/local/src/airrec/scripts/airrec_srt_creator.pl /opt/airrec
cp /usr/local/src/airrec/scripts/airrec_srt_watcher.sh /opt/airrec
cp /usr/local/src/airrec/scripts/ivtv.setup.CODEC.sh /opt/airrec
cp /usr/local/src/airrec/scripts/ivtv.setup.INPUT.sh /opt/airrec

Configure

  • 1. Configuration file for recorder (sample, 1 channel, 2x80GB stripe for video storing):
db-file=/var/spool/airrec/live/airrec.db
use-channel=0
ident="M1 [main]"
dev-pcm=/dev/video24
dev-yuv=/dev/video32
dev-mpeg=/dev/video0
spool=/var/spool/airrec/live/ch0
spool-limit=140000
#noflip
vsync=25
syslog=6

Some parameters explanations:

    • db-file=<filename> - database file name for storin info about fragments
    • fb-mode=<mode str> - Setup FrameBuffer mode ( default "1024,768,32")
    • use-channel=<N> - Activate channel N and apply further options to that channel
    • ident=<N> - Channel ident
    • dev-pcm=<filename>
    • dev-yuv=<filename>
    • dev-mpeg=<filename>
    • spool=<PATH> - Location where mpg file stored
    • spool-limit=<N> - Limit stored spool to <N> Megabytes
    • vsync=<N> - Try to redraw screen at <N> fps.
    • noflip - Disable surface flipping mode.
    • config=<filename> - Use config file.
    • syslog=<N> - Use LOG_LOCAL<N> facility for syslogging.
  • 2. Running recorder preparation:
    • 1. /etc/crontab (rotating and srt's creating/cleanup):
-- skipped --
0,5,10,15,20,25,30,35,40,45,50,55 * * * * root /usr/bin/killall -HUP airrec
0,20,40 * * * * root /opt/airrec/airrec_srt_watcher.sh
--skipped--
    • 2. /etc/modprobe.conf:
-- skipped --
alias char-major-81 videodev
alias char-major-81-0 ivtv
options ivtv pal=D cardtype=15
#options i810fb vram=8 xres=1024 bpp=32 yres=768 hsync1=30 hsync2=55 vsync1=55 vsync2=72 accel mtrr
--skipped--
    • 3. /etc/rc.d/rc.local (init matrox's module / codes setup):
-- skipped --
# setup new io scheduler
echo -n "cfq" > /sys/block/hda/queue/scheduler
echo -n "cfq" > /sys/block/hdc/queue/scheduler
echo -n "cfq" > /sys/block/hdd/queue/scheduler

# airrec init
/sbin/modprobe drm
/sbin/modprobe mga
/sbin/modprobe matroxfb_base
/opt/airrec/ivtv.setup.CODEC.sh
/opt/airrec/ivtv.setup.INPUT.sh
/bin/sleep 2
--skipped--
    • 4. /etc/inittab (start at the first console)
-- skipped --
# Run gettys in standard runlevels
#1:2345:respawn:/sbin/mingetty tty1
1:2345:respawn:/sbin/startsess tty1 /opt/airrec/airrec -c /opt/airrec/airrec.conf.mga >/dev/null 2>/dev/null
--skipped--
    • 5. /etc/directfbrc :
no-vt-switch
#no-vt-switching
#no-vt
    • 6. /etc/hotplug/blacklist (preventing loading mga video board drivers at boot stage)
-- skipped --
ohci1394
matrox_w1
matroxfb_accel
matroxfb_base
-- skipped --

Licence

    airrec
    (yet another PVR)
                                                                                                                                               
    Copyright (C) 2006 Maksym Veremeyenko.
    This file is part of airrec project (air monitoring/recording with
    video reports build system)
                                                                                                                                               
    airrec is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
                                                                                                                                               
    airrec is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
                                                                                                                                               
    You should have received a copy of the GNU General Public License
    along with airrec; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
Personal tools