Raspberry Pi Camera V2 Settings?

When I edit the camera settings in octopi.txt for my raspi cam, it zooms in like crazy and crops out most of the frame.

I removed the hash tag for these two settings.

camera="raspi"
camera_raspi_options="-x 1920 -y 1080 -fps 30"

I am running the latest version of OctoPrint

This is my code:

This is my defaul setting result

This is my 1920x1080 settings result

1 Like

Nobody? I cant honestly be the first person to have this issue.

This is from a fresh install of Octoprint and the most popular camera for the platform.

1 Like

Let me test real quick for you and report back. Might just be you need to adjust the Stream aspect ratio in webcam & timelapse settings of OctoPrint?

I tried both 4:3 and 16:9 and all it does it add or remove black bars...

So it looks like it does the same for me on a PiZeroW with the v2 camera module. I think the answer may lie here and the parts about Field of View (FoV).

Hey buddy. I really appreciate the effort to solve this. I really think your onto something here...

I just tried the following settings:

With those settings, I am now getting this error:

I just tried 1640x1232 and its full view.

I take it this is the highest resolution possible with this camera using Octoprint?

So I take it my findings rules out the possibility of the "FoV" being the culprit?

What if the snapshot is dutifully returning a 1920x1080 and the OctoPrint interface is just centering the expected-sized portion from the middle?

You might want to add Themeify and adjust the CSS by inspecting what's what on the Control tab.

Its entirely possible but is this not a "bug" that the programmers should fix?

Solving it is beyond me.

I dunno, but it kind of looks like you're the one who changed the resolution, right?

Not sure what you mean. All I am trying to do is get the highest quality video that this camera can deliver while still being able to see the entire field of view.

@epiic,

The 3280x2464 resolution would likely severely impact your IO bandwidth, so I would recommend you don't use it even if you could get it to work.

That field of view stuff seems to be a limitation of the Raspicam, unfortunately. It's got a very nice price, but I find (some) traditional usb webcams to be more flexible and easier to use.

Thanks for the response. I had no idea. I was under the impression the Raspberry Pi cam was the best choice for Octoprint. What camera would give me the best quality?

'Best Quality' is a whole can of worms :slight_smile: It's not just about quality, either (though a high percentage). You want a camera with the following features:

  1. Good resolution - too high will lead to issues if you are streaming and printing from a raspberry pi. Obviously something like a 3B+ will do better than a Zero, and Lan works better than wifi, so you have to take your current setup into account. Remember, if you double the resolution (say 1080P to 4K) you actually increase the number of pixels by 4X. For a PI the information from the camera has to move from the camera to the pi, then back out through the wifi or lan. Since the PI shares IO bandwidth for all devices, this can quickly gobble up available IO.
  2. Flexible positioning - Most people will move their cameras around, so it's nice to have a cable that's decently long with good mounting options (standard mounting screw is usually great!)
  3. Built-in compression - You want the camera itself to perform compression, else your pi will have to do it.
  4. Ample Camera Configuration Settings - Some cameras support auto and manual focus (huge if you want a sharp image), zoom/pan/tilt (sometimes software based, sometimes mechanical), auto/manual white balance, etc.. For Octoprint you may sometimes want automatic settings (ease of use) and sometimes manual (full control, e.g. for timelapses)
  5. Image Quality - Beyond pure resolution image quality is a concern. Some cameras work better in lower light conditions. Some have better color accuracy. A lot of this is just 'matter of taste' stuff, some is a function of the camera itself.

You might even consider a camera that can stream natively. Some cameras (foscam) have built in streaming servers, and some include actual pan/tilt/zoom, which would be pretty nice. This could be pretty useful since you won't even need mjpgstreamer at all in this case. However, IOT devices should always be treated as insecure devices, ESPECIALLY cameras. Lots have known vulnerabilities. Another option is to buy a pi that is ONLY for streaming and use it as your streaming camera server. You need to make sure there is a direct URL for streaming and for still frames if you want to be able to both monitor and take snapshots.

A good middle-of-the-road camera is the Logitech C920. I got mine on-sale for 35$, but they usually run 50$ or so (the MSRP is $99, but I've never seen one cost that much). I've seen some stunning image quality from the Brio (super duper expensive, that's why I've only seen it and don't have one). There are lots of other great cameras out there, and I bet there are entire forums available to compare and contrast the different features.

I hope that helps somewhat. No matter what you do, keep your pi cam. It will come in handy even if you get a new webcam. It might be nice to have more than one camera angle, or a low res stream for some situations and a higher res stream for another.

2 Likes

Nice. Thank-you so much for the highly detailed response. The C920 looks fantastic but I am concerned about the auto-focus. Especially with the camera being so close to the bed.

FYI: I subscribed to you on YouTube. The " Octolapse Tutorial - Create and Customize Your Printer Profile" video you created was FANTASTIC!

Keep up the good work. :wink:

1 Like

The C920 allows both auto and manual focus. It can focus quite close up too. I don't recommend using the auto-focus at all for timelapse videos since it's nearly impossible to get a crisp video that way.

Also, thanks for your compliments!

  1. Enable camera
    sudo raspi-config -> Interfacing Options -> Camera -> Yes

  2. Reboot

  3. Check if camera working
    vcgencmd get_camera
    It'll reply with something like
    supported=1 detected=1

  4. Octopi.txt
    camera=raspi
    camera_raspi_options="-x 640 -y 480 -fps 10"

  5. Change camera_raspi_options for "bigger and better" if 640x480 works

I am having this exact problem.

Even if all I do is uncomment the following line without otherwise editing it, the camera zooms in.

camera_raspi_options="-fps 10"

If I do add an option like "-rot 90" it appears to be ignored.

Update.. now the -rot is working, but still zoomed in.

Hi,

I'm also experiencing this problem. was there a solution ?