<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le dim. 19 janv. 2020 06 h 15, Constantine Elster <<a href="mailto:constantine.elster@valerann.com">constantine.elster@valerann.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi devs,<br></div><div><br></div><div>I'm trying to construct a pipeline that captures frames from a USB camera (YUV) and encodes them with HW encoder and saves into a file. My setup is iMX6 board running Ubuntu 18.04 on 4.20 mainline kernel.</div><div><br></div><div>When I try a sw encoder, it works okay albeit I get very high 100% CPU usage. The working pipeline based on software plugins:</div><div><span style="font-family:monospace">gst-launch-1.0 -v v4l2src device="/dev/video2" num-buffers=200 ! "video/x-raw, format=(string)UYVY, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)</span><span style="font-family:monospace">1/1, framerate=(fraction)45/1, colorimetry=bt709" ! videoconvert ! x264enc ! mp4mux ! filesink location=aha.mp4</span><br></div><div><span style="font-family:monospace"><br></span></div><div>My attempt to replace sw based plugins by HW based with efficient memory management:<br></div><div><span style="font-family:monospace">gst-launch-1.0 -v v4l2src device="/dev/video9" num-buffers=200 ! "video/x-raw, format=(string)UY</span><span style="font-family:monospace">VY, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)</span><span style="font-family:monospace">1/1, framerate=(fraction)45/1, colorimetry=bt709" ! <b>v4l2video8convert</b> <b>output-io-mode=dmabuf-import</b> ! <b>v4l2h264enc</b> <b>output-io-mode=dmabuf-import</b> ! mp4mux ! filesink location=aha.mp4</span><br></div><div><span style="font-family:monospace"><br></span></div><div><font face="arial, sans-serif">I get the following error: "</font><span style="background-color:rgb(255,229,153)">WARNING: erroneous pipeline: could not link v4l2h264enc0 to mp4mux0"</span></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">While reading this, I was worried you had hit some much more serious issue. Short story, you need h264parse between the encoder and the muxer.</div><div dir="auto"><br></div><div dir="auto">The HW encoder produces H264 using Annex B format (with start code), but ISOMP4 require AVCc format, h264parse element can negotiate and convert this for you.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>Would appreciate any ideas how to understand what's wrong, how to debug and make it work.</div><div><br></div><div>Thank you very much,</div><div>  -- Constantine.</div><div><br></div><div><br></div></div>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" rel="noreferrer">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div></div></div>