v4l2rc MJPEG to Videomixer slow - alternative pathways?

Nicolas Dufresne nicolas at ndufresne.ca
Fri Sep 29 02:10:25 UTC 2017


Le vendredi 29 septembre 2017 à 01:39 +0000, Ashwath Rajan a écrit :
> Hi, thank you so much for the response.
> 
> What do you mean by "make sure to add downstream caps?"

To add a caps filter after compisitor, something like:

  compositor ! video/x-raw,width=1920,height=1080,framerate=30/1 ! ...

> 
> Another piece of info I learned: I'm getting a TON of jpeg decode
> errors, but only with a very specific camera module, that can output
> up to 1280x720 pixel resolution.  If I use cameras that only run at
> max 640x480 resolution, they get no decode errors.  Is there
> something I can do that may be specific to the decode errors in this
> camera?

You are probably over USB 2 and saturating the bandwidth. To protect
your decoder, you can use this after v4l2src to drop corrupted buffers:

  ... ! identity drop-buffer-flags=corrupted ! ...

To be fair, I didn't think about encoded data when I decide to only
"mark" the corrupted rather then dropping the data. At the same time,
most of the time you still get something, which in certain situation is
better then nothing.

> 
> Thank you!
> 
> On Thu, Sep 28, 2017 at 6:30 PM Nicolas Dufresne <nicolas at ndufresne.ca> wrote:
> > Le jeudi 28 septembre 2017 à 16:45 -0700, ashwath a écrit :
> > > I'm sorry, just 1 more update.  Adding a leaky queue after the
> > > capture helped
> > > get rid of the lost frames problem, but the feed is still quite laggy
> > > (not
> > > to mention I'm also losing lots of frames).  I see a lot of gstreamer
> > > warnings:
> > >
> > >
> > > 0:00:06.013149788 15050       0x9250a0 WARN            videodecoder
> > > gstvideodecoder.c:4003:_gst_video_decoder_error:<jpegdec2> error:
> > > Failed to
> > > decode JPEG image
> > > 0:00:06.013162819 15050       0x9250a0 WARN            videodecoder
> > > gstvideodecoder.c:4005:_gst_video_decoder_error:<jpegdec2> error:
> > > Decode
> > > error #62: Unsupported JPEG process: SOF type 0xcf
> > >
> > >
> > > new pipeline:
> > >
> > >  gst-launch-1.0 videomixer name=mix sink_0::xpos=0 sink_0::ypos=0
> > 
> > Replace with videomixer with compositor, and configure latency property
> > to something large enough (experiment to find the good value for your
> > use case). The leaky queues won't be required anymore since compositor
> > has it's own queue mechanism. Make sure so add downstream caps,
> > compositor will produce a perfect framerate from the detected framerate
> > in that filter.
> > 
> > > sink_1::xpos=640 sink_1::ypos=0 sink_2::xpos=0 sink_2::ypos=480
> > > sink_3::xpos=640 sink_3::ypos=480  ! autovideosink sync=false v4l2src
> > > device=/dev/video0 do-timestamp=false !
> > > image/jpeg,height=480,width=640,framerate=30/1 ! queue leaky=2
> > > max-size-buffers=1 !  jpegparse ! jpegdec ! videoconvert ! mix.sink_0
> > > v4l2src device=/dev/video1 do-timestamp=false !
> > > image/jpeg,height=480,width=640,framerate=30/1 ! queue leaky=2
> > > max-size-buffers=1 !  jpegparse ! jpegdec ! videoconvert ! mix.sink_1
> > > v4l2src device=/dev/video2 do-timestamp=false !
> > > image/jpeg,height=480,width=640,framerate=30/1 ! queue leaky=2
> > > max-size-buffers=1 !  jpegparse ! jpegdec ! videoconvert ! mix.sink_2
> > > v4l2src device=/dev/video3 do-timestamp=false !
> > > image/jpeg,height=480,width=640,framerate=30/1 ! queue leaky=2
> > > max-size-buffers=1 ! jpegparse ! jpegdec !  videoconvert ! mix.sink_3
> > >
> > >
> > >
> > >
> > > --
> > > 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
> > _______________________________________________
> > gstreamer-devel mailing list
> > gstreamer-devel at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list