i.MX 6 gstreamer v4l2jpegdec with v4l2h264enc

Nicolas Dufresne nicolas at ndufresne.ca
Wed Jan 6 01:36:58 UTC 2021


Le mar. 5 janv. 2021 08 h 00, Gerbaum <jakob.ruisinger at gmail.com> a écrit :

> 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         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?
>

Does v4l2h264enc works at all ? Note that you can play with io-modes to try
and get zero-copy, but in 1.16 you aren't guaranteed to get good image when
it works.


>
> *gst-launch-1.0 v4l2src -v device=/dev/video13 !
> image/jpeg,width=1920,height=1080,framerate=30/1,colorimetry=bt709 !
> v4l2jpegdec !  videoconvert !  x264enc ! fakesink*
>

Try to add tune=zerolatency to x264enc, the default encoding configuration
is very expensive.

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? Running Kernel 5.4 Gstreamer 1.16.
>
> 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
>
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210105/9a987e1a/attachment.htm>


More information about the gstreamer-devel mailing list