sarxos / webcam-capture

The goal of this project is to allow integrated or USB-connected webcams to be accessed directly from Java. Using provided libraries users are able to read camera images and detect motion. Main project consist of several sub projects - the root one, which contains required classes, build-in webcam driver compatible with Windows, Linux and Mac OS, which can stream images as fast as your camera can serve them (up to 50 FPS). Main project can be used standalone, but user is able to replace build-in driver with different one - such as OpenIMAJ, GStreamer, V4L4j, JMF, LTI-CIVIL, FMJ, etc.
http://webcam-capture.sarxos.pl
MIT License
2.27k stars 1.11k forks source link

How to stream camera by http #137

Closed jackvimal closed 11 years ago

jackvimal commented 11 years ago

I have an example for viewing http video. But i need to stream my camera over http protocol. Kindly add http streaming Examples. This will be very usefull for me.

sarxos commented 11 years ago

Hi,

Thank you for the report. This is existing MJPEG streaming over HTTP example:

https://github.com/sarxos/webcam-capture/blob/master/webcam-capture/src/example/java/MjpegStreamingExample.java

Webcam w = Webcam.getDefault(); // take default webcam
new WebcamStreamer(8080, w, 0.5, true); // and make image available on port 8080, FPS rate 0.5
// locally: http://127.0.0.1:8080/
// remotely: http://your.ip:8080/

Please note that MJPEG streamer is an experimental feature which constantly evolves.

Please let me know if you need anything else.

tejasgarde commented 10 years ago

Hi sarxos , currently webcam-capture project is the best solution for capture webcam, Thanks for good work . Could you please elaborate the above example I want to Stream cam on particular ip . Also Could you please add an example showing how to receive this stream.

sarxos commented 10 years ago

@tejasgarde

Please take a look at this example - both sides are coded - sender and receiver:

https://github.com/sarxos/webcam-capture/tree/master/webcam-capture-examples/webcam-capture-live-streaming