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 Thu, 08 May 2025 09:48:01 +0000 hourly 1 https://wordpress.org/?v=6.8.2 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!

]]>
By: Goncho https://randomnerdtutorials.com/raspberry-pi-mjpeg-streaming-web-server-picamera2/#comment-957233 Sat, 14 Sep 2024 11:19:34 +0000 https://randomnerdtutorials.com/?p=146898#comment-957233 Thanks for the content! Question, how would it be possible to fetch the camera feed from the raspberry pi (and the camera module) and then send it to another server which hosts the webserver? In this configuration, the raspberry PI hosts both the picamera python script and the webserver. How can these two be “decouple”?

]]>
By: Ingener https://randomnerdtutorials.com/raspberry-pi-mjpeg-streaming-web-server-picamera2/#comment-924781 Wed, 12 Jun 2024 18:42:46 +0000 https://randomnerdtutorials.com/?p=146898#comment-924781 sudo apt install -y python3-picamera2
installation in a virtual environment does not work.
You need to make common modules of the global and virtual environment, then this works:

Create a virtual environment with access to global packages:
python3 -m venv myenv –system-site-packages

Activate the virtual environment:
source myenv/bin/activate

Check availability of picamera2 library:
python -c “import picamera2; print(picamera2.version)”

]]>
By: Diogen https://randomnerdtutorials.com/raspberry-pi-mjpeg-streaming-web-server-picamera2/#comment-918004 Sat, 25 May 2024 06:05:16 +0000 https://randomnerdtutorials.com/?p=146898#comment-918004 The procedure works great. If it is started from the cli terminal or via ssh, it is possible to add no-hang-up and work in the background so that it continues to work safely even after the termination of the ssh connection or shutdown of the cli-terminal:

nohup python stream_server.py &

]]>