Hello,
So I've had this audio monitor to listen in on the baby room. It's a pogoplug with a USB webcam attached to it, and uses ffmpeg to stream the audio from the USB webcam to another Pogoplug which runs ffmpeg to play the audio. It works great most of the time. Out of a few days, I get a couple of times when ffmpeg stops running for some reason. I kind of bandaid the issue by creating a cron job to do "systemctl stop babymonitor.service" and then "systemctl start babymonitor.service" every hour. It works ok, but sometimes one of them crashes and it stops working until the next time the cron job runs at the top of the hour.
Is there a better way to do this? Can I have a cron job run every 2 minutes and look to see whether or not the ffmpeg process is running?
Here's the "systemctl status" output when things stop working. I don't know if this help anyone?
baby monitor in the baby room:
$this->bbcode_second_pass_quote('', '
')[root@alarm ~]# systemctl status baby.service
baby.service - baby monitor
Loaded: loaded (/etc/systemd/system/baby.service; enabled)
Active: failed (Result: exit-code) since Sat 2014-01-18 05:17:43 CST; 23min ago
Process: 5252 ExecStart=/usr/bin/ffmpeg -re -f alsa -i plughw:0 -acodec mp2 -ab 128000 -ar 48000 -ac 1 -filter bandpass=f=600:csg=0:width_type=q:w=.806 -f rtp rtp://224.1.2.3:1234 (code=exited, status=1/FAILURE)
Main PID: 5252 (code=exited, status=1/FAILURE)