RGB to yuv420sp >> Accommodation >> Our Forum
Our Forum

Our Forum



SearchSearch   Users   Registration   Entrance
Today: 23.07.2025 - 20:22:44
Pages:  1  

RGB to yuv420sp

Advertising


MessageAuthor

Hi, I am trying to encode h264 video in realtime on android. The HW accelerated encoder requires yuv420sp encoded frames. Unfortunately, the input device generates RGB888/RGB565. It takes way too long to make the conversion on the CPU. I need a way to make the conversion on the GPU. I was thinking of a OpenGL shader but I'm not quite sure how to do it. I'm not even sure whether or not it is the best solution. Help would be appreciated. Cheers Morris Horesh

---------------------
Not long now.......

DCR62

users




Statistics:
Messages: 308
Registration: 03.05.2003
06.10.22 - 04:20:49
Message # 1
RE: RGB to yuv420sp

Back up a sec, it's possible to call HW video encoder on Android devices using Android APIs or native calls? I mean if I have yuv420 data available on the device, I can call the HW encoder interfaces to encode to a H.264 stream? I wonder how that's done, it would be great if you can point me some materials to read. Thanks a lot in advance.

---------------------

Sonic A

users




Statistics:
Messages: 362
Registration: 12.09.2002
06.10.22 - 04:25:37
Message # 2
RE: RGB to yuv420sp

I come here asking questions and I end up giving answers. I wonder if that would cause a Karma endless loop :) Android has a NDK OMX interface. I am using a rooted device so I can't tell you whether or not you can use it otherwise. this code may get you started: // some of these includes may not be required for this sample. I just copied everything #include <binder/IServiceManager.h> #include <binder/ProcessState.h> #include <media/IMediaPlayerService.h> #include <media/stagefright/MediaBuffer.h> #include <media/stagefright/MediaDebug.h> #include <media/stagefright/MediaDefs.h> #include <media/stagefright/OMXClient.h> #include <media/stagefright/MediaSource.h> #include <pthread.h> #include <media/IOMX.h> #include <binder/MemoryDealer.h> #include <OMX_Component.h> // get omx handle sp<IServiceManager> sm = defaultServiceManager(); sp<IBinder> binder = sm->getService(String16("media.player")); sp<IMediaPlayerService> service = interface_cast<IMediaPlayerService>(binder); sp<IOMX> iomx = service->getOMX(); List<IOMX::ComponentInfo> list; // list of componentName List<IOMX::ComponentInfo>::iterator it; // iterator to list through iomx->listNodes(&list); // display all supported codecs for ( it = list.begin(); it != list.end(); ++it) printf("%s\n",(*it).mName.string());

---------------------
- kchildre (www.kchildre.com)

kchildre

users




Statistics:
Messages: 524
Registration: 04.06.2003
06.10.22 - 04:28:59
Message # 3
RE: RGB to yuv420sp
Using webcam & display for Vocal Booth? : Previous topicNext topic: Two finger vertical scroll macbook fx window
Pages:  1  

The administrator has prohibited guests from replying to messages! To register, follow the link: register


Participants