0

I recently found out about the new Raspberry Pi camera driver - uv4l I only have a b+ model, so unfortunately I can't use the WebRTC streaming.

I am okay with using the MJPEG, uv4l has a great example of an embedded MJPEG stream on the camera control page.

However - I don't know how do I start a stream manually, without using the control page, and how do I embed it in a web page (i.e. what do I put for the src attribute of the image?)

I would really appreciate any help with this.

So far I only found this man page: http://www.linux-projects.org/modules/sections/index.php?op=viewarticle&artid=13

2 Answers 2

1

OK, I figured this out.

Once you access the stream URL (by default its http://raspberry.com:8080/stream/video.mjpeg) - the camera starts recording.

As soon as you stop reading from it - the camera stops.

So for example if, on your webpage you have the following html code for the stream:

<img src="http://raspberry.com:8080/stream/video.mjpeg"> - just remove the src attribute so the browser stops sending requests for new frames and the camera will stop. To access the stream again - just puth the src url back.

0

See this example at the homepage:click here. It says:

If you want to directly get the HTTP/MJPEG (Video) stream from the server, e.g. with VLC, type from the client:

client ~ $ cvlc http://raspberrypi:8080/stream/video.mjpeg

Therefore take the source URL above and embed it somewhere in your HTML page. Or just copy the HTML source to see how UV4L does it.

1
  • Thanks! But how do I start the camera to record the stream? I am currently playing with this command: uv4l --driver mjpegstream --uri URI Will update this post if I do come up with a solution to my original question.
    – YemSalat
    Jul 14, 2015 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.