<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: i.MX8 Video Streaming Pipeline in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8-Video-Streaming-Pipeline/m-p/1483677#M192137</link>
    <description>&lt;P&gt;Thank you! Have set up GStreamer and run a basic pipeline to confirm it's able to encode to H264 and stream to YouTube. What I haven't been able though is confirm the FPS of this pipeline, to make sure it's indeed achieving the performance required.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;gst-launch-1.0 -v videotestsrc pattern=ball is-live=true ! video/x-raw,width=640,height=480,framerate=30/1 !&amp;nbsp; v4l2h264enc ! h264parse &amp;nbsp; &amp;nbsp; ! flvmux name=mux &amp;nbsp; &amp;nbsp; audiotestsrc ! queue ! audioconvert ! avenc_aac ! aacparse&amp;nbsp; ! mux. mux. ! tee name=t t. ! rtmpsink location="rtmp://a.rtmp.youtube.com/live2/"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So that would be problem #1.&lt;/P&gt;&lt;P&gt;Problem #2 is being able to take the video from my USB camera, that outputs MJPEG and stream that to YouTube. I'm getting stuck passing the frames to the v4l2h264enc element. I've attached the output from running the pipeline&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN class=""&gt;GST_DEBUG&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;4&lt;/SPAN&gt;&lt;SPAN&gt; gst-launch-&lt;/SPAN&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;0&lt;/SPAN&gt;&lt;SPAN&gt; -v v&lt;/SPAN&gt;&lt;SPAN class=""&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;l&lt;/SPAN&gt;&lt;SPAN class=""&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;src device=/dev/video&lt;/SPAN&gt;&lt;SPAN class=""&gt;2&lt;/SPAN&gt;&lt;SPAN&gt; ! v&lt;/SPAN&gt;&lt;SPAN class=""&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;l&lt;/SPAN&gt;&lt;SPAN class=""&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;jpegdec ! v&lt;/SPAN&gt;&lt;SPAN class=""&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;l&lt;/SPAN&gt;&lt;SPAN class=""&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;h&lt;/SPAN&gt;&lt;SPAN class=""&gt;264&lt;/SPAN&gt;&lt;SPAN&gt;enc ! v&lt;/SPAN&gt;&lt;SPAN class=""&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;l&lt;/SPAN&gt;&lt;SPAN class=""&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;h&lt;/SPAN&gt;&lt;SPAN class=""&gt;264&lt;/SPAN&gt;&lt;SPAN&gt;dec ! autovideosink&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 03 Jul 2022 21:56:01 GMT</pubDate>
    <dc:creator>odd_bikes</dc:creator>
    <dc:date>2022-07-03T21:56:01Z</dc:date>
    <item>
      <title>i.MX8 Video Streaming Pipeline</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8-Video-Streaming-Pipeline/m-p/1480401#M191938</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm a relative beginner to embedded Linux and trying to get a relatively simple (or so I thought) video processing pipeline using i.MX8 QuadMax. Right now, my processing pipeline looks something like this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;OpenCV captures video from the USB video camera using v4l2&lt;/LI&gt;&lt;LI&gt;A simple text overlay is added on the video&lt;/LI&gt;&lt;LI&gt;The resulting image is piped as a series of images to stdout and then into ffmpeg&lt;/LI&gt;&lt;LI&gt;Ffmpeg encodes it and streams it to YouTube&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The command being:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;./apalis-opencv-test | ffmpeg -thread_queue_size 1024 -i pipe: -f lavfi -i anullsrc -f flv -c:v libx264 -c:a aac -preset ultrafast rtmp://a.rtmp.youtube.com/live2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My main issue is that I only get ~18FPS which seems really slow for a chip that can do HW encoding. I'm hoping someone can point me in the right direction of at least what to test next.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 08:12:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8-Video-Streaming-Pipeline/m-p/1480401#M191938</guid>
      <dc:creator>odd_bikes</dc:creator>
      <dc:date>2022-06-27T08:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8 Video Streaming Pipeline</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8-Video-Streaming-Pipeline/m-p/1481010#M191968</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;ffmpeg's libx264 is using software encoding thus the poor performance.&lt;/P&gt;&lt;P&gt;You should rather use gstreamer pipeline with hardware h264 encoding (h264_enc element).&lt;/P&gt;&lt;P&gt;Gstreamer has all function you are interested in and is the native multimedia framework on&amp;nbsp;&lt;SPAN&gt;i.MX8 QuadMax.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;you can do&lt;/P&gt;&lt;P&gt;gst-inspect-1.0 | grep 264 to check exact name.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 07:32:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8-Video-Streaming-Pipeline/m-p/1481010#M191968</guid>
      <dc:creator>malik_cisse</dc:creator>
      <dc:date>2022-06-28T07:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8 Video Streaming Pipeline</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8-Video-Streaming-Pipeline/m-p/1483677#M192137</link>
      <description>&lt;P&gt;Thank you! Have set up GStreamer and run a basic pipeline to confirm it's able to encode to H264 and stream to YouTube. What I haven't been able though is confirm the FPS of this pipeline, to make sure it's indeed achieving the performance required.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;gst-launch-1.0 -v videotestsrc pattern=ball is-live=true ! video/x-raw,width=640,height=480,framerate=30/1 !&amp;nbsp; v4l2h264enc ! h264parse &amp;nbsp; &amp;nbsp; ! flvmux name=mux &amp;nbsp; &amp;nbsp; audiotestsrc ! queue ! audioconvert ! avenc_aac ! aacparse&amp;nbsp; ! mux. mux. ! tee name=t t. ! rtmpsink location="rtmp://a.rtmp.youtube.com/live2/"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So that would be problem #1.&lt;/P&gt;&lt;P&gt;Problem #2 is being able to take the video from my USB camera, that outputs MJPEG and stream that to YouTube. I'm getting stuck passing the frames to the v4l2h264enc element. I've attached the output from running the pipeline&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN class=""&gt;GST_DEBUG&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;4&lt;/SPAN&gt;&lt;SPAN&gt; gst-launch-&lt;/SPAN&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;0&lt;/SPAN&gt;&lt;SPAN&gt; -v v&lt;/SPAN&gt;&lt;SPAN class=""&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;l&lt;/SPAN&gt;&lt;SPAN class=""&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;src device=/dev/video&lt;/SPAN&gt;&lt;SPAN class=""&gt;2&lt;/SPAN&gt;&lt;SPAN&gt; ! v&lt;/SPAN&gt;&lt;SPAN class=""&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;l&lt;/SPAN&gt;&lt;SPAN class=""&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;jpegdec ! v&lt;/SPAN&gt;&lt;SPAN class=""&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;l&lt;/SPAN&gt;&lt;SPAN class=""&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;h&lt;/SPAN&gt;&lt;SPAN class=""&gt;264&lt;/SPAN&gt;&lt;SPAN&gt;enc ! v&lt;/SPAN&gt;&lt;SPAN class=""&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;l&lt;/SPAN&gt;&lt;SPAN class=""&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;h&lt;/SPAN&gt;&lt;SPAN class=""&gt;264&lt;/SPAN&gt;&lt;SPAN&gt;dec ! autovideosink&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2022 21:56:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8-Video-Streaming-Pipeline/m-p/1483677#M192137</guid>
      <dc:creator>odd_bikes</dc:creator>
      <dc:date>2022-07-03T21:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8 Video Streaming Pipeline</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8-Video-Streaming-Pipeline/m-p/1484462#M192179</link>
      <description>&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;To #1, there is Gstreamer &lt;STRONG&gt;fpsdisplaysink&lt;/STRONG&gt; element that can display FPS info:&lt;BR /&gt;&lt;A href="https://gstreamer.freedesktop.org/documentation/debugutilsbad/fpsdisplaysink.html?gi-language=c" target="_blank" rel="noopener"&gt;https://gstreamer.freedesktop.org/documentation/debugutilsbad/fpsdisplaysink.html?gi-language=c&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To #2, usually you would need &lt;STRONG&gt;videoconvert&lt;/STRONG&gt; element between decoder and encoder. Also you might rather need &lt;STRONG&gt;MJPEG&lt;/STRONG&gt; decoder than JPEG&lt;BR /&gt;Here is an example I had working on Jetson Nano Platform. Note however that avdec and x264 enc are both software codes and not suitable in your case. This only give a general idea of the pipeline elements:&lt;/P&gt;&lt;PRE&gt;# x264enc jpeg from Logitech C920 USB cam
