-
Notifications
You must be signed in to change notification settings - Fork 100
V0.4 Enabling Camera Controls
OctoPi uses mjpg-streamer to create a camera stream, which allows you to monitor your printer via OctoPrint. Mjpg-streamer has the ability to change some camera settings via control.htm. Additionally, mjpg-streamer can create a description of your camera's controls and capabilities, accessible via a file called input.json. Since mjpg-streamer has no authentication or authorization capability, it was decided to disable all access to these page within OctoPi by default.
If you have not used port-forwarding or some other insecure methods to view your OctoPi instance through the internet, these pages are generally safe to use. If these pages are available, Octolapse can take advantage and use them create a screen that allows you to control your camera's settings.
- Mjpg-streamer must be installed.
- Some plugins that create their own camera stream must be disabled. Currently this includes OctoPrint Anywhere and The Spaghetti Detective. These are both great plugins, but they are incompatible with custom camera controls.
If you are using a Raspberry Pi Camera, the steps are a bit different. See this comprehensive guide for using a Raspberry Pi Camera.
If you don't know how to connect to your Raspberry Pi, see this guide. When you are connected, continue on to step 2 below.
Open your octopi.txt file with the nano editor by entering the following command followed by the Enter key:
sudo nano /boot/octopi.txt
You may be prompted to enter your password. After the command completes, you will see the nano text editor. Use the arrow keys and edit this section (it may look slightly different than what is pictured here, but it should be close):
Next, using the arrow keys move down to the bottom of the octopi.txt file and find the following section:
change the following text
#camera_http_webroot="./www-octopi"
#camera_http_options="-n"
to this:
camera_http_webroot="./www"
camera_http_options=""
Be careful to remove any # characters at the beginning of the lines! It should look like this when you are finished:
While you're here, you might want to adjust your camera's resolution and framerate. Find the camera_usb_options section and edit those now. For example, if you want a 1080P image at 30 frames per second, you would use the following:
camera_usb_options="-r 1920x1080 -f 30"
Be sure to refer to your camera's documentation when choosing a resolution and framerate. Not all resolutions/framerates are available for all cameras.
Make sure to remove any # characters from the beginning of the line!
and the end result will look something like this:
**Note: The higher the resolution and framerate, the more bandwidth and CPU power will be used. Higher frame rates will reduce the image acquisition time (possibly improving quality, especially when using a smart trigger with snap-to-print enabled). Also, some versions of firefox will have trouble showing a high framerate mjpegstream, but chrome seems to do just fine. Your mileage may vary, but if you have problems, try lowering your framerate from 30 frames per second to 10 frames per second.
Now we want to save the file and exit nano. Hold down the ctrl
key and press the letter O (so ctrl+O) to save the file. Press enter to confirm. Then press ctrl+Z to exit.
Octolapse is provided without warranties of any kind. By installing Octolapse you agree to accept all liability for any damage caused directly or indirectly by Octolapse.
Use caution and never leave your printer unattended.
If you have a great new guide, see a typo, or have other suggestions for improving the existing documentation, please let me know! You can either submit a feature request or submit a pull request. I would appreciate it greatly!
Consider supporting Octolapse by becoming a Patron, a Github Sponsor, or by sending some coffee/beer money, I would REALLY appreciate it. Almost all of the donations go towards offsetting the cost of development, which are substantial. Plus it always makes my day!
If you cannot afford to leave a tip or just don't want to, that is fine too! Octolapse is free and open source after all. There are other ways you can help ensure that Octolapse continues to be updated and improved:
- Share your Octolapse videos, and be sure to leave a link and explain that the timelapses were captured with Octolapse and OctoPrint (you will be asked how you made the timelapse, so this will also save you some time answering questions). This is not necessary, but it is greatly appreciated.
- Subscribe to my youtube channel.
- Post any bugs you find to the Issues Page. I would like to eliminate as many bugs as possible!
- Participate in the OctoPrint Community Forums, and help all the noobs get OctoPrint and Octolapse working and help expand the hobby. The more people use OctoPrint and Octolapse, the better the software will become!
- If you've created a working and tested printer profile for any printers that aren't in the make/model list, please send it to me! I want to make it as easy as possible for new users to get their printers configured quickly.
- Help me make this documentation better! Octolapse has a LOT of documentation, guides, tips, etc., both here in the Wiki and integrated with the Octolapse plugin. If you find inaccuracies, typos, gaps, or have ideas for improvement, I'd love to hear about them.
- If you have any special talents that could be applied to Octolapse development, like graphic design, video production (think tutorials), programming, etc., maybe you'd like to participate more directly in Octolapse development/documentation?