An easy way to embed an AXIS camera's video into a web page #718
-
I find this so hard to believe. I've been a full-time web developer for 23 years. Over the years, I've been asked to set up some web cams for my customers in scenic and tourist areas. I've done about a half a dozen of them. It's a nice break from sitting behind the desk once in a while. Today, I was asked to help repair an AXIS M5525-E that had gone down at a nearby marina. It was someone else's install. After six hours of solving numerous issues and going up and down a 30' ladder what seemed like a million times, I was able to get it running again. So now I can see the "guard tour" that I've set up in the browser, working perfectly. I see it on the AXIS camera page, at the camera's IP, followed by :80. If you'd like to see it, I can share the IP address. All that I would like to do is, get this video embedded into one of my customer's web pages. Why is this so difficult? Years ago, with the old Cannon VB-C50 and VB-C60 cameras that were indestructible, you could paste a half a dozen lines of code in a web page that included the camera's IP address, and you were done. A year or so ago, I purchased another new PTZ camera for a different client, and I had to hire a guy in Romania to help me to set up a T2 micro server on Amazon to get something similar accomplished. Why can't we just stream to a web page "out of the box"? I can't be the first guy to ask for this. Has anyone got a relatively simple solution? I DO mean simple - I can handle HTML and css, but all that I'm looking for here is a few lines of "cut and paste" code, and I don't see why I should have to keep setting up servers to stream what I can already see on an AXIS camera page served up by the camera. I would be thrilled if someone could offer a simple solution. Thank you, Frank |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
This automatically generated reply acts as a friendly reminder. Answers to your questions will most often come from the community, from developers like yourself. You will, from time to time, find that Axis employees answers some of the questions, but this is not a guarantee. Think of the discussion forum as a complement to other support channels, not a replacement to any of them. If your question remains unanswered for a period of time, please revisit it to see whether it can be improved by following the guidelines listed in Axis support guidelines. |
Beta Was this translation helpful? Give feedback.
-
Hi @FrankPal , Adding a very simple HTML page for your reference: <!DOCTYPE html>
<html>
<body>
<h2>Axis Camera Live View</h2>
<img src="http://10.176.12.148/axis-cgi/mjpg/video.cgi" alt="AXIS LIVE" width="500" height="333">
</body>
</html> Reference: Request a Motion JPEG video stream |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for sharing a suggestion, Vivek. Unfortunately, it did not work with my camera, but I'll go over the links you've shared and see if I can get anywhere. I whipped up a temporary page, ( https://ussupernet.com/camera/NWmarineCam.php ) and tried both my camera and yours. Neither worked with what have would been wonderfully simple code. You can see the camera in the Axis page here: http://73.47.122.19/#view Maybe there is a setting in the camera I need to enable to get it to work. |
Beta Was this translation helpful? Give feedback.
-
wow - this is fantastic Vivek. You have proven not only that it works, but also with this specific camera (that's only currently running firmware 8.30.1). I was at a loss - to determine what the difference between what you've done, and what I have done. I stripped everything from my web page in case there was some css or some bootstrap framework nonsense interfering with the handful of lines of simple code, and it still didn't work. Then I noticed something in your screen shot, I can see the URL - and it looks like you may be running it locally. Meanwhile, I've actually uploaded the page to a web site - that has an SSL - and THAT was the issue. I created another temporary test page and uploaded it to a site without an SSL: http://www.vibrainium.com/NWmarineCam.php and it works perfectly. Could it be that this simple solution cannot work if an SSL is installed on the site you'd like to embed the video into? I tried switching the http to https in that one line of code, adding port forwarding for port 443 in the router, and it still did not work on the environment that has an SSL installed. I can live with this, as it is still way easier than setting up a microserver on Amazon to stream from (not to mention, it's free). If there is a way to make it work on a website that has an SSL installed - it would be even better. Regardless, I cannot thank you enough for the assistance you have already provided. It is beyond my comprehension - why this simple solution is not clearly documented in the user manual(s) for this camera (and others). It may not be the ultimate solution with all the bells and whistles, but it has great value for simple usage - and for testing purposes. Frank |
Beta Was this translation helpful? Give feedback.
Hi @FrankPal ,
I hope you have checked the following : 226
Adding a very simple HTML page for your reference:
Reference: Request a Motion JPEG video stream