#!/bin/sh # # Startup script for Livecam # # chkconfig: 345 99 05 # description: FFmpeg is a complete solution to record, convert and stream \ # audio and video. It includes libavcodec, the leading audio/video\ # codec library. FFmpeg is developped under Linux, but it can \ # compile under most OSes, including Windows. # processname: livecam # config: /etc/ffserver.conf # # By: Ryoichi Rio Murashima # Source function library. . /etc/rc.d/init.d/functions if [ -f /etc/sysconfig/livecam ]; then . /etc/sysconfig/livecam fi # See how we were called. case "$1" in start) # v4lctl setnorm NTSC-JP setinput Composite1 echo -n "Starting ffserver: " daemon ffserver -f /etc/ffserver4.conf echo echo -n "Starting ffmpeg: " ffmpeg -vd /dev/video0 http://localhost:8090/feed1.ffm > /dev/null 2> /dev/null & echo touch /var/lock/subsys/livecam ;; stop) echo -n "Shutting down ffmpeg: " killproc ffmpeg echo echo -n "Shutting down ffserver: " killproc ffserver echo rm -f /var/lock/subsys/livecam ;; restart) $0 stop $0 start ;; *) echo -n "Usage: $0 {start|stop|restart}" exit 1 esac exit 0