<?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: Some GStreamer issues while capturing and compressing analog video</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Some-GStreamer-issues-while-capturing-and-compressing-analog/m-p/150531#M1022</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have had a similar problem, mfw_v4lsink produces rolling video if no preview is occuring. However due to latency it is preferable to use the preview function anyhow (it even continues operating after a system halt which is neat).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have found that although the preview can be stretched horizontally to be 1024 pixels across, any height for the preview more than about 664 produces flickering lines in the displayed preview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gst-launch-0.10 -e mfw_v4lsrc sensor-width=720 sensor-height=288 capture-width=720 capture-height=576 preview=true preview-width=1024 preview-height=664 fps-n=25 ! mfw_vpuencoder ! avimux name=mux ! filesink location=/mnt/usb1/PALfps25b.avi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to stretch this to a height of 768 if possible. I am wondering if this problem can be fixed in the ipu_* drivers in the functions prpvf_start( void *private ), which initialise the preview and are called from drivers/media/video/mxc/capture/mxc_v4l2_capture.c function start_preview( cam_data *cam ), where cam holds the desired preview width and height.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Note sensor height is half the vertical resolution of the PAL signal, otherwise the image is displayed twofold in the preview, both squashed, one above the other. These appear to be the top and bottom fields (the PAL signal's "partial line" at the top of the first field is two pixels high with sensor-height=288 but only 1 pixel high in the twofold-squashed preview with sensor-height=576). Therefore I am previewing and encoding only half the vertical resolution.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The e-consystems video capture board e-CANMT_MX53x has a demo program capture.elf which demonstrates previews of captured video. It is able to preview the full vertical resolution by means of ioctl calls with option 5 "select interleaved mode". Interestingly we can't see any difference between option 4 "select Bottom field" and option 6 "select de-interlaced mode" in this demo program when the output is scaled to full screen. The partial line at the top of the screen is about 2 pixels high in both cases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am now interested in putting an overlay over the preview. &lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;In drivers/media/video/mxc/capture/ipu_prp_vf_sdc_bg.c there is an IRQ callback function prpvf_sdc_vsync_callback, which is absent from drivers/media/video/mxc/capture/ipu_prp_vf_sdc.c, so I am guessing this is to enable drawing an overlay over the captured video?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Oct 2012 07:14:25 GMT</pubDate>
    <dc:creator>fcs</dc:creator>
    <dc:date>2012-10-02T07:14:25Z</dc:date>
    <item>
      <title>Some GStreamer issues while capturing and compressing analog video</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Some-GStreamer-issues-while-capturing-and-compressing-analog/m-p/150526#M1017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Here are some issues we found in Freescale GStremer Plugins while trying to capture and compress analog video with TVP5147 and i.MX51 processor.&lt;/DIV&gt;&lt;DIV&gt;We managed to capture raw video and audio and mux them into an AVI file. We also managed to compress raw video using the VPU encoder, but only if we get the raw video to be encoded from a file. We couldn't compress the video on-the-fly while capturing.&lt;/DIV&gt;&lt;DIV&gt;In order to capture video we are using&amp;nbsp;&lt;STRONG&gt;mfw_v4lsrc&lt;/STRONG&gt;. As this module provides the raw video source in&amp;nbsp;&lt;STRONG&gt;NV12&lt;/STRONG&gt;&amp;nbsp;format, we are converting it to&amp;nbsp;&lt;STRONG&gt;I420&amp;nbsp;&lt;/STRONG&gt;on-the-fly with the&amp;nbsp;&lt;STRONG&gt;mfw_ipucsc&lt;/STRONG&gt;&amp;nbsp;module. After this, we are using&amp;nbsp;&lt;STRONG&gt;videorate&lt;/STRONG&gt;&amp;nbsp;module to adjust framerate to 25/1. Finally we use&amp;nbsp;&lt;STRONG&gt;filesink&lt;/STRONG&gt;&amp;nbsp;to store the captured raw video to a file.&lt;/DIV&gt;&lt;DIV&gt;Then, to compress the raw video offline, we use&amp;nbsp;&lt;STRONG&gt;filesrc&lt;/STRONG&gt;, followed by&lt;STRONG&gt;mxc_vpuencoder&amp;nbsp;&lt;/STRONG&gt;(codec-type=0, bitrate=2000), then&amp;nbsp;&lt;STRONG&gt;avimux&lt;/STRONG&gt;&amp;nbsp;and finally&amp;nbsp;&lt;STRONG&gt;filesink&lt;/STRONG&gt;&amp;nbsp;to store the compressed video to a file.&lt;/DIV&gt;&lt;DIV&gt;The issues we are facing are:&lt;/DIV&gt;&lt;DIV&gt;&lt;OL&gt;&lt;LI&gt;If we do not use&amp;nbsp;&lt;STRONG&gt;videorate&lt;/STRONG&gt;&amp;nbsp;module, the video framerate is way too high. A video of about 10 seconds is played in less than 2 seconds. It seems that&amp;nbsp;&lt;STRONG&gt;mfw_v4lsrc&lt;/STRONG&gt;&amp;nbsp;module&amp;nbsp;is doing wrong timestamps. Then, if we do use&amp;nbsp;&lt;STRONG&gt;videorate&lt;/STRONG&gt;, the framerate is well adjusted but video looks choppy (we believe that this module is eliminating a lot of frames to do its work).&lt;/LI&gt;&lt;LI&gt;If we capture video with a size different than&amp;nbsp;&lt;STRONG&gt;640x480&lt;/STRONG&gt;, the&amp;nbsp;&lt;STRONG&gt;mfw_vpuencoder&lt;/STRONG&gt;&amp;nbsp;module seems to ruin the original video.&lt;/LI&gt;&lt;LI&gt;If we try to encode the video while it is being captured, the pipeline generates an AVI file with an appropriate size, but it cannot be played.&lt;/LI&gt;&lt;LI&gt;We cannot deinterlace the raw video being capture, we tried&amp;nbsp;&lt;STRONG&gt;mfw_deinterlacer&lt;/STRONG&gt;&amp;nbsp;with no success.&lt;/LI&gt;&lt;LI&gt;We are capturing video with&amp;nbsp;&lt;STRONG&gt;mfw_v4lsrc&lt;/STRONG&gt;&amp;nbsp;with the property&amp;nbsp;&lt;STRONG&gt;preview=true&lt;/STRONG&gt;. If, instead, we use&amp;nbsp;&lt;STRONG&gt;preview=false&lt;/STRONG&gt;&amp;nbsp;the captured video is not vertically synched: it rolls vertically.&lt;/LI&gt;&lt;/OL&gt;If you know something about these issues or if you have any suggestions please let us know.&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2012 00:26:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Some-GStreamer-issues-while-capturing-and-compressing-analog/m-p/150526#M1017</guid>
      <dc:creator>LautaroCarmona1</dc:creator>
      <dc:date>2012-04-03T00:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Some GStreamer issues while capturing and compressing analog video</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Some-GStreamer-issues-while-capturing-and-compressing-analog/m-p/150527#M1018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Lautaro, we also have problems using gstreamer for capture.&lt;/P&gt;&lt;P&gt;We made a bt.656 driver using your extremely useful published work on the TVP5147, many thanks for that valuable work. In our system there is no I2C TV chip, we just get a raw bt.656 interface from another video device, so we simply removed the I2C code.&lt;/P&gt;&lt;P&gt;The driver loads up and works very well for the /unit_tests/mxc_v4l2_tvin demo - a great (PAL) camera picture. But it does not work with gstreamer.&lt;/P&gt;&lt;P&gt;The most successful command line we found so far to get a live video preview is:&lt;BR /&gt;gst-launch-0.10 mfw_v4lsrc device="/dev/video0" ! 'video/x-raw-yuv,width=720,height=625,framerate=25/1' ! mfw_v4lsink&lt;BR /&gt;... this shows video but it is rolling. I noticed you tried preview=true, but for us we get "IPU Error - IPU_INT_STAT_10" and the driver seems to stop at VIDIOC_S_CTRL.&lt;/P&gt;&lt;P&gt;You describe using mfw_ipucsc and other gstreamer modules, could you share please some gstreamer command lines you have used? I'll give them a go and see if we can work things out too.&lt;/P&gt;&lt;P&gt;I'm wondering if anyone has had success with gstreamer capture on the i.MX at all?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 13:55:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Some-GStreamer-issues-while-capturing-and-compressing-analog/m-p/150527#M1018</guid>
      <dc:creator>StevieRG</dc:creator>
      <dc:date>2012-04-11T13:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Some GStreamer issues while capturing and compressing analog video</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Some-GStreamer-issues-while-capturing-and-compressing-analog/m-p/150528#M1019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lautaro,&lt;/P&gt;&lt;P&gt;I am using Digi Embedded Linux on a ConnectCore Wi-i.MX51. It's running a 2.6.35 kernel with a ported version of Freescale's 11.09 BSP, modified and bug fixed to run on the hardware. The user space is running the Freescale 2.0.3 multimedia kit.&lt;/P&gt;&lt;P&gt;We have encoded on the fly from a mt9v111 camera sensor connected to a CSI port.&lt;/P&gt;&lt;P&gt;The following pipeline works for us:&lt;/P&gt;&lt;PRE&gt;gst-launch mfw_v4lsrc device=/dev/video0 num-buffers=200 preview=0 ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1,format=(fourcc)UYVY' \
 ! mfw_ipucsc ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1,format=(fourcc)I420' ! queue ! mfw_vpuencoder codec-type=2 ! \
 queue ! avimux name=mux ! filesink location=test.avi&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can play back the recorded file with gst-launch and mplayer.&lt;/P&gt;&lt;P&gt;However we have common issues:&lt;/P&gt;&lt;P&gt;1) The video played back is accelerated.&lt;BR /&gt;2) We also need to capture in 640 x480.&lt;BR /&gt;3) If we use preview=1 we are seeing a seg fault.&lt;/P&gt;&lt;P&gt;We are still debugging these issues so I don't know if the problems lie with the plugins or the BSP.&lt;/P&gt;&lt;P&gt;We don't need to deinterlace, but the hardware deinterlacer is working if the source is an interlaced compressed video file. Did you try an open source software deinterlacer instead like ffdeinterlace?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:53:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Some-GStreamer-issues-while-capturing-and-compressing-analog/m-p/150528#M1019</guid>
      <dc:creator>alexgonzalez</dc:creator>
      <dc:date>2020-10-29T08:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Some GStreamer issues while capturing and compressing analog video</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Some-GStreamer-issues-while-capturing-and-compressing-analog/m-p/150529#M1020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Updating the issues with accelerated video, in our case it was caused by the sensor auto exposure modifying the frame rate dynamically in response to the changes in light condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Turning off auto exposure the recording is fine.&lt;BR /&gt; &lt;BR /&gt; &lt;CITE&gt;Alex Gonzalez said:&lt;/CITE&gt;&lt;/P&gt;&lt;BLOCKQUOTE cite="http://imxcommunity.org/forum/topics/some-gstreamer-issues-while-capturing-and-compressing-analog#4103961Comment66592"&gt;&lt;DIV&gt;&lt;DIV class="xg_user_generated"&gt;&lt;P&gt;Hi Lautaro,&lt;/P&gt;&lt;P&gt;I am using Digi Embedded Linux on a ConnectCore Wi-i.MX51. It's running a 2.6.35 kernel with a ported version of Freescale's 11.09 BSP, modified and bug fixed to run on the hardware. The user space is running the Freescale 2.0.3 multimedia kit.&lt;/P&gt;&lt;P&gt;We have encoded on the fly from a mt9v111 camera sensor connected to a CSI port.&lt;/P&gt;&lt;P&gt;The following pipeline works for us:&lt;/P&gt;&lt;PRE&gt;gst-launch mfw_v4lsrc device=/dev/video0 num-buffers=200 preview=0 ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1,format=(fourcc)UYVY' \
 ! mfw_ipucsc ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1,format=(fourcc)I420' ! queue ! mfw_vpuencoder codec-type=2 ! \
 queue ! avimux name=mux ! filesink location=test.avi&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can play back the recorded file with gst-launch and mplayer.&lt;/P&gt;&lt;P&gt;However we have common issues:&lt;/P&gt;&lt;P&gt;1) The video played back is accelerated.&lt;BR /&gt;2) We also need to capture in 640 x480.&lt;BR /&gt;3) If we use preview=1 we are seeing a seg fault.&lt;/P&gt;&lt;P&gt;We are still debugging these issues so I don't know if the problems lie with the plugins or the BSP.&lt;/P&gt;&lt;P&gt;We don't need to deinterlace, but the hardware deinterlacer is working if the source is an interlaced compressed video file. Did you try an open source software deinterlacer instead like ffdeinterlace?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:53:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Some-GStreamer-issues-while-capturing-and-compressing-analog/m-p/150529#M1020</guid>
      <dc:creator>alexgonzalez</dc:creator>
      <dc:date>2020-10-29T08:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Some GStreamer issues while capturing and compressing analog video</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Some-GStreamer-issues-while-capturing-and-compressing-analog/m-p/150530#M1021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, all! Sorry for the last response&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve G, we are happy that our work was valuable to you! Thanks for saying that! We managed to capture and compress video on the fly, with these lines:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;NTSC:&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;gst-launch-0.10 -e mfw_v4lsrc sensor-width=720 sensor-height=480 capture-width=720 capture-height=480 preview=true preview-width=360 preview-height=240 preview-top=180 preview-left=220&amp;nbsp; ! 'video/x-raw-yuv,format=(fourcc)NV12,width=720,height=480' ! queue max-size-buffers=1000 ! mfw_vpuencoder codec-type=0 bitrate=2000 width=720 height=480 ! avimux name=mux ! filesink location=NTSCfps30.avi alsasrc device=hw:0,0 ! 'audio/x-raw-int,rate=44100,channels=2,depth=16' ! queue ! mfw_mp3encoder ! mux.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;PAL:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;gst-launch-0.10 -e mfw_v4lsrc sensor-width=720 sensor-height=576 capture-width=720 capture-height=576 preview=true preview-width=360 preview-height=288 preview-top=156 preview-left=220 ! 'video/x-raw-yuv,format=(fourcc)NV12,width=720,height=576,framerate=(fraction)30/1' ! mfw_ipucsc ! 'video/x-raw-yuv,format=(fourcc)I420,wifth=720,height=576,framerate=(fraction)30/1' ! videorate ! 'video/x-raw-yuv,framerate=(fraction)25/1' ! queue max-size-buffers=1000 ! mfw_vpuencoder codec-type=0 bitrate=2000 width=720 height=576 framerate=25 ! avimux name=mux ! filesink location=PALfps25.avi alsasrc device=hw:0,0 ! 'audio/x-raw-int,rate=44100,channels=2,depth=16' ! queue ! mfw_mp3encoder ! mux&lt;/DIV&gt;&lt;DIV&gt;Alex, thanks for your sharing your experience with us! After asking here in imxcommunity about the deinterlacer, we've been told that it works while playing, but now while capturing video, just as you say. About accelerated video, with the lines above, we didn't have problems with NTSC video, but with PAL video we still needed to use the videorate plugin. Anyway, we're still experiencing some lags with the audio sync with PAL.&lt;/DIV&gt;&lt;DIV&gt;Thanks both of you for replying!&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 06:07:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Some-GStreamer-issues-while-capturing-and-compressing-analog/m-p/150530#M1021</guid>
      <dc:creator>LautaroCarmona1</dc:creator>
      <dc:date>2012-06-21T06:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Some GStreamer issues while capturing and compressing analog video</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Some-GStreamer-issues-while-capturing-and-compressing-analog/m-p/150531#M1022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have had a similar problem, mfw_v4lsink produces rolling video if no preview is occuring. However due to latency it is preferable to use the preview function anyhow (it even continues operating after a system halt which is neat).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have found that although the preview can be stretched horizontally to be 1024 pixels across, any height for the preview more than about 664 produces flickering lines in the displayed preview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gst-launch-0.10 -e mfw_v4lsrc sensor-width=720 sensor-height=288 capture-width=720 capture-height=576 preview=true preview-width=1024 preview-height=664 fps-n=25 ! mfw_vpuencoder ! avimux name=mux ! filesink location=/mnt/usb1/PALfps25b.avi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to stretch this to a height of 768 if possible. I am wondering if this problem can be fixed in the ipu_* drivers in the functions prpvf_start( void *private ), which initialise the preview and are called from drivers/media/video/mxc/capture/mxc_v4l2_capture.c function start_preview( cam_data *cam ), where cam holds the desired preview width and height.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Note sensor height is half the vertical resolution of the PAL signal, otherwise the image is displayed twofold in the preview, both squashed, one above the other. These appear to be the top and bottom fields (the PAL signal's "partial line" at the top of the first field is two pixels high with sensor-height=288 but only 1 pixel high in the twofold-squashed preview with sensor-height=576). Therefore I am previewing and encoding only half the vertical resolution.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The e-consystems video capture board e-CANMT_MX53x has a demo program capture.elf which demonstrates previews of captured video. It is able to preview the full vertical resolution by means of ioctl calls with option 5 "select interleaved mode". Interestingly we can't see any difference between option 4 "select Bottom field" and option 6 "select de-interlaced mode" in this demo program when the output is scaled to full screen. The partial line at the top of the screen is about 2 pixels high in both cases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am now interested in putting an overlay over the preview. &lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;In drivers/media/video/mxc/capture/ipu_prp_vf_sdc_bg.c there is an IRQ callback function prpvf_sdc_vsync_callback, which is absent from drivers/media/video/mxc/capture/ipu_prp_vf_sdc.c, so I am guessing this is to enable drawing an overlay over the captured video?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 07:14:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Some-GStreamer-issues-while-capturing-and-compressing-analog/m-p/150531#M1022</guid>
      <dc:creator>fcs</dc:creator>
      <dc:date>2012-10-02T07:14:25Z</dc:date>
    </item>
  </channel>
</rss>

