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.

Capture and Display using GStreamer v4l2 fails

I have had a rough time trying to build a pipeline that will capture/encode and display at the same time. This is the pipeline I'm trying to build that should work:

gst-launch -v v4l2src always-copy=false queue-size=12 num-buffers=2000 ! 'video/x-raw-yuv-strided,format=(fourcc)YUY2,width=1920,height=1080,framerate=(fraction)30/1' ! omxbufferalloc numBuffers=12 ! tee name=t ! queue ! gstperf ! v4l2sink show-preroll-frame=false sync=false min-queued-bufs=2 t. ! queue ! omx_noisefilter ! omx_h264enc force-idr-period=300 i-period=100 bitrate=5000000 ! filesink location=/data1/v4l2cap_again.h264

It outputs/fails as:

root@dm816x-evm:~# gst-launch -v v4l2src always-copy=false queue-size=12 num-buf
fers=2000 ! 'video/x-raw-yuv-strided,format=(fourcc)YUY2,width=1920,height=1080,
framerate=(fraction)30/1' ! omxbufferalloc numBuffers=12 ! tee name=t ! queue !
gstperf ! v4l2sink show-preroll-frame=false sync=false min-queued-bufs=2 t. ! qu
eue ! omx_noisefilter ! omx_h264enc force-idr-period=300 i-period=100 bitrate=50
00000 ! filesink location=/data1/v4l2cap.h264                                   
Setting pipeline to PAUSED ...                                                  
                                                                                
** (gst-launch-0.10:1546): CRITICAL **: gst_v4l2sink_sync_rotation: assertion `v
4l2_ioctl (fd, VIDIOC_S_CTRL, &control) >= 0' failed                            
                                                                                
** (gst-launch-0.10:1546): CRITICAL **: gst_v4l2sink_sync_rotation: assertion `v
4l2_ioctl (fd, VIDIOC_S_CTRL, &control) >= 0' failed                            
                                                                                
