gst-openmax omx_camera and omx_h264enc frame size

411 views
Skip to first unread message

Buru

unread,
Oct 5, 2011, 3:18:49 PM10/5/11
to pandaboard
Hello,

Does frame size sent to omx_h264enc has to be same as frame size
that is outputted by omx_camera?

I cannot get omx h264 to work if I take a frame from omx_camera,
crop it, and send it to omx_h264enc.

I take NV12 640x480 frame from omx_camera, crop NC12 frame
(256x256), then tie the pipeline to omx_h264enc.

If I do not crop then it works.

Is there any document that describes in detail parameters for
omx_h264enc?

Can someone please shed some light on this?

Thank you
Buru

Buru

unread,
Oct 10, 2011, 2:23:42 PM10/10/11
to pandaboard
Can anyone help ?

I modified videocrop to crop NV12 buffer and then send it to
omxh264enc, but I get buffer allignment error for some reason.

Following is the pipeline that I use :

gst-launch --gst-debug=3 --gst-debug=omx:7 omx_camera mode=1
focus=2 exposure=1 awb=1 vstab=false vnf=off name=cam cam.src !
"video/x-raw-yuv-strided, format=(fourcc)NV12, width=640, height=480,
framerate=30/2, buffer-count-requested=4" ! queue ! tee name=t t. !
v4l2sink min-queued-bufs=2 sync=false crop-top=0 crop-left=0 crop-
width=640 crop-height=480 device=/dev/video1 cam.vidsrc ! "video/x-
raw-yuv-strided, format=(fourcc)NV12, width=640, height=480,
framerate=30/2" ! videocrop name=crop_0_0 top=224 left=384 right=0
bottom=0 ! queue ! omx_h264enc input-buffers=2 output-buffers=2
bitrate=1000000 profile=2 level=256 ! queue ! filesink location=~/
Videos/record_h264.mp4

Following is errors I get :

----clip ---
[APPM3]: [ERR=737] omx_base_comp/src/omx_base.c:[1702]:Failed
check: ((OMX_U32)(pBuffer->pBuffer) pPort->sPortDef.nBufferAlignment)
== 0
[APPM3]: [ERR=738] omx_base_comp/src/omx_base.c:[1702]:Returning
error: OMX_ErrorBadParameter
[APPM3]: [ERR=739] omx_rpc/src/omx_rpc_skel.c:[716]:Component
returned error: 0x80001005
[APPM3]: [ERR=740] omx_base_comp/src/omx_base.c:[1702]:Failed
check: ((OMX_U32)(pBuffer->pBuffer) pPort->sPortDef.nBufferAlignment)
== 0
[APPM3]: [ERR=741] omx_base_comp/src/omx_base.c:[1702]:Returning
error: OMX_ErrorBadParameter
[APPM3]: [ERR=742] omx_rpc/src/omx_rpc_skel.c:[716]:Component
returned error: 0x80001005
----clip---

