Comments on: Raspberry Pi: MJPEG Streaming Web Server (Picamera2) https://randomnerdtutorials.com/raspberry-pi-mjpeg-streaming-web-server-picamera2/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Wed, 18 Mar 2026 01:04:51 +0000 hourly 1 https://wordpress.org/?v=6.8.5 By: Raimo Rychlowski https://randomnerdtutorials.com/raspberry-pi-mjpeg-streaming-web-server-picamera2/#comment-1169789 Wed, 18 Mar 2026 01:04:51 +0000 https://randomnerdtutorials.com/?p=146898#comment-1169789 This script works great but was wondering if there is a way to rotate the camera in the script?
Thanks

]]>
By: Jeff Barnett https://randomnerdtutorials.com/raspberry-pi-mjpeg-streaming-web-server-picamera2/#comment-1149936 Mon, 12 Jan 2026 22:24:07 +0000 https://randomnerdtutorials.com/?p=146898#comment-1149936 This is a wonderful tutorial and everything works perfectly. I would like to add ssl to the site to use https on my streaming url . Is there a easy way to do this?

]]>
By: Sara Santos https://randomnerdtutorials.com/raspberry-pi-mjpeg-streaming-web-server-picamera2/#comment-1147246 Wed, 07 Jan 2026 15:41:29 +0000 https://randomnerdtutorials.com/?p=146898#comment-1147246 In reply to Thomas Weber.

Hi.
I wasn’t aware of that.
Thanks for letting us know.

Regards,
Sara

]]>
By: Thomas Weber https://randomnerdtutorials.com/raspberry-pi-mjpeg-streaming-web-server-picamera2/#comment-1147063 Wed, 07 Jan 2026 07:21:32 +0000 https://randomnerdtutorials.com/?p=146898#comment-1147063 Hello,
Thank you for this script, which works on my Pi Zero W with ‘trixie’.
I have since seen that in
‘https://github.com/raspberrypi/picamera2/blob/main/examples/mjpeg_server_2.py’
there is an example with ‘MJPEGEncoder’ instead of ‘JpegEncoder’.
After changing the two references to ‘JpegEncoder’ to ‘MJPEGEncoder’
without making any further code changes to your script,
approximately double the frame rate is achieved
(not measured, but derived from the display with btop/upload).
And, of course, the change is very noticeable in the web browser.

Best regards from Rodenbach, Germany

Translated with DeepL.com (free version)

]]>
By: Sara Santos https://randomnerdtutorials.com/raspberry-pi-mjpeg-streaming-web-server-picamera2/#comment-1035432 Thu, 08 May 2025 09:48:01 +0000 https://randomnerdtutorials.com/?p=146898#comment-1035432 In reply to Andreas Huwe.

Hi.
Do you know the version of Python you have running?

Regards,
Sara

]]>
By: Andreas Huwe https://randomnerdtutorials.com/raspberry-pi-mjpeg-streaming-web-server-picamera2/#comment-1035000 Wed, 07 May 2025 14:51:05 +0000 https://randomnerdtutorials.com/?p=146898#comment-1035000 Hello,
on my raspberry pi it does the work. The error is:

Traceback (most recent call last):
File “stream_server.py”, line 10, in
import socketserver
ImportError: No module named socketserver

pip install socketserver

results in:

ERROR: Could not find a version that satisfies the requirement socketserver
ERROR: No matching distribution found for socketserver

in a python forum there is the information:

socketserver is a standard library module so you don’t need to install it. It looks like you are using Python 2 so use SocketServer, In Python 3 it’s renamed to socketserver.

So what I am doing wrong?

Any help is appreciated.

Best regards,
Andreas

]]>
By: Philip https://randomnerdtutorials.com/raspberry-pi-mjpeg-streaming-web-server-picamera2/#comment-1011914 Fri, 28 Feb 2025 16:41:41 +0000 https://randomnerdtutorials.com/?p=146898#comment-1011914 Thanks, very clear instructions – worked well.

]]>
By: Dieter Runggas https://randomnerdtutorials.com/raspberry-pi-mjpeg-streaming-web-server-picamera2/#comment-1002889 Sun, 26 Jan 2025 11:55:52 +0000 https://randomnerdtutorials.com/?p=146898#comment-1002889 The older version with picamera works very very fine. Is there a way to use it with usb cameras at /dev/video0 or /dev/video1?

Best regards from Bochum, Germany

]]>
By: bastynator https://randomnerdtutorials.com/raspberry-pi-mjpeg-streaming-web-server-picamera2/#comment-996882 Fri, 03 Jan 2025 21:39:27 +0000 https://randomnerdtutorials.com/?p=146898#comment-996882 I was wasting hours trying to get rtsp stream to work without success.
This simple python script just works out of the box and the mjpg can be consumed by Home Assistant straight away.
Thanks!

]]>
By: StormingMoose https://randomnerdtutorials.com/raspberry-pi-mjpeg-streaming-web-server-picamera2/#comment-989665 Sun, 08 Dec 2024 03:51:30 +0000 https://randomnerdtutorials.com/?p=146898#comment-989665 Awesome one more time, thank you!

]]>