This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320DM8168: Help me about understanding element omxbufferalloc

Part Number: TMS320DM8168

I have some questions about omxbufferalloc. Could anyone help me for a second ?

Here is a pipeline.

gst-launch -e v4l2src device=/dev/video0 always-copy=false queue-size=8  ! 'video/x-raw-yuv,format=(fourcc)NV12,width=1920,height=1080,framerate=(fraction)30/1' ! omxbufferalloc numBuffers=8 ! omx_scaler !v4l2sink device=/dev/video1

In wiki, I know that "omxbufferalloc: Buffer allocater element used to allocate buffers that can be passed to OMX elements. E.g. V4L2 capture uses this to allocate buffers, which then can be passed to omx_h264enc without incurring a buffer copy"

1. Why doesn't v4l2src allocate these buffers in internal code? I think it must do this in internal initialization function.

2. I don't know how to omxbufferalloc and omx_h264enc communcate. omxbufferalloc creates some buffers, how to omx_h264enc gets these buffers.

3. Buffers can be passed to omx_h264enc without incurring a buffer copy

I understand omx_h264enc will use directly these buffers ( via pointer). As you know, H264 encoder will need to queue some frame to run motion compensation algorithm. How to know number of buffers which need for this process.

I ask this question because I am developing a system which run capture, image processing and streaming. I have a application run capture and image processing on frame which is saved in a shared region. To streaming, I write a LiveStreamer application to run gstreamer pipeline. It use a GstAppSrc to push frame data into.

appsrc --> omx_h264enc --> rtph264pay --> udpsink

To push frame data into appsrc, I use signal need-data, and push frame into.

+ Create and allocate GstBuffer buffer, copy frame data into

+ Push GstBuffer into queue: gst_app_src_push_buffer(appsrc, buffer);

This code works but system run very slowly. Therefore, I am studying omxbufferalloc and hope that can make an effective communication between appsrc and omx_h264enc.

Thanks !

  • Hello,

    If you are using v4l2src ... ! capsfilter ! omxbufferalloc ... ! omx_h264enc ! fakesink do you observe "slow running"?
    You could also check the omxbufferalloc source code. This code is allocated in ezsdk/component-sources/gst... folder also.


    BR
    Margarita