cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer
Observer
1,417 Views
Registered: ‎04-18-2018

Usging gstreamer omxh264dec element with dmabuffers

Jump to solution

We are using a custom sink to feed a mixer layer to provide an overlay. We are attempting to use DMAbuffers to eliminate the need to copy from the VCU output to our video buffer. In order to achieve this we have implemented a pool that provides dmabuf buffers, but the omxh264dec fails to use these buffers.

The code at https://github.com/AyodaGmbH/gstreamer-test-ayoda is a minimal failing example. It contains a simple sink that ignores its input and a bufferpool that obtains dmabuf buffers from the VCU driver.

The output from the pipeline gst-launch-1.0 filesrc location=bbb_sunflower_2160p_30fps_normal_avc.mp4 ! qtdemux name=demux demux.video_0 ! queue ! h264parse ! omxh264dec ! queue ! ayodasink use-dmabuf=true

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...

** (gst-launch-1.0:3094): CRITICAL **: gst_video_info_from_caps: assertion 'caps != NULL' failed
ERROR: from element /GstPipeline:pipeline0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0: Could not configure supporting library.
Additional debug info:
../../git/omx/gstomxvideodec.c(2016): gst_omx_video_dec_loop (): /GstPipeline:pipeline0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0:
Invalid sized input buffer
Execution ended after 0:00:00.290478397
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

The pipeline gst-launch-1.0 filesrc location=bbb_sunflower_2160p_30fps_normal_avc.mp4 ! qtdemux name=demux demux.video_0 ! queue ! h264parse ! omxh264dec ! queue ! ayodasink use-dmabuf=false does not use dmabuf buffers and works as expected (doing nothing).

 

I have attached a compiled version of the gstreamer plugin. Is there a way to make the omxh264dec element work with dmabuf?

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Observer
Observer
1,296 Views
Registered: ‎04-18-2018

Re: Usging gstreamer omxh264dec element with dmabuffers

Jump to solution

Yes, we have managed to solve the issue somewhat.

omxh264dec does not support using a different buffer pool (with dmabuf). To make it generate dmabuf on its own you need to have the following in propose_allocation:

static gboolean gst_my_sink_propose_allocation(GstBaseSink *basesink, GstQuery *query)
{
    GstMySink *sink = GST_MY_SINK_CAST (basesink);

    gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);

    return true;
}

 Make sure to read the offset of the chroma layer (at 4k NV12 it adds 16 lines padding between the layers).

View solution in original post

3 Replies
Highlighted
Explorer
Explorer
1,306 Views
Registered: ‎10-03-2018

Re: Usging gstreamer omxh264dec element with dmabuffers

Jump to solution

Good day @vsavu,

Have you had any successes in resolving your problem(s)? 

I am working to do something similar, however my work will transfer over PCIe to another device in the system. 

It looks like you are not setting the buffer size in your code.  Could that be the root problem? 

Any input you have for me is much appreciated. 

Good Luck! 

Kind Regards,
Peimann, S. M.
----
Toddlers are the Storm-Troopers of the Great God Entropy.
Physics: Not Just a Good Idea, It's THE LAW.
0 Kudos
Observer
Observer
1,297 Views
Registered: ‎04-18-2018

Re: Usging gstreamer omxh264dec element with dmabuffers

Jump to solution

Yes, we have managed to solve the issue somewhat.

omxh264dec does not support using a different buffer pool (with dmabuf). To make it generate dmabuf on its own you need to have the following in propose_allocation:

static gboolean gst_my_sink_propose_allocation(GstBaseSink *basesink, GstQuery *query)
{
    GstMySink *sink = GST_MY_SINK_CAST (basesink);

    gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);

    return true;
}

 Make sure to read the offset of the chroma layer (at 4k NV12 it adds 16 lines padding between the layers).

View solution in original post

Highlighted
Explorer
Explorer
1,280 Views
Registered: ‎10-03-2018

Re: Usging gstreamer omxh264dec element with dmabuffers

Jump to solution

Many thanks @vsavu,

We shall see where it goes...

Kind Regards,
Peimann, S. M.
----
Toddlers are the Storm-Troopers of the Great God Entropy.
Physics: Not Just a Good Idea, It's THE LAW.
0 Kudos