Setting up a webcam in Repetier-Server for Linux

To use a webcam inside Repetier-Server, you need to stream the data as JPG or MJPG. You can use special IP webcams or a simple software, turning your webcam into a streaming webcam. Feel free to use other software as the one described here.

Stream with MJPG-streamer

Here you find a detailed description how to install MJPG-streamer:

1. Install build dependencies
sudo apt-get install libjpeg8-dev imagemagick libv4l-dev make gcc git cmake g++

2. Download MJPG-streamer
git clone

3. Open directory
cd mjpg-streamer/mjpg-streamer-experimental/

4. Build MJPG-streamer
cmake -G "Unix Makefiles"

5. Install MJPG-streamer
sudo make install

6. Run MJPG-streamer as background process
/usr/local/bin/mjpg_streamer -i -o " -w /usr/local/share/mjpg-streamer/www" -b

If you are using a raspicam, you need to replace “” with “”. Don’t forget to replace that also in the init.d script
downloaded in the next step.

7. Make it start at bootup automatically (optinal)
If you do not want to start MJPG-streamer manually after every restart:
cd /etc/init.d
sudo wget
sudo chmod 755 mjpgstreamer
sudo update-rc.d mjpgstreamer defaults

If you have a raspicam instead of a normal usb camera, you need to edit the mjpg_streamer commandline and replace with

Now you can use these commands to start and stop MJPG-streamer:
sudo /etc/init.d/mjpgstreamer start
sudo /etc/init.d/mjpgstreamer stop
sudo /etc/init.d/mjpgstreamer restart
sudo /etc/init.d/mjpgstreamer status

8. Get ip address
After installing the MJPG-streamer you need to get the local ip address of the server. With ip addr you find your ip address in such a line:

inet brd scope global eth0

Here your ip address would be

9. Enter the URLs in Repetier-Server
This are the required URLs (replace <ip address> with your ip address):
Dynamic Image URL: http://<ip address>:8080/?action=stream
Static Image URL: http://<ip address>:8080/?action=snapshot

In Repetier-Server open your printer and go to Printer Settings Webcam.

Select the desired webcam connection (JPG Images, MJPG Stream or JPG + MJPG Stream).

At Reload Interval you can enter the polling interval for new images.

Enter your URLs in Dynamic Image URL and in Static Image URL and click Save Configuration.

Some webcams need different starting parameters to work. So if you don’t see anything, edit the start script with:
sudo nano /etc/init.d/mjpgstreamer

Edit this line:
$DAEMON -i -o " -w /usr/local/share/mjpg-streamer/www" -b &

Change this line to:
$DAEMON -i " -y -f 5" -o " -w /usr/local/mjpg-streamer/www" -b &

-y activates camera in yuv mode.
-f 5 sets the frame rate, in our example 5 frames per second.
If you want to change the video resolution, you can add e.g. -r 1280x720 for 720p or any other supported resolution.

Save and exit with Strg + x. Then restart MJPG-streamer with sudo /etc/init.d/mjpgstreamer restart.