and
---clip---
0:00:03.511724684 3974 0x143ca8 DEBUG basetransform
gstbasetransform.c:1843:gst_base_transform_buffer_alloc:<capsfilter0>
got caps video/x-raw-yuv-strided, format=(fourcc)NV12,
rowstride=(int)4096, width=(int)640, height=(int)480,
framerate=(fraction)15/1, buffer-count-requested=(int)4
0:00:03.512121413 3974 0x143ca8 DEBUG basetransform
gstbasetransform.c:1866:gst_base_transform_buffer_alloc:<capsfilter0>
received required caps from peer
0:00:03.512274001 3974 0x143ca8 DEBUG omx
gstomx_port.c:357:release_buffer: <cam:out:2> FTB:
omx_buffer=0x14a800, pAppPrivate=0x155c78, pBuffer=0x467b0000
omx_proxy_common.c:692 PROXY_FillThisBuffer() ENTER:
hComponent=0x115b38, pCompPrv=0x115b98, pBuffer=0x467b0000,
nFilledLen=2949120, nOffset=0, nFlags=00000100
omx_proxy_common.c:699 PROXY_FillThisBuffer() TRACE: Buffer Index of
Match 0
omx_proxy_common.c:2100 RPC_PrepareBuffer_Remote() ENTER:
omx_proxy_common.c:2312 RPC_MapBuffer_Ducati() ENTER:
omx_proxy_common.c:2355 RPC_MapBuffer_Ducati() EXIT: eError: 0
omx_proxy_common.c:2312 RPC_MapBuffer_Ducati() ENTER:
omx_proxy_common.c:2355 RPC_MapBuffer_Ducati() EXIT: eError: 0
omx_proxy_common.c:2153 RPC_PrepareBuffer_Remote() EXIT: eError:
0
omx_rpc_stub.c:1224 RPC_FillThisBuffer() ENTER:
omx_rpc_stub.c:1264 RPC_FillThisBuffer() TRACE: pBufferHdr =
14a800 BufHdrRemote 41c790
omx_rpc_stub.c:1286 RPC_FillThisBuffer() EXIT:
omx_proxy_common.c:766 PROXY_FillThisBuffer() TRACE: Corresponding
RPC function executed successfully
omx_proxy_common.c:770 PROXY_FillThisBuffer() EXIT: eError: 0
0:00:03.518438552 3974 0x143ca8 DEBUG omx
gstomx_base_src.c:152:gst_omx_base_src_create_from_port:<cam>
buf=0x00155a98 (time=3:48:35.209869000, duration=99:99:99.999999999,
flags=00000000, size=2949120)
0:00:03.518591139 3974 0x143ca8 LOG omx
gstomx_base_src.c:174:gst_omx_base_src_create_from_port:<cam> end
0:00:03.518774245 3974 0x143ca8 DEBUG GST_CLOCK
gstclock.c:881:gst_clock_get_internal_time:<GstSystemClock> internal
time 3:48:25.644714356
omx_rpc_stub.c:1123 RPC_EmptyThisBuffer() ENTER:
0:00:03.519354079 3974 0x143ca8 DEBUG GST_CLOCK
gstclock.c:926:gst_clock_get_time:<GstSystemClock> adjusted time
3:48:25.644714356
omx_rpc_stub.c:1167 RPC_EmptyThisBuffer() TRACE: pBufferHdr =
44301b80 BufHdrRemote 559418
0:00:03.519506667 3974 0x143ca8 DEBUG omx
gstomx_camera.c:927:create:<cam> ******** preview buffers cont = 4
0:00:03.519628737 3974 0x143ca8 DEBUG omx
gstomx_camera.c:943:create:<cam> pushing vid_buf
0:00:03.519781325 3974 0x143ca8 DEBUG basetransform
gstbasetransform.c:2083:gst_base_transform_handle_buffer:<capsfilter2>
handling buffer 0x155a98 of size 2949120 and offset NONE
0:00:03.519903395 3974 0x143ca8 DEBUG basetransform
gstbasetransform.c:
1278:gst_base_transform_prepare_output_buffer:<capsfilter2> doing
inplace alloc
0:00:03.520025466 3974 0x143ca8 DEBUG basetransform
gstbasetransform.c:
1284:gst_base_transform_prepare_output_buffer:<capsfilter2> discard: 0
omx_rpc_stub.c:1189 RPC_EmptyThisBuffer() EXIT:
omx_proxy_common.c:633 PROXY_EmptyThisBuffer() TRACE: Corresponding
RPC function executed successfully
omx_proxy_common.c:633 PROXY_EmptyThisBuffer() ERROR: Returning
error, eError = 0x80001005
omx_proxy_common.c:652 PROXY_EmptyThisBuffer() EXIT: eError:
-2147479547

---clip---


On Oct 5, 3:18 pm, Buru <mdb...@gmail.com> wrote:
> Hello,
>
>    Does frame size sent to omx_h264enc has to be same as frame size
> that is outputted by omx_camera?
>
>    I cannot get omx h264 to work if I take a frame from omx_camera,
> crop it, and send it to omx_h264enc.
>
>    I takeNV12640x480 frame from omx_camera, crop NC12 frame