gst-launch-1.0 rtpbin name=rtpbin ! v4l2src device=/dev/video1 ! image/jpeg,width=1920,height=1080,framerate=30/1 ! avdec_mjpeg ! videoconvert ! x264enc name=video tune=zerolatency ! rtph264pay ! gscreamtx media-src=0 ! rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! udpsink host=$RECEIVER_IP port=5000 bind-port=5000 rtpbin.send_rtcp_src_0 ! udpsink host=$RECEIVER_IP bind-port=5001 port=5001 udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 07:52:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8-Video-Streaming-Pipeline/m-p/1484462#M192179</guid>
      <dc:creator>malik_cisse</dc:creator>
      <dc:date>2022-07-05T07:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8 Video Streaming Pipeline</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8-Video-Streaming-Pipeline/m-p/1484463#M192180</link>
      <description>&lt;P&gt;Also I do not recommand gstreamer debug level 4. It is too verbose. Usually 3 will do.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 07:53:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8-Video-Streaming-Pipeline/m-p/1484463#M192180</guid>
      <dc:creator>malik_cisse</dc:creator>
      <dc:date>2022-07-05T07:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8 Video Streaming Pipeline</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8-Video-Streaming-Pipeline/m-p/1484466#M192181</link>
      <description>&lt;P&gt;Thank you for the reply! I only have a v4l2videojpegdec, but that only produces a still frame. Have tried a videoconvert element between the decoder and encoder, same problem. The only element that produced some sort of a running pipeline was a 'decodebin', but that only produced green artifacts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will try a variation of your pipeline and report back.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 07:57:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8-Video-Streaming-Pipeline/m-p/1484466#M192181</guid>
      <dc:creator>odd_bikes</dc:creator>
      <dc:date>2022-07-05T07:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8 Video Streaming Pipeline</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8-Video-Streaming-Pipeline/m-p/1485962#M192273</link>
      <description>&lt;P&gt;Following advice received on the GStreamer mailing list, I focussed on the CAPS negotiation between the different elements. This looks like the JPEG coming from the camera has a different format than the JPEG decoder expects.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 06:24:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8-Video-Streaming-Pipeline/m-p/1485962#M192273</guid>
      <dc:creator>odd_bikes</dc:creator>
      <dc:date>2022-07-07T06:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8 Video Streaming Pipeline</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8-Video-Streaming-Pipeline/m-p/1487279#M192371</link>
      <description>&lt;P&gt;I'm pretty sure all my issues come from the fact that there is actually no support in the BSP for MJPEG&amp;nbsp; HW decoding for the i.MX8 QuadMax. I've detailed in this post my research process:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/t5/i-MX-Processors/i-MX8-QuadMax-MJPEG-VPU-Decoding/td-p/1487087" target="_blank"&gt;https://community.nxp.com/t5/i-MX-Processors/i-MX8-QuadMax-MJPEG-VPU-Decoding/td-p/1487087&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 07:50:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8-Video-Streaming-Pipeline/m-p/1487279#M192371</guid>
      <dc:creator>odd_bikes</dc:creator>
      <dc:date>2022-07-11T07:50:57Z</dc:date>
    </item>
  </channel>
</rss>

