UVC Camera

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

UVC Camera

1,789 Views
TalleyHo
Contributor II

When trying to display a simply camera image from gstreamer, isink is unable to allocate memory on the 68th frame (regardless of resolution):

W=320H=240
gst-launch -vvv v4l2src queue-size=4 device=/dev/video0 always-copy=0 ! "video/x-raw-yuv,format=(fourcc)YUY2,width=${W},height=${H}" ! identity ! mfw_isink axis-top=0 axis-left=0 disp-height=${H} disp-width=${W} sync=false rotation=0 fps-notify=1

 

 

# gst-launch -vvv v4l2src queue-size=4 device=/dev/video0 always-copy=0 ! \> "video/x-raw-yuv,format=(fourcc)YUY2,width=${W},height=${H}" ! \> identity ! \> mfw_isink axis-top=0 axis-left=0 disp-height=${H} disp-width=${W} sync=false rotation=0 fps-notify=1MFW_GST_ISINK_PLUGIN 2.0.2 build on Oct 28 2011 13:22:05.Setting pipeline to PAUSED ...                                                                                                                                                                                      /GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)YUY2, width=(int)640, height=(int)480, interlaced=(boolean)false, framerate=(fraction)30/1, width_align=(int)64, height_align=(int)64Pipeline is live and does not need PREROLL ...Setting pipeline to PLAYING ...New clock: GstSystemClock

...

 

/GstPipeline:pipeline0/GstIdentity:identity0: last-message = "chain   ******* (identity0:sink)i (614400 bytes, timestamp: 0:00:02.295924040, duration: 0:00:00.033333333, offset: 66, offset_end:  67, flags: 0) 0xe8950"/GstPipeline:pipeline0/GstIdentity:identity0: last-message = "chain   ******* (identity0:sink)i (614400 bytes, timestamp: 0:00:02.328636415, duration: 0:00:00.033333333, offset: 67, offset_end:  68, flags: 0) 0xe89f8"hwbuffer_allocator.c:256 ioctl error, return -1hwbuffer_allocator.c:256 ioctl error, return -1can not create hwbuf for size 6144000:00:03.142481000  4418    0xcb758 ERROR                default mfw_gst_isink.c:862:mfw_gst_isink_buffer_alloc: >>I_SINK: Could not allocate hardware buffer0:00:03.142832250  4418    0xcb758 ERROR                default mfw_gst_isink.c:1276:mfw_gst_isink_show_frame: Can not allocate ibuf for non-dma buffer, ret=-5/GstPipeline:pipeline0/GstIdentity:identity0: last-message = "chain   ******* (identity0:sink)i (614400 bytes, timestamp: 0:00:02.885061417, duration: 0:00:00.033333333, offset: 68, offset_end:  69, flags: 32) 0xe8800"

 

However, if I use videotestsrc ! mfw_isink, it will run all day.  Likewise, if I use fakesink, it will run all day.  What makes mfw_isink and v4l2src incompatible?  

 

The only way to get this to reliably work is to pipe it thru an encode/decode loopback.  

gst-launch -vvv v4l2src queue-size=4 device=/dev/video0 always-copy=1 ! "video/x-raw-yuv,format=(fourcc)YUY2,width=${W},height=${H},framerate=(fraction)30/1" ! mfw_ipucsc ! mfw_vpuencoder codec-type=std_avc width=${W} height=${H} loopback=true ! \mfw_vpudecoder parser=false loopback=true ! mfw_isink axis-top=0 axis-left=0 disp-height=${H} disp-width=${W} sync=false rotation=0 fps-notify=1

 

I've tried a variety of options as well as adding my own (fps-notify).  I've also updated to the latest git version of gstreamer (0.10.35) as well as the plugins.  

 

I'm poking around the hwbuffer_allocator now.  

 

Mx53 w/ 11.05 BSP.

Tags (1)
6 Replies

1,092 Views
KanHU
Contributor III
Great to hear that. It will be pushed for next release.
0 Kudos

1,092 Views
TalleyHo
Contributor II
Thanks!  That seems to have fixed the issue.
0 Kudos

1,092 Views
KanHU
Contributor III

It's a bug I think.

If you can build from the source, please try the following patch.

1,092 Views
TalleyHo
Contributor II

V4lsink may work - but I am unable to use that.  I suspect you'll see the failure with mfw_isink if you run the following pipeline.

gst-launch -vvv v4l2src ! identity ! mfw_isink

 

I've run this on 11.03, and now the latest 11.09 and they both fail.  It's very similar to an older bug that was fixed in which videotestsrc ! mfw_isink would fail after a short time.  We are not running w/ X11 or Ubuntu.

0 Kudos

1,092 Views
fabio_estevam
NXP Employee
NXP Employee

This pipeline works for me on a 11.03 BSP:

 

gst-launch v4l2src  ! mfw_v4lsink

 

Regards,

 

Fabio Estevam

0 Kudos

1,092 Views
TalleyHo
Contributor II

It seems a new BSP is out, so I'll have a look at the updates to the gst-fsl-plugins.  In the mean time, I've found something of interest.

 

When using the loopback method, the function mfw_free_hw_buffer ultimately gets called after every frame.  However, when going the direct route (v4l2src to isink), this function is never called, and I effectively run out of memory pools.  

0 Kudos