** (gst-launch-0.10:1546): CRITICAL **: gst_v4l2sink_sync_flip: assertion `v4l2_
ioctl (fd, VIDIOC_S_CTRL, &control) >= 0' failed                                
                                                                                
 Mode set is 1080                                                               
allocating 12 buffers of size:4147200!!                                         
allocated outbuf:0x49277600                                                     
allocated outbuf:0x4966be00                                                     
allocated outbuf:0x49a60600                                                     
allocated outbuf:0x49e54e00                                                     
allocated outbuf:0x4a249600                                                     
allocated outbuf:0x4a63de00                                                     
allocated outbuf:0x4aa32600                                                     
allocated outbuf:0x4ae26e00                                                     
allocated outbuf:0x4b21b600                                                     
allocated outbuf:0x4b60fe00                                                     
allocated outbuf:0x4ba04600                                                     
allocated outbuf:0x4bdf8e00                                                     
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw-yuv-st
rided, format=(fourcc)YUY2, rowstride=(int)3840, framerate=(fraction)30/1, width
=(int)1920, height=(int)1080                                                    
Pipeline is live and does not need PREROLL ...                                  
Setting pipeline to PLAYING ...                                                 
New clock: GstSystemClock                                                       
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw-
yuv-strided, format=(fourcc)YUY2, rowstride=(int)3840, framerate=(fraction)30/1,
 width=(int)1920, height=(int)1080                                              
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw
-yuv-strided, format=(fourcc)YUY2, rowstride=(int)3840, framerate=(fraction)30/1
, width=(int)1920, height=(int)1080                                             
/GstPipeline:pipeline0/GstomxBufferAlloc:omxbufferalloc0.GstPad:src: caps = vide
o/x-raw-yuv-strided, format=(fourcc)YUY2, rowstride=(int)3840, framerate=(fracti
on)30/1, width=(int)1920, height=(int)1080                                      
/GstPipeline:pipeline0/GstomxBufferAlloc:omxbufferalloc0.GstPad:sink: caps = vid
eo/x-raw-yuv-strided, format=(fourcc)YUY2, rowstride=(int)3840, framerate=(fract
ion)30/1, width=(int)1920, height=(int)1080                                     
/GstPipeline:pipeline0/GstTee:t.GstPad:sink: caps = video/x-raw-yuv-strided, for
mat=(fourcc)YUY2, rowstride=(int)3840, framerate=(fraction)30/1, width=(int)1920
, height=(int)1080                                                              
/GstPipeline:pipeline0/GstTee:t.GstPad:src1: caps = video/x-raw-yuv-strided, for
mat=(fourcc)YUY2, rowstride=(int)3840, framerate=(fraction)30/1, width=(int)1920
, height=(int)1080                                                              
/GstPipeline:pipeline0/GstTee:t.GstPad:src0: caps = video/x-raw-yuv-strided, for
mat=(fourcc)YUY2, rowstride=(int)3840, framerate=(fraction)30/1, width=(int)1920
, height=(int)1080                                                              
/GstPipeline:pipeline0/GstTee:t.GstPad:sink: caps = video/x-raw-yuv-strided, for
mat=(fourcc)YUY2, rowstride=(int)3840, framerate=(fraction)30/1, width=(int)1920
, height=(int)1080                                                              
/GstPipeline:pipeline0/GstQueue:queue1.GstPad:sink: caps = video/x-raw-yuv-strid
ed, format=(fourcc)YUY2, rowstride=(int)3840, framerate=(fraction)30/1, width=(i
nt)1920, height=(int)1080                                                       
/GstPipeline:pipeline0/GstQueue:queue1.GstPad:src: caps = video/x-raw-yuv-stride
d, format=(fourcc)YUY2, rowstride=(int)3840, framerate=(fraction)30/1, width=(in
t)1920, height=(int)1080                                                        
/GstPipeline:pipeline0/GstOmxNoiseFilter:omxnoisefilter0.GstPad:sink: caps = vid
eo/x-raw-yuv-strided, format=(fourcc)YUY2, rowstride=(int)3840, framerate=(fract
ion)30/1, width=(int)1920, height=(int)1080                                     
/GstPipeline:pipeline0/GstOmxNoiseFilter:omxnoisefilter0.GstPad:sink: caps = vid
eo/x-raw-yuv-strided, format=(fourcc)YUY2, rowstride=(int)3840, framerate=(fract
ion)30/1, width=(int)1920, height=(int)1080                                     
/GstPipeline:pipeline0/GstOmxNoiseFilter:omxnoisefilter0.GstPad:src: caps = vide
o/x-raw-yuv, width=(int)1920, height=(int)1080, format=(fourcc)NV12, framerate=(
fraction)30/1                                                                   
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw-yuv-strid
ed, format=(fourcc)YUY2, rowstride=(int)3840, framerate=(fraction)30/1, width=(i
nt)1920, height=(int)1080                                                       
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = video/x-raw-yuv-stride
d, format=(fourcc)YUY2, rowstride=(int)3840, framerate=(fraction)30/1, width=(in
t)1920, height=(int)1080                                                        
/GstPipeline:pipeline0/Gstperf:perf0.GstPad:src: caps = video/x-raw-yuv-strided,
 format=(fourcc)YUY2, rowstride=(int)3840, framerate=(fraction)30/1, width=(int)
1920, height=(int)1080                                                          
/GstPipeline:pipeline0/Gstperf:perf0.GstPad:sink: caps = video/x-raw-yuv-strided
, format=(fourcc)YUY2, rowstride=(int)3840, framerate=(fraction)30/1, width=(int
)1920, height=(int)1080                                                         
/GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0.GstPad:sink: caps = video/x-raw-yuv
-strided, format=(fourcc)YUY2, rowstride=(int)3840, framerate=(fraction)30/1, wi
dth=(int)1920, height=(int)1080                                                 
unrecoverable error: There were insufficient resources to perform the requested
operation (0x80001000)                                                          
ERROR: from element /GstPipeline:pipeline0/GstOmxNoiseFilter:omxnoisefilter0: GS
treamer encountered a general stream error.                                     
Additional debug info:                                                          
gstomx_base_filter.c(669): pad_chain (): /GstPipeline:pipeline0/GstOmxNoiseFilte
r:omxnoisefilter0:                                                              
Error from OpenMAX component                                                    
Execution ended after 55863555 ns.                                              
Setting pipeline to PAUSED ...                                                  
Setting pipeline to READY ...                                                   
                                                                                
!!!!!!!!!unreference all the remaining buffers!!!!!!!!!/GstPipeline:pipeline0/Gs
tV4l2Sink:v4l2sink0.GstPad:sink: caps = NULL                                    
                                                                                
(gst-launch-0.10:1546): GLib-GObject-WARNING **: invalid unclassed pointer in ca
st to `GstMiniObject'                                                           
/GstPipeline:pipeline0/Gstperf:perf0.GstPad:src: caps = NULL                    
/GstPipeline:pipeline0/Gstperf:perf0.GstPad:sink: caps = NULL                   
/GstPipeline:pipeline0/GstOmxNoiseFilter:omxnoisefilter0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstOmxNoiseFilter:omxnoisefilter0.GstPad:sink: caps = NUL
L                                                                               
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = NULL                  
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = NULL                 
/GstPipeline:pipeline0/GstQueue:queue1.GstPad:src: caps = NULL                  
/GstPipeline:pipeline0/GstQueue:queue1.GstPad:sink: caps = NULL                 
/GstPipeline:pipeline0/GstTee:t.GstPad:src1: caps = NULL                        
/GstPipeline:pipeline0/GstTee:t.GstPad:src0: caps = NULL                        
/GstPipeline:pipeline0/GstTee:t.GstPad:sink: caps = NULL                        
/GstPipeline:pipeline0/GstomxBufferAlloc:omxbufferalloc0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstomxBufferAlloc:omxbufferalloc0.GstPad:sink: caps = NUL
L                                                                               
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = NULL        
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = NULL       
                                                                                
(gst-launch-0.10:1546): GStreamer-CRITICAL **: gst_mini_object_unref: assertion
`GST_IS_MINI_OBJECT (mini_object)' failed                                       
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = NULL              
Setting pipeline to NULL ...                                                    
Freeing pipeline ...

Any ideas why omx_noisefilter seems to keep failing? I can capture/encode OR capture/display but I cannot do both concurrently. I have tried with and without queues and moved the tee around but the failure is always he same (or simply cannot connect pads depending on where the tee is at).

Does someone have a working pipeline example to capture/encode/display using v4l2 and gst-launch?

Thanks,

-Troy