Change video stream size in vrVideoGrab

Change video stream size in vrVideoGrab

chr33z
Advocate Advocate
607 Views
1 Reply
Message 1 of 2

Change video stream size in vrVideoGrab

chr33z
Advocate
Advocate

Hi there!

 

In the examples there is a vrVideoGrab example that changes the video stream size by passing the resolution to the constructor of vrVideoGrab

 

screen = createPlane(2000, 1000, 1, 1, 0,0,0)
screen.setRotation(90,0,0)
screen.setTranslation(0, 0, 500)

# vg = vrVideoGrab(screen, "LifeView")
# specify a resolution.
vg = vrVideoGrab(screen, "Integrated Webcam", 768, 576)
vg.setActive(true)

However, any video stream resolution I put in the constructor fails to actually change the video stream. The result is always something like this (for any VRED version 2017, 2018 and 2019):

Setting video resolution to 768 x 576
vrFrameGrabber::init : Couldn't set format, trying default resolution 1280 x 720
vrFrameGrabber::init : Couldn't set format.


Is there any way to change the video resolution in vrVideoGrab?

 

I want to do some processing on the video frames and therefore have to access the pixel data. But accessing 1920x1080 pixels in real time slows down performance a bit... Lowering the resolution would be no problem, however.

 

Alternatively:

Do you think it would be possible to grab the video stream with openCV and inject the frame data into a material?

Accepted solutions (1)
608 Views
1 Reply
Reply (1)
Message 2 of 2

chr33z
Advocate
Advocate
Accepted solution

I tested some other video sources and found that it totally depends on the resolutions provided by that import source. So... no fault here. My initially testet video sources just only provided one resolution that could not be changed.

 

What is irritating nonetheless:

Despite specifing the exact resolution of the input source, VRED spits our a warning that the resolution cannot be changed

 

Setting video resolution to 1280 x 720
vrFrameGrabber::init : Couldn't set format, trying default resolution 1280 x 720
vrFrameGrabber::init : Couldn't set format. 

 

0 Likes