<?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>i.MX Processors中的主题 Re: i.MX8QXP: unable to link v4l2 decoder to encoder in the same gstreamer pipeline</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-unable-to-link-v4l2-decoder-to-encoder-in-the-same/m-p/1247132#M170978</link>
    <description>&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;I've returned to investigating this issue after some time. I'm currently using the v5.4.70_2.3.1 BSP and I'm still running into the same problem.&lt;/P&gt;&lt;P&gt;My final goal is to be able to transcode a JPEG camera feed into an H.264 format with the least possible amount of CPU overhead. As reference, I'm using the example in section 9.1 of the i.MX 8 GStreamer user guide, which is supposed to accomplish what I'm looking for:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;gst-launch-1.0 v4l2src device=/dev/video3 ! jpegparse ! v4l2jpegdec ! queue ! videoconvert ! v4l2h264enc ! h264parse ! matroskamux ! filesink location=out.mkv&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;However, this pipeline doesn't work on my i.MX8QXP device.&lt;/P&gt;&lt;P&gt;The following pipeline does seem to go through, but no video stream is stored in the out.mkv file and the gst-launch-1.0 app blocks when stopping the stream:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;gst-launch-1.0 v4l2src device=/dev/video3 ! jpegparse ! v4l2jpegdec ! imxvideoconvert_g2d ! v4l2convert ! v4l2h264enc ! h264parse ! matroskamux ! filesink location=out.mkv
Setting pipeline to PAUSED ...
[   49.299976] uvcvideo: Failed to query (GET_DEF) UVC control 12 on unit 2: -32 (exp. 4).
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[   49.926396] [VPU Decoder] firmware version is 1.7.0
Redistribute latency...
[   49.960932] bypass csc
[   49.963307] input fmt YUYV
[   49.966092] output fmt NV12
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:03.492342625
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
^C^C^C^C^C&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I've also tried piping the stream to the waylandsink, but I'm unable to see anything on screen. I've also tried the suggestion of hardcoding a 1280x720 resolution in the pipeline, but that doesn't work.&lt;/P&gt;&lt;P&gt;Is there a pipeline that will allow me to transcode a JPEG feed to H.264 while avoiding CPU overhead (e.g. using the VPU when possible or zero-copy methods like the ones suggested in the GStreamer user guide)?&lt;/P&gt;</description>
    <pubDate>Wed, 17 Mar 2021 10:04:40 GMT</pubDate>
    <dc:creator>gabrielvalcazar</dc:creator>
    <dc:date>2021-03-17T10:04:40Z</dc:date>
    <item>
      <title>i.MX8QXP: unable to link v4l2 decoder to encoder in the same gstreamer pipeline</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-unable-to-link-v4l2-decoder-to-encoder-in-the-same/m-p/1196511#M166188</link>
      <description>&lt;P&gt;Good afternoon,&lt;/P&gt;&lt;P&gt;I'm currently testing the multimedia capabilities of an i.MX8QXP-based system running a custom Yocto image based on the &lt;STRONG&gt;5.4.47_2.2.0​​&lt;/STRONG&gt; BSP. In one of my tests, I tried queuing the output of the &lt;STRONG&gt;v4l2 JPEG decoder &lt;/STRONG&gt;(I assume it's the element I want to use if I'm interested in testing the 8X's VPU) into the &lt;STRONG&gt;v4l2 encoder&lt;/STRONG&gt;. Here is a simplified example of what I want to test:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; gst-launch-1.0 v4l2src device=/dev/video3 ! v4l2jpegdec ! v4l2h264enc ! fakesink&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The command fails with the following error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
   ../../../../git/libs/gst/base/gstbasesrc.c(3072): gst_base_src_loop ():    /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
   streaming stopped, reason not-negotiated (-4)
   Execution ended after 0:00:01.074351570
   Setting pipeline to PAUSED ...
   Setting pipeline to READY ...
   Setting pipeline to NULL ...
   Freeing pipeline ...&lt;/LI-CODE&gt;&lt;P&gt;In another example, I'm able to use the v4l2 video decoder and encoder separately, but not together. These two commands work separately:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;gst-launch-1.0 -e videotestsrc ! v4l2h264enc ! h264parse ! mp4mux ! filesink location=test.mp4