Vladimir Pantelic

unread,
Oct 11, 2011, 3:45:05 AM10/11/11
to panda...@googlegroups.com
Buru wrote:
> Can anyone help ?
>
> I modified videocrop to crop NV12 buffer and then send it to
> omxh264enc, but I get buffer allignment error for some reason.
>
> Following is the pipeline that I use :
>
> gst-launch --gst-debug=3 --gst-debug=omx:7 omx_camera mode=1
> focus=2 exposure=1 awb=1 vstab=false vnf=off name=cam cam.src !
> "video/x-raw-yuv-strided, format=(fourcc)NV12, width=640, height=480,
> framerate=30/2, buffer-count-requested=4" ! queue ! tee name=t t. !
> v4l2sink min-queued-bufs=2 sync=false crop-top=0 crop-left=0 crop-
> width=640 crop-height=480 device=/dev/video1 cam.vidsrc ! "video/x-
> raw-yuv-strided, format=(fourcc)NV12, width=640, height=480,
> framerate=30/2" ! videocrop name=crop_0_0 top=224 left=384 right=0
> bottom=0 ! queue ! omx_h264enc input-buffers=2 output-buffers=2
> bitrate=1000000 profile=2 level=256 ! queue ! filesink location=~/
> Videos/record_h264.mp4
>
> Following is errors I get :
>
> ----clip ---
> [APPM3]: [ERR=737] omx_base_comp/src/omx_base.c:[1702]:Failed
> check: ((OMX_U32)(pBuffer->pBuffer) pPort->sPortDef.nBufferAlignment)
> == 0

so what is wrong with the alignment?

Buru

unread,
Oct 12, 2011, 9:59:21 AM10/12/11
to panda...@googlegroups.com
Vladimir Pantelic <vladoman@...> writes:

Hello Vladimir,

The buffer that gets sent to APP M3 is not 32 aligned for some reason, and I
am still trying to figure out how is that happening.

This is log containing error I get from APP
[APPM3]: [MNU=60] rm_plugin_res/src/rm_pluginres_l3bus.c:[121]:User
requested L3BUS BW:23
[APPM3]: [MNU=61] rm_plugin_res/src/rm_pluginres_l3bus.c:
[125]:Request:: Setting L3BUS BW:1023
[APPM3]: MemMgr: return status = 1627389952
[APPM3]: MemMgr: return status = 2103050240
[APPM3]: MemMgr: return status = 1761611776
[APPM3]: MemMgr: return status = 1627394048
[APPM3]: MemMgr: return status = 2102984704
[APPM3]: MemMgr: return status = 1761619968
[APPM3]: [MNU=62]
omx_base_comp/src/omx_base.c:[1702]:pBuffer=0x7d2bf008 nBufferAlignment=32
[APPM3]: [ERR=63] omx_base_comp/src/omx_base.c:[1704]:Failed check:


((OMX_U32)(pBuffer->pBuffer) pPort->sPortDef.nBufferAlignment) == 0

[APPM3]: [ERR=64] omx_base_comp/src/omx_base.c:[1704]:Returning
error: OMX_ErrorBadParameter
[APPM3]: [ERR=65] omx_rpc/src/omx_rpc_skel.c:[716]:Component
returned error: 0x80001005
[APPM3]: [MNU=66]
omx_base_comp/src/omx_base.c:[1702]:pBuffer=0x7cfee008 nBufferAlignment=32
[APPM3]: [ERR=67] omx_base_comp/src/omx_base.c:[1704]:Failed check:


((OMX_U32)(pBuffer->pBuffer) pPort->sPortDef.nBufferAlignment) == 0

[APPM3]: [ERR=68] omx_base_comp/src/omx_base.c:[1704]:Returning
error: OMX_ErrorBadParameter
[APPM3]: [ERR=69] omx_rpc/src/omx_rpc_skel.c:[716]:Component
returned error: 0x80001005

Any help is much appreciated.

Thank you
Buru

------clip -----

Reply all
Reply to author
Forward
0 new messages