In OctoPrint, I have the webcam set to flip horizontally + vertically (to achieve a 180 degree rotation). It looks fine within the OctoPrint interface, but when I go to /webcam/?action=stream the stream reflects the unmodified webcam video (i.e. it's upside down for me)
I prefer to be able to use the full-screen video feed, since the video feed embedded within the OctoPrint interface is so small that it's hard to see when the print of a small part has failed catastrophically.
(on that note, it would be nice if there were an easy way to open the full-sized video feed from directly within OctoPrint...)
I'm using the latest Octoprint on an RPi3 with the official Raspberry Pi cam, which is mounted in an enclosure from thingiverse that happens to mount it upside down.
Yep. OctoPrint doesn't control the webcam stream, it can only modify it when it displays it itself. Can't change this. If you happen to be using a Raspicam, the driver for that in the bundled webcam server supports rotation and flipping, see
if you are using chrome, you can right-click -> inspect the stream. Then add the following atribute to the image tag: style="transform:rotate(180deg);"
Sigh, I worked through this some time ago, worked through the process and got the stream flipped vertically. I don't know what happened, but on a recent power cycle (I think I forgot to soft shutdown the Pi) to do some printer modification it came back up flipped again. I guess I'll have to reinvest 30 minutes getting this fixed again later, but for now I was curious about the last post for quick flipping it in Chrome. That post assumed a lot, it was not obvious how to do this but I wanted to share the answer and that it works as a quick fix.
The key was to right click on the image, inspect, and then insert only transform:rotate(180deg);
into the existing img style as shown in my screenshot. It does work! Not a good solution, but a workaround.
If you shell in to your octopi, you can change it.
ssh <username>@<host> (eg: ssh pi@octoprint.local), it'll ask for your password. This user, pass, and host were made when you create your octopi image. I think by default it might be pi and raspberry.
sudo vi /boot/octopi.txt (will require the same password as above)
press o to open a new line for editing
paste camera_usb_options="-rot 180" to the document and press ESCAPE to get out of edit mode.
If anyone stumbles upon this thread, this is how I solved it in latest octoprint version (1.10.2 - 2024/08)
edit /etc/camera-streamer.conf.d/libcamera.conf
add hflip and vflip