i.MX 6 gstreamer v4l2jpegdec with v4l2h264enc

Gerbaum jakob.ruisinger at gmail.com
Sat Jan 9 08:51:40 UTC 2021


Thanks for your help.

v4l2h264enc works.

gst-launch-1.0 -v v4l2src device=/dev/video4 ! 
video/x-raw,format=YUY2,width=1920,height=1080,framerate=6/1 ! videoconvert
!  v4l2h264enc ! fakesink

But gives my 6 Fps, thats the maximum of my USB camera, which is too low.


I tried to limit fps:

 gst-launch-1.0 -v v4l2src -v device=/dev/video4 !
image/jpeg,width=1920,height=1080,framerate=30/1 ! videorate !
image/jpeg,width=1920,height=1080,framerate=10/1 ! v4l2jpegdec !  
video/x-raw, format=Y42B, width=1920, height=1080, colorimetry=1:4:7:1 !
videoconvert !
video/x-raw,width=1920,height=1080,format=I420,colorimetry=bt601 ! fakesink


That's working. Videorate limits fps and CPU usage is much lower.


Source pad of V4l2jpegdec is:

caps = video/x-raw, format=(string)Y42B, width=(int)1920, height=(int)1080,
interlace-mode=(string)progressive, multiview-mode=(string)mono,
multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono,
pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2,
colorimetry=(string)1:4:7:1, framerate=(fraction)10/1




If I add v4l2h264enc before fakesink

gst-launch-1.0 -v v4l2src -v device=/dev/video4 !
image/jpeg,width=1920,height=1080,framerate=30/1 ! videorate !
image/jpeg,width=1920,height=1080,framerate=10/1 ! v4l2jpegdec !  
"video/x-raw, format=Y42B, width=1920, height=1080,colorimetry=1:4:7:1" !
videoconvert !
video/x-raw,width=1920,height=1080,format=I420,colorimetry=bt601 !
v4l2h264enc ! fakesink

 I get error message:

v4l2videodec
gstv4l2videodec.c:751:gst_v4l2_video_dec_handle_frame:<v4l2jpegdec0> not
negotiated

I guess thats because of framerate cap:

 gst-launch-1.0 -v v4l2src -v device=/dev/video4 !
image/jpeg,width=1920,height=1080,framerate=30/1 ! videorate !
image/jpeg,width=1920,height=1080,framerate=10/1 ! v4l2jpegdec !  
video/x-raw, format=Y42B, width=1920, height=1080, framerate=(fraction)10/1,
colorimetry=1:4:7:1 ! videoconvert !
video/x-raw,width=1920,height=1080,format=I420,colorimetry=bt601 ! fakesink

Same error.


Without framerate caps:

gst-launch-1.0 -v v4l2src -v device=/dev/video4 !
image/jpeg,width=1920,height=1080,framerate=30/1 ! videorate !
image/jpeg,width=1920,height=1080,framerate=10/1 ! v4l2jpegdec ! 
video/x-raw, format=Y42B, width=1920, height=1080, colorimetry=1:4:7:1 !
videoconvert !
video/x-raw,width=1920,height=1080,format=I420,colorimetry=bt601 ! fakesink

That's working!



I guess that somehow v4l2h264enc wants a specific framerate which cant be
negotiated with v4l2jpegdec.


But i cant even try with caps to test that framerate, because everytime I
add a framerate parameter manually to caps, it doesnt'work. The source of
v4l2jpegdec just wants no framerate parameter.

Do you have any idea?






--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list