Apr 212013

As mentioned in “Broadcast on Bambuser from an IP-cam” I had a stability problem when streaming from a D-Link DCS-923L IP-cam to Bambuser. It turned out that the camera is doing something funny with the motion jpeg every 30 minutes that makes the mjpeg decoder in avconv crash.

I have no idea what is happening but since no obvious fix was available I decided to work around the problem using a simple python script that simply restarts avconv when it crashes.

#!/usr/bin/env python3

import subprocess
from datetime import datetime

while True:
    print("Starting at", datetime.now())
    subprocess.call(["avconv", "-an", "-f", "mjpeg", "-r", "5", "-i", "http://camera/MJPEG.CGI", "-f", "flv", "-same_quant", "rtmp://123456.fme.bambuser.com/b-fme/xxx...xxxx"])

This seems to do the trick but with the downside of generating loads of clips at Bambuser.

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>