Ask Your Question

jslavens's profile - activity

2016-09-27 16:20:01 -0600 asked a question video stream resolution UE4

I have implemented a simple OpenCV in Unreal Engine library to stream webcam video into the engine, but I am having trouble getting a higher resolution out of OpenCV. I am aware of the CV_CAP_PROP_FRAME_WIDTH and CV_CAP_PROP_FRAME_HEIGHT properties of cv::VideoStream, however modifying them changes nothing. I am only able to get a video resolution of 640x480.

I know that my video source is capable of 1920x1080 because I am using XSplit and have set the output to 1920, and the captured video in engine is cropped down so you only see about a quarter of the screen.

Here is my declaration of the video capture and subsequent attempts to change resolution:

cv::VideoCapture* stream;
stream = new cv::VideoCapture(CameraID);
stream->set(CV_CAP_PROP_FRAME_WIDTH, 1920);
stream->set(CV_CAP_PROP_FRAME_HEIGHT, 1080);

Opening and reading:

stream->open(CameraID);
stream->read(frame);

frame is a mat3b uninitialized until read to above:

cv::Mat3b frame;

If anyone has any insight I would appreciate it

EDIT: to add further, both set functions are returning true as though everything is working, but still getting the 480 video.