gst-launch-1.0 -v filesrc location=test.mp4 ! qtdemux ! h264parse ! v4l2h264dec ! testsink&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;But trying to use both elements in one pipeline fails:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;gst-launch-1.0 -v filesrc location=test.mp4 ! qtdemux ! h264parse ! v4l2h264dec ! v4l2h264enc ! testsink&lt;/LI-CODE&gt;&lt;P&gt;What is the reason for this? Is there a missing element in the pipeline, or is this a known limitation (eiher for gstreamer or for the i.MX8QXP's VPU)?&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Gabriel&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 14:42:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-unable-to-link-v4l2-decoder-to-encoder-in-the-same/m-p/1196511#M166188</guid>
      <dc:creator>gabrielvalcazar</dc:creator>
      <dc:date>2020-12-09T14:42:00Z</dc:date>
    </item>
    <item>
      <title>i.MX8QXP: unable to link v4l2 decoder to encoder in the same gstreamer pipeline</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-unable-to-link-v4l2-decoder-to-encoder-in-the-same/m-p/1199467#M166480</link>
      <description>&lt;P&gt;how about trying the command as below:&lt;/P&gt;
&lt;P&gt;gst-launch-1.0 -v filesrc location=test.mp4 ! qtdemux ! h264parse ! v4l2h264dec ! imxvideoconvert_g2d ! v4l2convert ! v4l2h264enc ! testsink&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 08:08:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-unable-to-link-v4l2-decoder-to-encoder-in-the-same/m-p/1199467#M166480</guid>
      <dc:creator>joanxie</dc:creator>
      <dc:date>2020-12-15T08:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8QXP: unable to link v4l2 decoder to encoder in the same gstreamer pipeline</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-unable-to-link-v4l2-decoder-to-encoder-in-the-same/m-p/1200473#M166597</link>
      <description>&lt;P&gt;Hi joanxie,&lt;/P&gt;&lt;P&gt;Using the command you suggested, gst-launch-1.0 no longer fails with an error and I see kernel messages that suggest that both the decoder and the encoder are being used.&lt;/P&gt;&lt;P&gt;However, when I try stopping the command with Ctrl+C, an error appears and I'm unable to terminate the command properly, so I'm stuck until I reset the target. Here's the output:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;~# gst-launch-1.0 -e filesrc location=test.mp4 ! qtdemux ! h264parse ! v4l2h264dec ! imxvideoconvert_g2d ! v4l2convert ! v4l2h264enc ! h264parse ! mp4mux ! filesink location="result.mp4"
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
[  246.781463] [VPU Decoder] firmware version is 1.6.4
Redistribute latency...
[  246.807488] bypass csc
[  246.809924] input fmt YUYV
[  246.812685] output fmt NV12
Redistribute latency...

^Chandling interrupt.
Interrupt: Stopping pipeline ...
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I feel like this pipeline is close to a proper solution, but it's still isn't working as expected.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 15:17:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-unable-to-link-v4l2-decoder-to-encoder-in-the-same/m-p/1200473#M166597</guid>
      <dc:creator>gabrielvalcazar</dc:creator>
      <dc:date>2020-12-16T15:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8QXP: unable to link v4l2 decoder to encoder in the same gstreamer pipeline</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-unable-to-link-v4l2-decoder-to-encoder-in-the-same/m-p/1201153#M166649</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;gst-launch-1.0 imxcompositor_g2d v4l2src device=/dev/video8 ! 'video/x-raw,framerate=25/1,width=1280,height=720' ! autovideosink&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I think&amp;nbsp;&lt;/SPAN&gt;the width=1280,height=720 is very important，&lt;SPAN&gt;You need to check the available supported resolutions of the video&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 09:48:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-unable-to-link-v4l2-decoder-to-encoder-in-the-same/m-p/1201153#M166649</guid>
      <dc:creator>songhongliang</dc:creator>
      <dc:date>2020-12-17T09:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8QXP: unable to link v4l2 decoder to encoder in the same gstreamer pipeline</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-unable-to-link-v4l2-decoder-to-encoder-in-the-same/m-p/1247132#M170978</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;I've returned to investigating this issue after some time. I'm currently using the v5.4.70_2.3.1 BSP and I'm still running into the same problem.&lt;/P&gt;&lt;P&gt;My final goal is to be able to transcode a JPEG camera feed into an H.264 format with the least possible amount of CPU overhead. As reference, I'm using the example in section 9.1 of the i.MX 8 GStreamer user guide, which is supposed to accomplish what I'm looking for:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;gst-launch-1.0 v4l2src device=/dev/video3 ! jpegparse ! v4l2jpegdec ! queue ! videoconvert ! v4l2h264enc ! h264parse ! matroskamux ! filesink location=out.mkv&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;However, this pipeline doesn't work on my i.MX8QXP device.&lt;/P&gt;&lt;P&gt;The following pipeline does seem to go through, but no video stream is stored in the out.mkv file and the gst-launch-1.0 app blocks when stopping the stream:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;gst-launch-1.0 v4l2src device=/dev/video3 ! jpegparse ! v4l2jpegdec ! imxvideoconvert_g2d ! v4l2convert ! v4l2h264enc ! h264parse ! matroskamux ! filesink location=out.mkv
Setting pipeline to PAUSED ...
[   49.299976] uvcvideo: Failed to query (GET_DEF) UVC control 12 on unit 2: -32 (exp. 4).
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[   49.926396] [VPU Decoder] firmware version is 1.7.0
Redistribute latency...
[   49.960932] bypass csc
[   49.963307] input fmt YUYV
[   49.966092] output fmt NV12
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:03.492342625
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
^C^C^C^C^C&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I've also tried piping the stream to the waylandsink, but I'm unable to see anything on screen. I've also tried the suggestion of hardcoding a 1280x720 resolution in the pipeline, but that doesn't work.&lt;/P&gt;&lt;P&gt;Is there a pipeline that will allow me to transcode a JPEG feed to H.264 while avoiding CPU overhead (e.g. using the VPU when possible or zero-copy methods like the ones suggested in the GStreamer user guide)?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 10:04:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-unable-to-link-v4l2-decoder-to-encoder-in-the-same/m-p/1247132#M170978</guid>
      <dc:creator>gabrielvalcazar</dc:creator>
      <dc:date>2021-03-17T10:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8QXP: unable to link v4l2 decoder to encoder in the same gstreamer pipeline</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-unable-to-link-v4l2-decoder-to-encoder-in-the-same/m-p/1302046#M176371</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same issue on iMX8QM with 5.4.70_2.3.1. It is fine to preview a USB camera.&lt;/P&gt;&lt;PRE&gt;gst-launch-1.0 v4l2src device=/dev/video2 ! 'image/jpeg,width=1280,height=720,framerate=30/1' ! v4l2jpegdec ! waylandsink sync=false&lt;/PRE&gt;&lt;P&gt;But it just fails when encoding&amp;nbsp;v4l2jpegdec's src stream into H.264 by&amp;nbsp;v4l2jpegdec. The&amp;nbsp;v4l2jpegdec's src format(video/x-raw, NV12)&amp;nbsp; meets&amp;nbsp;v4l2jpegdec sink format requirement.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;gst-launch-1.0 v4l2src device=/dev/video2 ! 'image/jpeg,width=1280,height=720,framerate=30/1' ! v4l2jpegdec ! video/x-raw, format=NV12, width=1280, height=720, framerate=30/1 ! v4l2h264enc ! fakesink&lt;BR /&gt;Setting pipeline to PAUSED ...&lt;BR /&gt;Pipeline is live and does not need PREROLL ...&lt;BR /&gt;Setting pipeline to PLAYING ...&lt;BR /&gt;New clock: GstSystemClock&lt;BR /&gt;ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.&lt;BR /&gt;Additional debug info:&lt;BR /&gt;../git/libs/gst/base/gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:&lt;BR /&gt;streaming stopped, reason not-negotiated (-4)&lt;BR /&gt;Execution ended after 0:00:00.647766125&lt;BR /&gt;Setting pipeline to PAUSED ...&lt;BR /&gt;Setting pipeline to READY ...&lt;BR /&gt;Setting pipeline to NULL ...&lt;BR /&gt;Freeing pipeline ...&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 09:30:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-unable-to-link-v4l2-decoder-to-encoder-in-the-same/m-p/1302046#M176371</guid>
      <dc:creator>banhu</dc:creator>
      <dc:date>2021-07-03T09:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8QXP: unable to link v4l2 decoder to encoder in the same gstreamer pipeline</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-unable-to-link-v4l2-decoder-to-encoder-in-the-same/m-p/1302279#M176394</link>
      <description>&lt;P&gt;I have the same problem as you.&lt;/P&gt;&lt;P&gt;In addition, problems can occur when using both v4l2dec and imxcompositor.&lt;/P&gt;&lt;P&gt;V4l2src This route shows that stopping will be blocked&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  gst-launch-1.0 imxcompositor_g2d name=comp sink_1::xpos=0 sink_1::ypos=0 !  waylandsink   v4l2src  device=/dev/video4  ! video/x-h264,width=1280,height=720,framerate=30/1 ! v4l2h264dec ! comp.sink_0   videotestsrc ! comp.sink_1
  
    gst-launch-1.0 imxcompositor_g2d name=comp sink_1::xpos=0 sink_1::ypos=0 !  waylandsink   v4l2src  device=/dev/video2 ! image/jpeg,width=1280,height=720,framerate=30/1 ! v4l2jpegdec ! comp.sink_0   videotestsrc ! comp.sink_1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works by decoding with jpegdec software, but it is extremely unstable and shows Carton frequently&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	   gst-launch-1.0 imxcompositor_g2d name=comp sink_1::xpos=0 sink_1::ypos=0 !  waylandsink   v4l2src  device=/dev/video2 ! image/jpeg,width=1280,height=720,framerate=30/1 ! jpegdec ! comp.sink_0   videotestsrc ! comp.sink_1&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 05 Jul 2021 07:09:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-unable-to-link-v4l2-decoder-to-encoder-in-the-same/m-p/1302279#M176394</guid>
      <dc:creator>Hongtao</dc:creator>
      <dc:date>2021-07-05T07:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8QXP: unable to link v4l2 decoder to encoder in the same gstreamer pipeline</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-unable-to-link-v4l2-decoder-to-encoder-in-the-same/m-p/1372423#M183122</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have the same problem.&lt;BR /&gt;Has there been any progress?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 05:46:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-unable-to-link-v4l2-decoder-to-encoder-in-the-same/m-p/1372423#M183122</guid>
      <dc:creator>toshinariagata</dc:creator>
      <dc:date>2021-11-17T05:46:12Z</dc:date>
    </item>
  </channel>
</rss>

