Get raw yuv data from cricket::VideoFrame to float

346 views
Skip to first unread message

Juan García

unread,
May 15, 2015, 2:03:17 PM5/15/15
to discuss...@googlegroups.com
I'm looking for a way to get raw YUV data in cricket::VideoFrame in YUV420 format to float. I need that to make one texture in OpenGL from a YUV frame. If anybody knows any other manner, all help is welcome.

Thanks in advance

Labádi Máté

unread,
May 15, 2015, 5:30:40 PM5/15/15
to discuss...@googlegroups.com

As far as I know you have to convert yuv format to rgba as Opengl can't render yuv directly, but rgba.
For the conversion you are encouraged to use shaders for a faster execution.

If I remember well there is an example for this in the AppRTCDemo Android app, as part of the webrtc code base. Probably there is a similar example for the Windows and Mac platform too.

On May 15, 2015 8:03 PM, "Juan García" <juang...@gmail.com> wrote:
I'm looking for a way to get raw YUV data in cricket::VideoFrame in YUV420 format to float. I need that to make one texture in OpenGL from a YUV frame. If anybody knows any other manner, all help is welcome.

Thanks in advance

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Juan García

unread,
May 18, 2015, 5:56:59 AM5/18/15
to discuss...@googlegroups.com
Thanks for your reply, if I understood well, I can make YUV to RGB conversion quickly. I'm looking for this in WebRTC repo but I can't find it, can you be more specific?
Message has been deleted

Labádi Máté

unread,
May 19, 2015, 3:34:07 AM5/19/15
to discuss...@googlegroups.com
The simplest, but not fastest way to get ARGB pixels from yuv is this: 

source->ConvertToRgbBuffer(cricket::FourCC::FOURCC_ARGB, dest, destSize, 0); 

where
source is a cricket::VideoFrame* variable, basically your source frame
dest is the memory pointer you want your ARGB image to be stored at
destSize is the number of the allocated bytes pointed by dest. In case of ARGB destSize MUST be (4 * imageWidth * imageHeight) bytes.

M.


2015-05-18 16:12 GMT+02:00 Juan García <juang...@gmail.com>:
Other option can be get a RGB raw data from cricket::VideoFrame. Any example? sorry I'm newbie. Thanks 
Reply all
Reply to author
Forward
0 new messages