简体   繁体   中英

Streaming live video from webcam on html site that is visible on localhost using raspberry pi

I want to stream live video from USB camera connected to my raspberry pi device on my own simple html site visible on localhost only. This site will be hosted on raspberry pi itself and only will need to show video streamed by raspberry pi webcam. I want to connect that site from other PC using XAMPP server hosting site and running on raspberry pi. How to achieve that? I know how to run that server but I only need to know how to show that video on html site.

It depends on the implementation and codec that you are using to stream the Webcam video, since the client-side (HTML/JS) code needs to be able to decode and render the video data sent by the server.

A particular one I've used is JSMpeg , that supports MPEG-1 video decoding over Websockets.

I have a similar Node/Websockets based setup that runs a 24/7 webcam based monitoring server on my Raspberry Pi for my pet, here is the repository , it should give you some insights into the approach that I am using.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM