Embed IP Camera streaming into website with PHP?

benhowdle89 picture benhowdle89 · Jan 11, 2011 · Viewed 54k times · Source

I have done a quick google on this but i was wondering if this is possible? I have opened up ports on our router to it so its accessible from anywhere but could i use PHP or similar to grab live streaming and show it on a website somewhere?

Answer

rik picture rik · Jan 11, 2011

Try this (HTML5) or just the inner object (HTML<5) with all occurences of %StreamURL% replaced with the URL of your stream.

<video width="320" height="240" autoplay controls>
    <source src="%StreamURL%" type="video/mp4">
    <object width="320" height="240" type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.5.swf">
        <param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.5.swf" /> 
        <param name="flashvars" value='config={"clip": {"url": "%StreamURL%", "autoPlay":true, "autoBuffering":true}}' /> 
        <p><a href="%StreamURL%">view with external app</a></p> 
    </object>
</video>