Video capturing using gopro hero3 and avermedia

Hi everyone

I’ve been struggling to get normal video capture from gopro hero3 and avermedia extremecap u3
Here’s my setting:

my latop —(USB 3.0)— Avermedia Extremecap U3 —(HDMI)— gopro hero3

and the following is my code in testApp.cpp:

void testApp::setup()
{
    camWidth = 1920;
    camHeight = 1080;

    cam.setDesiredFrameRate(30);
    cam.initGrabber(camWidth, camHeight);


    cameraPixels = new unsigned char[1920 * 1080 * 3];
    camTexture.allocate(1920, 1080, GL_RGB);

}

//--------------------------------------------------------------
void testApp::update()
{
    cam.update();

    if(cam.isFrameNew())
    {
        int totalPixels = 1920 * 1080 * 3;

        unsigned char *pixels = cam.getPixels();

        for(int i=0;i<totalPixels;i++)
        {
            cameraPixels[i] = pixels[i];
        }

        camTexture.loadData(cameraPixels, 1920, 1080, GL_RGB);
    }

}

//--------------------------------------------------------------
void testApp::draw()
{
    camTexture.draw(0,0, 640, 480);
}

I’ve also tried to simply use

cam.update();

and

cam.draw(0,0);

in update() and darw() respectively, but all yielding one result, which is a weird distorted image.
However, when I use the control software that comes with the avermedia, I can see a undistorted image, so clearly I’m missing something here in my code, maybe in setting up the video format?

What would I have to change my code to get the normal video capture back?
Any help would be greatly appreciated

Do you have a capture of whats its looking like?. Maybe the settings on the camera are different than 1920x1080 so you get a disorted image.
When working with external cameras sometimes you have to set everything to manual mode so you have more control over the device.

Hope it helps.

This is what it currently looks like:

and this is what it supposes to look like:

I’ve noticed that setting the height and width for ofVideoGrabber seems to only affect the “container” itself (which is the videoGrabber object), but not the video stream itself. Are there any ways to set the video stream?
Also, I would like to know what do you mean by “set everything to manual mode”? As I’m quite new to using OpenFrameWorks, I’m not quite catching you here. If possible, any example codes are greatly appreciated.

It looks like a color space issue - the Extremecap may output YUV?

I would try using 4 channels/GL_RGBA first

1 Like

Sorry for my bad english xD.
What this “set everything to manual mode” means is that many software or webcam drivers ussually have their own auto settings Like “gain, brightness zoom, resolution, etc”. And sometimes you have to set that to manual mode and define your own values.

It looks like the image being draw has different resolution from the input and thats why you are getting like a quarter of the image expanded.
Maybe you can try to change the resolution of the videograbber instance or maybe you can try to use the videograbber.listDevices() function to see what cameras is openframeworks recognizing?.

From the console window, it suggests that the closest support size is YUY2 @ 1920 1080
(just quoting from the console window).

I would like to know using 4 channels/GL_RGBA means setting the arrays size of 1920 * 1080 * 4 and setting the glFormat as GL_RGBA?

I’ve done the above but when I run the program, it hangs and forced to be shutdown, giving a “Process returned 255 (0xFF)” error. What would I need to do to fix that? (sorry I don’t have much experience in handling pixels)

I’ve looked thought the control software that comes with Extremecap U3, and I think I’ve set everything to auto.
Here’s the screenshot of the setting in the control software:

I’ve noticed that in the console window when I run my program, it gives a “SETUP: Default Format is set to 640 by 480” message. This is probably telling me that the video stream resolution is not being set correctly(which should be 1920 x 1080), are there any ways to force set this value?

another quick update:
I’ve tried to use videoInput that comes with OpenFrameWorks as it provides more seem-to-be-more-promising functions in handling video, but also no avail. Using videoInput still give the wrong image as I posted above. The actual used size is still 640 by 480 even though I requested a size of 1920 by 1080.

Apart from that, I’ve downloaded AMCap to see if the driver is working correctly, and by adjusting the output size in video capture pin to use 1920 x 1080, it gives the normal image. That means the driver is working correctly but ofVIdeoGrabber and videoInput fail to set up something here.

I’ve been struggling here for a few days so any help would be greatly appreciated

pump and a quick updated:
It seems that in videoInput, there’s no code implemented for video serial digital for physical connection. It seems that in order for videoInput to work, I’ll have to modify it a bit, but currently I’m unable to compile it again in code blocks.

The one I’m trying to download is from here. I’m using Code::Blocks v12.11, OpenFrameWorks v0.8.0. The compiler is GNU GCC compiler

pump and a new updated:
so here’s the console window when I’m running the program, I’ve switched to VI for further experiment

as you can see I’m trying to request a size of 1920 x 1080, but somehow due to a crossbar issue, I’m stuck in 640 x 480. In VI.setupDevice(), I’ve tried all VI_COMPOSITE, VI_S_VIDEO, VI_TUNER, VI_USB, VI_1394, but still no avail.

giving it a pump

Hi Cipher, I am looking for an HDMI capture solution for windows. How was your try with Avermedia Extremecap U3 finally doing?

hey man sorry for the late reply, was quite busy earlier and I totally forgot to reply.

So back to the topic, sadly I can’t get any good result with Avermedia Extremecap U3. My final solution for that project was to use another tool called “VVVV” (that 4 Vs, it’s a multipurpose visual programming tool) and luckily I got a BlackMagic Intensity Shuttle (HDMI to USB3.0) and that got the things done.

If you want to follow my approach, be really warned that the BM Intensity Shuttle is really sensitive with drivers, I remember I need to use a specific driver version (v9 or v10, can’t really remember though) for it to work stable under win7 and VVVV