ffelagund
Posts: 30
Joined: Wed Nov 21, 2012 7:53 pm

Frame as OpenGL texture

Tue Jun 18, 2013 9:36 am

Hello,

Sorry if this question has been answered before (I didn't find something similar)
I would want to know if there are a possibility of getting the frame as an OpenGL texture. I know I can take the frames produced by raspistill or raspivid and create an OpenGL texture based on that data, but that's inneficient because there are steps that one doesn't really need to display a frame included in that pipeline (like jpg encoding/decoding)

So, my real question is: Is there a way to display 1080p video using OpenGL?

Thank you in advance :)
Jacobo.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5537
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Frame as OpenGL texture

Tue Jun 18, 2013 3:24 pm

It is possible. James did start on a RaspiTex.cpp demo app that captures camera data to a texture, but it wasn't working when I last saw it.

ffelagund
Posts: 30
Joined: Wed Nov 21, 2012 7:53 pm

Re: Frame as OpenGL texture

Wed Jun 19, 2013 6:40 pm

If I would know how to get unprocessed data (raw, yuv or whatever) in a fast way, I could do the OpenGL part, but I hadn't studied yet the current data pipeline (because those days I dont have much free time :/ ) provided within raspistill/raspivid. I think taking that as base, the rest should be easy.

I'll try next week to take a look in the code to see if I can figure out the process :)

ratwix
Posts: 12
Joined: Wed Sep 12, 2012 12:21 pm

Re: Frame as OpenGL texture

Thu Jun 27, 2013 12:28 pm

I'm interessed as well. If you have any solution, let me know :)

Mericam
Posts: 2
Joined: Sat Jun 01, 2013 8:18 pm

Re: Frame as OpenGL texture

Fri Jul 19, 2013 1:20 pm

I'm also really interested in this. Any update?

Ed_was_here
Posts: 4
Joined: Thu Oct 18, 2012 1:16 am

Re: Frame as OpenGL texture

Sat Jul 20, 2013 9:08 pm

I made a working video texture cube using ilcient based on the videocube and video examples by OtherCrashOverride and HJ Imbens.
See https://github.com/ed-was-here/userland ... xture_cube

It integrates nicely with pyopengles if you call video_camera_test() with your eglImage. The setup should be like in init_textures.
I'm still cleaning up a more complete demo in python. Suggestions are welcome.

TESKAn
Posts: 11
Joined: Tue May 21, 2013 8:09 pm

Re: Frame as OpenGL texture

Sun Jul 21, 2013 6:46 pm

I played with this a while back. First attempt was to hack together raspivid and hello_videocube by passing encoded data from raspivid to hello_videocube. It worked, but was slow, only able to handle low-res and had a terribile lag.
Second attempt was trying to get camera working with OMX components, so I could substitute decoder component in hello_videocube with omx_camera component. Newer got it to work, but I think it is the right way to go.
Now I am using raspivid to display video on screen and OpenGL to draw 3D objects over it, it works and is all that I need.

Return to “Camera board”