After many days of finding a solution, I have finally found one.
- I made a copy of the OpenCV plugin from the Engine and added it to my project’s plugins.
- Downloaded the GStreamer Runtime and Devkit for Windows.
- Rebuilt OpenCV using CMake (making sure to include the provided Unreal module as an extra module), including most of the modules that Epic left out, namely GStreamer.
- Use GStreamer as my video API, by using:
VideoStream.open("autovideosrc ! videoconvert ! appsink", cv::CAP_GSTREAMER);
- Video and Camera now works.
Ultimately, I was unable to ever get anything other than GStreamer to work for cameras and I still don’t know why. They were all included in the plugin.
MSMF: (opens camera but doesn’t grab frames)
DirectShow: (infinitely holds up when trying to open camera)
OpenNI2: (crashes when trying to open camera)
I did get FFMPEG to work for videos, but GStreamer ended up performing way better (it seems to take advantage of the GPU way better).
I also managed to get CUDA working perfectly by following normal OpenCV instructions.
The camera does read super slow and is only using the CPU. I will have to build GStreamer from source to install some plugins that can help with this.