+1 vote

I have a simple 3D scene, and a pluggedIn webcam. Shouldn't CameraServer now show one CameraFeed?

in Engine by (62 points)

Have you looked at the latest documentation for CameraFeed? Especially this part of the description?

Note: Many cameras will return YCbCr images which are split into two textures and need to be combined in a shader. Godot does this automatically for you if you set the environment to show the camera image in the background.

Hi,
yes I saw this. I built a simple scene with only a camera, put an environment to this camera and set the background to "CameraFeed", full energy and CameraFeed Id 1. I don't know if I'm totaly wrong, but I think for this to work there has to be a CameraFeed yet. When testing this with

print(str(CameraServer.get_feet_count()))

that gives "0". So no chance to set a CameraFeed to "active". Also tried to instanciate one with "CameraFeed.new()", but looks like this one has no connection to any physical device. Totaly lost in figuring out how this should work, but I guess there has to be a CameraFeed in CameraServer as soon as you connect a physical device.

1 Answer

+2 votes

I also tried it but then I noticed that it isn't possible right now - at least if you are not working with iOS/OSX.
If you follow the discussion in the PR you see that Bastiaan had problems getting this running on Windows, Linux and Android. Android will soon get a working implementation by using ARCore.

As I wasn't sure that this might be implemented in the meantime I checked the godot repository and saw this:

#include "camera_win.h"

///@TODO sorry guys, I got about 80% through implementing this using DirectShow only
// to find out Microsoft deprecated half the API and its replacement is as confusing
// as they could make it. Joey suggested looking into libuvc which offers a more direct
// route to webcams over USB and this is very promising but it wouldn't compile on
// windows for me...I've gutted the classes I implemented DirectShow in just to have
// a skeleton for someone to work on, mail me for more details or if you want a copy....
by (1,028 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.