Lautaro Carmona

Some GStreamer issues while capturing and compressing analog video

Discussion created by Lautaro Carmona on Apr 2, 2012
Latest reply on Oct 2, 2012 by fcs
Here are some issues we found in Freescale GStremer Plugins while trying to capture and compress analog video with TVP5147 and i.MX51 processor.
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.
In order to capture video we are using mfw_v4lsrc. As this module provides the raw video source in NV12 format, we are converting it to I420 on-the-fly with the mfw_ipucsc module. After this, we are using videorate module to adjust framerate to 25/1. Finally we use filesink to store the captured raw video to a file.
Then, to compress the raw video offline, we use filesrc, followed bymxc_vpuencoder (codec-type=0, bitrate=2000), then avimux and finally filesink to store the compressed video to a file.
The issues we are facing are:
  1. If we do not use videorate module, the video framerate is way too high. A video of about 10 seconds is played in less than 2 seconds. It seems that mfw_v4lsrc module is doing wrong timestamps. Then, if we do use videorate, the framerate is well adjusted but video looks choppy (we believe that this module is eliminating a lot of frames to do its work).
  2. If we capture video with a size different than 640x480, the mfw_vpuencoder module seems to ruin the original video.
  3. 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.
  4. We cannot deinterlace the raw video being capture, we tried mfw_deinterlacer with no success.
  5. We are capturing video with mfw_v4lsrc with the property preview=true. If, instead, we use preview=false the captured video is not vertically synched: it rolls vertically.
If you know something about these issues or if you have any suggestions please let us know. 

Outcomes