0

I want to access camera and get both encoded and not-encoded video from it in my C++ application. As I'm targetting Raspberry Pi Zero, I want it to be as efficient as possible, so I decided to use OpenMAX, since this seems like the most low-lever layer I can actually use.

What I am aiming at is an application that will:

  • get not-encoded YUV video data from the camera and analyze it every few dozens of frames
  • get encoded H264 video and send it through TCP socket
  • do some other things in the background (not really important right now)

So it looks like to achieve that using OpenMAX, I need a camera module tunneled to splitter module, which would tunnel video data to video encoder and allow getting raw video from one of the unused ports. But for some reason I can't get it to work. My workflow looks in general like this (I can't share exact code right now, will try to do it later when I have the opportunity):

  1. create components
  2. tunnel camera to splitter
  3. tunnel splitter to encoder
  4. set all components to state idle
  5. set all components to state exectuing
  6. start getting video data

The problem is that I can't even set my splitter component to exectuing state like this - the error I get is "not sufficent resources". I thought that maybe it's because I didn't enable second output port on splitter and didn't allocate a buffer for it, but it doesn't fix it, either.

I tried various combinations of things: enabling ports and allocating buffers, disabling propertiary communication, changing the order in which components are moved to state exectuing, moving them to state loaded between idle and running... I simply ran out of ideas, and the information on how to use splitter component are quite limited on the net. What's funny: above workflow works if I just have camera and encoder and tunnel them directly. I just can't seem to find an option to mix in splitter in between.

1 Answer 1

0

Eventually I decided to use MMAL instead of OpenMAX, as I read somewhere it's optimized well enough so there aren't any performance issues. So far it works fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.