Skip to content
ggbce edited this page Feb 11, 2018 · 10 revisions

This page contain some samples to explain how to use mjpg-streamer

  • Using a front web page with "output_http.so"

If you want to add some design to your HTTP stream. First you need to start your application with these options:

cd /usr/local/bin ./mjpg_streamer -i "input_uvc.so -d /dev/video0" -o "output_http.so -w /var/www/mysite"

The input may be different, just a basic sample. You need to specify a folder where you will put your HTML code with "-w" option. You can't create subfolder, the internal Web Server doesn't support folder browsing.

So, you can to create an initial page named "index.html" if you want that client side doesn't need to type an URL like http://your_server_name/?action=stream or http://your_server_name/mypage.html, just type the server name and obtain the main page !

Inside the "index.html" page, you will be able to add almost "basic" HTML code... anything that will be processing by the client side (browser) including many JavaScript capabilities. The internal Web server is not a high performance server like Apache that support PHP, WebDAV or plugins like that. The goal is to give a presentation, browsing or selection page.

Using a text editor, you will be able to create your "index.html" page like this:

`

<title>My webcam</title>

My webcam stream !

<iframe src="/?action=stream" style="border:none;" width="640" height="480"></iframe>

`

If you have multiple input, you can create a master page to link other pages where the user will can select a specific camera.

Clone this wiki locally