Hi,
I'm using an i.MX6 quad on a Gateworks board.
My problem is, that I try to get a MPJEG stream from a USB camera, decode it, encode it to h264 and set up RTSP Server on Top.
What's the best way to do it? RAW stream from USB camera would work, but cause of USB limitiation the fps (3) at 1080p is too low.
My ideas:
gst-launch-1.0 v4l2src -v device=/dev/video13 ! image/jpeg,width=1920,height=1080,framerate=30/1 ! v4l2jpegdec ! fakesink
Working with low CPU load
gst-launch-1.0 v4l2src -v device=/dev/video13 ! image/jpeg,width=1920,height=1080,framerate=30/1 ! v4l2jpegdec ! v4l2h264enc ! fakesink
ERROR v4l2videodec gstv4l2videodec.c:751:gst_v4l2_video_dec_handle_frame:<v4l2jpegdec0> not negotiated
I guess that's because V4l2h264enc needs NV12
gst-launch-1.0 v4l2src -v device=/dev/video13 ! image/jpeg,width=1920,height=1080,framerate=30/1,colorimetry=bt709 ! v4l2jpegdec ! v4l2convert ! fakesink
Works, low CPU and no lost frames
gst-launch-1.0 v4l2src -v device=/dev/video13 ! image/jpeg,width=1920,height=1080,framerate=30/1,colorimetry=bt709 ! v4l2jpegdec ! v4l2convert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1,colorimetry=bt709 ! v4l2h264enc ! fakesink
ERROR v4l2allocator gstv4l2allocator.c:740:gst_v4l2_allocator_start:<v4l2h264enc0:pool:src:allocator> error requesting 4 buffers: Cannot allocate memory
ERROR v4l2bufferpool gstv4l2bufferpool.c:909:gst_v4l2_buffer_pool_start:<v4l2h264enc0:pool:src> we received 1 buffer from device '/dev/video8', we want at least 2
ERROR bufferpool gstbufferpool.c:559:gst_buffer_pool_set_active:<v4l2h264enc0:pool:src> start failed
Maybe I'm using too much of my Coda960 pipes?
gst-launch-1.0 v4l2src -v device=/dev/video13 ! image/jpeg,width=1920,height=1080,framerate=30/1,colorimetry=bt709 ! v4l2jpegdec ! videoconvert ! x264enc ! fakesink
Works, but maxes out CPU and loses too much frames
gst-launch-1.0 v4l2src -v device=/dev/video13 ! image/jpeg,width=1920,height=1080,framerate=30/1,colorimetry=bt709 ! v4l2jpegdec ! v4l2convert ! x264enc ! fakesink
Work, but again way and too much CPU and lost frames
Any idea?
Is it possible to V4l2jpegdec to NV12? So I could skip v4l2convert...
What's the best way to limit FPS? Maybe I could work with 15 fps...
Thx
Hi Gerbaum
for Gateworks board one can look at gateworks gstreamer tutorials:
http://trac.gateworks.com/wiki/Yocto/gstreamer
>What's the best way to limit FPS?
one can look at multimedia examples described in i.MX Linux User’s Guide
Best regards
igor
Thanks.
I'm running actual 5.4 Mainline Kernel with ubuntu prebuilt, because of up to date 4G modem drivers, so Yocto is not possible for me. That's why imxv4l2 is not available for me.
There are Gateworks gstreamer wikis which show use of v4l2 but they don't show my individual problem of connecting v4l2jpegdec with v4l2h264enc.