<?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のトピックimx6 simultaneous overlay and capture?</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/imx6-simultaneous-overlay-and-capture/m-p/637266#M97101</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;BR /&gt;I'm trying to make overlay and capture work simultaneously on sabreDL board (will be moving on to the solo processor later on). I tried searching the forums, but couldn't really find a definitive answer to "is it possible at all to overlay and capture at the same time?"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I basically try do is&lt;/P&gt;&lt;P&gt;initMyOverlayAndCapture();&lt;BR /&gt;overlay=1;&lt;BR /&gt;ioctl(fd_v4l, VIDIOC_OVERLAY, &amp;amp;overlay);&lt;BR /&gt;while (1){&lt;BR /&gt;&amp;nbsp;xioctl(fd_capture, VIDIOC_DQBUF, &amp;amp;buf);&lt;BR /&gt;&amp;nbsp;handleTheDataInMyBuffer(); //takes anything between 5 to 500 ms&lt;BR /&gt;&amp;nbsp;xioctl(fd_capture, VIDIOC_QBUF, &amp;amp;buf);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;i.e I'd like to see the overlay work smoothly while I'm picking up samples from the camera and processing them. However, when done like this, I don't get any proper data in my buffer. If I never actually start the overlay with the ioctl line, data flows nicely to my buffer, so the basic pieces are working (but not together).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I do something like&lt;/P&gt;&lt;P&gt;initMyOverlayAndCapture();&lt;BR /&gt;while (1){&lt;BR /&gt;&amp;nbsp;usleep(200*1000);&lt;BR /&gt;&amp;nbsp;overlay=0;&lt;BR /&gt;&amp;nbsp;ioctl(fd_v4l, VIDIOC_OVERLAY, &amp;amp;overlay);&lt;BR /&gt;&amp;nbsp;xioctl(fd_capture, VIDIOC_DQBUF, &amp;amp;buf);&lt;BR /&gt;&amp;nbsp;handleTheDataInMyBuffer(); //takes anything between 5 to 500 ms&lt;BR /&gt;&amp;nbsp;xioctl(fd_capture, VIDIOC_QBUF, &amp;amp;buf);&lt;BR /&gt;&amp;nbsp;overlay=1;&lt;BR /&gt;&amp;nbsp;ioctl(fd_v4l, VIDIOC_OVERLAY, &amp;amp;overlay);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;I get moments of overlay, as expected, and proper data in between from the camera... but this doesn't quite fulfill the "smoothly" requirement I have.&lt;/P&gt;&lt;P&gt;BR,&lt;BR /&gt;Pasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Nov 2016 16:26:45 GMT</pubDate>
    <dc:creator>pasiojala</dc:creator>
    <dc:date>2016-11-30T16:26:45Z</dc:date>
    <item>
      <title>imx6 simultaneous overlay and capture?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6-simultaneous-overlay-and-capture/m-p/637266#M97101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;BR /&gt;I'm trying to make overlay and capture work simultaneously on sabreDL board (will be moving on to the solo processor later on). I tried searching the forums, but couldn't really find a definitive answer to "is it possible at all to overlay and capture at the same time?"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I basically try do is&lt;/P&gt;&lt;P&gt;initMyOverlayAndCapture();&lt;BR /&gt;overlay=1;&lt;BR /&gt;ioctl(fd_v4l, VIDIOC_OVERLAY, &amp;amp;overlay);&lt;BR /&gt;while (1){&lt;BR /&gt;&amp;nbsp;xioctl(fd_capture, VIDIOC_DQBUF, &amp;amp;buf);&lt;BR /&gt;&amp;nbsp;handleTheDataInMyBuffer(); //takes anything between 5 to 500 ms&lt;BR /&gt;&amp;nbsp;xioctl(fd_capture, VIDIOC_QBUF, &amp;amp;buf);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;i.e I'd like to see the overlay work smoothly while I'm picking up samples from the camera and processing them. However, when done like this, I don't get any proper data in my buffer. If I never actually start the overlay with the ioctl line, data flows nicely to my buffer, so the basic pieces are working (but not together).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I do something like&lt;/P&gt;&lt;P&gt;initMyOverlayAndCapture();&lt;BR /&gt;while (1){&lt;BR /&gt;&amp;nbsp;usleep(200*1000);&lt;BR /&gt;&amp;nbsp;overlay=0;&lt;BR /&gt;&amp;nbsp;ioctl(fd_v4l, VIDIOC_OVERLAY, &amp;amp;overlay);&lt;BR /&gt;&amp;nbsp;xioctl(fd_capture, VIDIOC_DQBUF, &amp;amp;buf);&lt;BR /&gt;&amp;nbsp;handleTheDataInMyBuffer(); //takes anything between 5 to 500 ms&lt;BR /&gt;&amp;nbsp;xioctl(fd_capture, VIDIOC_QBUF, &amp;amp;buf);&lt;BR /&gt;&amp;nbsp;overlay=1;&lt;BR /&gt;&amp;nbsp;ioctl(fd_v4l, VIDIOC_OVERLAY, &amp;amp;overlay);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;I get moments of overlay, as expected, and proper data in between from the camera... but this doesn't quite fulfill the "smoothly" requirement I have.&lt;/P&gt;&lt;P&gt;BR,&lt;BR /&gt;Pasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2016 16:26:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6-simultaneous-overlay-and-capture/m-p/637266#M97101</guid>
      <dc:creator>pasiojala</dc:creator>
      <dc:date>2016-11-30T16:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: imx6 simultaneous overlay and capture?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6-simultaneous-overlay-and-capture/m-p/637267#M97102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;You can check this user application example:&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;A class="link-titled" href="https://github.com/rogeriorps/v4l2-examples/blob/master/example2/example2.c" title="https://github.com/rogeriorps/v4l2-examples/blob/master/example2/example2.c"&gt;v4l2-examples/example2.c at master · rogeriorps/v4l2-examples · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;It's based on /unit_tests/mxc_v4l2_tvin.out&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;On lines 397 and 399 it makes a memcopy to copy the image between input and output buffers. The input&amp;nbsp;buffer is available at "&lt;SPAN style="color: #333333; background-color: #ffffff; border: 0px; font-weight: inherit; font-size: 14px;"&gt;capture_buffers[capture_buf.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #333333; background-color: #ffffff; border: 0px; font-weight: inherit; font-size: 14px;"&gt;index&lt;/SPAN&gt;&lt;SPAN style="color: #333333; background-color: #ffffff; border: 0px; font-weight: inherit; font-size: 14px;"&gt;].&lt;/SPAN&gt;&lt;SPAN class="" style="color: #333333; background-color: #ffffff; border: 0px; font-weight: inherit; font-size: 14px;"&gt;start" and it's available for you to make whatever image processing you need.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;SPAN class="" style="color: #333333; background-color: #ffffff; border: 0px; font-weight: inherit; font-size: 14px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;SPAN class="" style="color: #333333; background-color: #ffffff; border: 0px; font-weight: inherit; font-size: 14px;"&gt;The output (to display) buffer is&amp;nbsp;&lt;SPAN&gt;output_buffers[output_buf.&lt;/SPAN&gt;&lt;SPAN class=""&gt;index&lt;/SPAN&gt;&lt;SPAN&gt;].&lt;/SPAN&gt;&lt;SPAN class=""&gt;start.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;SPAN class="" style="color: #333333; background-color: #ffffff; border: 0px; font-weight: inherit; font-size: 14px;"&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;SPAN class="" style="color: #333333; background-color: #ffffff; border: 0px; font-weight: inherit; font-size: 14px;"&gt;&lt;SPAN class=""&gt;Another option is to use gstreamer to record a video and display at the same time.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;SPAN class="" style="color: #333333; background-color: #ffffff; border: 0px; font-weight: inherit; font-size: 14px;"&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;SPAN class="" style="color: #333333; background-color: #ffffff; border: 0px; font-weight: inherit; font-size: 14px;"&gt;&lt;SPAN class=""&gt;Best regards,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;SPAN class="" style="color: #333333; background-color: #ffffff; border: 0px; font-weight: inherit; font-size: 14px;"&gt;&lt;SPAN class=""&gt;Rogerio&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2016 18:36:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6-simultaneous-overlay-and-capture/m-p/637267#M97102</guid>
      <dc:creator>rogerio_silva</dc:creator>
      <dc:date>2016-11-30T18:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: imx6 simultaneous overlay and capture?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6-simultaneous-overlay-and-capture/m-p/637268#M97103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rogerio,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to give this some thought. It still doesn't look optimal for me, as I'd rather use&amp;nbsp;the&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt; VIDIOC_OVERLAY procedure to get my camera pic onscreen (I don't need to modify it, maybe just scale), and grab some samples for my own processing in the meantime. Unless, of course, if it's not actually possible to have the overlay and capture work at the same time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;I could maybe try getting my samples directly from fb (where I'd be overlaying), but in case I need to scale down the camera image to screen, I'd be losing precision doing this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Anyway, thanks, I'll give your suggestion&amp;nbsp;a try&amp;nbsp;and see&amp;nbsp;how well it&amp;nbsp;works for me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;BR,&lt;BR /&gt;Pasi&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2016 08:33:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6-simultaneous-overlay-and-capture/m-p/637268#M97103</guid>
      <dc:creator>pasiojala</dc:creator>
      <dc:date>2016-12-01T08:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: imx6 simultaneous overlay and capture?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6-simultaneous-overlay-and-capture/m-p/637269#M97104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again. The approach from your example works smooth enough for me with smaller images, but when I capture a 2592x1944 in NV12 format, that results in about 7.5M of data to be copied between the capture and output buffers (and another 5M I need to copy for my analysis - I only use the Y part of the picture), taking about 600ms on average. This is no longer good for me. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe this approach is not the correct one for me. Other than gstreamer, is there any other way to accomplish what I need:&lt;/P&gt;&lt;P&gt;-set up a fluent flow from camera to display (possibly scaling down), with no or minimal processor load&lt;/P&gt;&lt;P&gt;-in the meanwhile, grab a frame from the camera, process it (takes an undefined time), grab a new frame when ready to process a new frame, continue ad infinitum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I need to start studying gstreamer for this, is there a reason to believe it does it's magic better and faster, without memcpy taking up that much time?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 11:32:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6-simultaneous-overlay-and-capture/m-p/637269#M97104</guid>
      <dc:creator>pasiojala</dc:creator>
      <dc:date>2016-12-06T11:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: imx6 simultaneous overlay and capture?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6-simultaneous-overlay-and-capture/m-p/637270#M97105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Maybe you can try the attached patch that applies on unit test mxc_v4l2_tvin.c.&lt;/P&gt;&lt;P&gt;It changes the output buffer from&amp;nbsp;V4L2_MEMORY_MMAP to&amp;nbsp;V4L2_MEMORY_USERPTR. This way the memcpy is not needed to copy every frame to display. You can use memcpy only when you want to get a frame.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Rogerio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2016 12:35:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6-simultaneous-overlay-and-capture/m-p/637270#M97105</guid>
      <dc:creator>rogerio_silva</dc:creator>
      <dc:date>2016-12-06T12:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: imx6 simultaneous overlay and capture?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6-simultaneous-overlay-and-capture/m-p/637271#M97106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Rogerio,&lt;/P&gt;&lt;P&gt;thanks for the tip, I owe you a beer:)&lt;/P&gt;&lt;P&gt;I was actually earlier trying to fiddle around with the in and out buffers to avoid the memcpy, but&amp;nbsp; didn't realize you could simply just use the capature buffer for both input and output, as in your patch. &lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Pasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2016 08:12:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6-simultaneous-overlay-and-capture/m-p/637271#M97106</guid>
      <dc:creator>pasiojala</dc:creator>
      <dc:date>2016-12-09T08:12:48Z</dc:date>
    </item>
  </channel>
</rss>

