Hi, all! Sorry for the last response
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:
NTSC:
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 ! '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.
PAL:
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).
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.
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
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.
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.
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.
I am now interested in putting an overlay over the preview. 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?
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.
Turning off auto exposure the recording is fine.
Alex Gonzalez said:
Hi Lautaro,
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.
We have encoded on the fly from a mt9v111 camera sensor connected to a CSI port.
The following pipeline works for us:
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.aviWe can play back the recorded file with gst-launch and mplayer.
However we have common issues:
1) The video played back is accelerated.
2) We also need to capture in 640 x480.
3) If we use preview=1 we are seeing a seg fault.We are still debugging these issues so I don't know if the problems lie with the plugins or the BSP.
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?
Regards,
Alex
Hi Lautaro,
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.
We have encoded on the fly from a mt9v111 camera sensor connected to a CSI port.
The following pipeline works for us:
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
We can play back the recorded file with gst-launch and mplayer.
However we have common issues:
1) The video played back is accelerated.
2) We also need to capture in 640 x480.
3) If we use preview=1 we are seeing a seg fault.
We are still debugging these issues so I don't know if the problems lie with the plugins or the BSP.
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?
Regards,
Alex
Hello Lautaro, we also have problems using gstreamer for capture.
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.
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.
The most successful command line we found so far to get a live video preview is:
gst-launch-0.10 mfw_v4lsrc device="/dev/video0" ! 'video/x-raw-yuv,width=720,height=625,framerate=25/1' ! mfw_v4lsink
... 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.
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.
I'm wondering if anyone has had success with gstreamer capture on the i.MX at all?