DART-SD410 Debian Camera 4.9.39

From Variscite Wiki
Revision as of 14:55, 16 August 2017 by Leonid (talk | contribs) (→‎Switch to linaro user)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
DART-SD410 - Camera

It is possible to create a basic video recording GStreamer pipeline involving the camera and video encoder. Currently this has the following limitations:

  • The frame data must be vertically aligned to 32 lines. For the OV5645 camera this means that only 1280×960 resolution is supported.
  • The gstreamer1.0-plugins-good package needs to be rebuilt (with different default compile options).

The release is configured to expect the OV5645 sensor on the CSI1. The setup is validated using an VAR-EXT-CB410 Rev 1.01 add on card.

To enable the video encoder plugin follow these steps.

Install needed packages and dependencies

# sudo apt-get update
# sudo apt-get install build-essential fakeroot devscripts
# sudo apt-get build-dep gstreamer1.0-plugins-good
# sudo apt-get install media-ctl

Get gstreamer1.0-plugins-good source

# apt-get source gstreamer1.0-plugins-good
# cd gst-plugins-good1.0-1.12.2/

Edit gstreamer1.0-plugins-good source

Edit debian/rules and add --enable-v4l2-probe and --without-libv4l2 options to DEB_CONFIGURE_EXTRA_FLAGS.

Build gstreamer1.0-plugins-good package

# debuild -b -uc -us
This process will take some time, so be patient.

Install the newly built gstreamer1.0-plugins-good package

# dpkg -i ../gstreamer1.0-plugins-good_1.12.2*_arm64.deb

Now you are ready to do video recording!

Configure the pipeline

# media-ctl -d /dev/media1 -l '"msm_csiphy1":1->"msm_csid0":0[1],"msm_csid0":1->"msm_ispif0":0[1],"msm_ispif0":1->"msm_vfe0_pix":0[1]'
# media-ctl -d /dev/media1 -V '"ov5645 1-0078":0[fmt:UYVY8_2X8/1280x960 field:none],"msm_csiphy1":0[fmt:UYVY8_2X8/1280x960 field:none],"msm_csid0":0[fmt:UYVY8_2X8/1280x960 field:none],"msm_ispif0":0[fmt:UYVY8_2X8/1280x960 field:none],"msm_vfe0_pix":0[fmt:UYVY8_2X8/1280x960 field:none],"msm_vfe0_pix":1[fmt:UYVY8_1_5X8/1280x960 field:none]'

Switch to linaro user

From this step it is better to test as linaro user, so switch to linaro:

# su linaro
$ cd

Test the preview

$ DISPLAY=:0 gst-launch-1.0 -v -e v4l2src device=/dev/video3 ! glimagesink

Record the video

$ gst-launch-1.0 -e v4l2src device=/dev/video3 ! video/x-raw,format=NV12,width=1280,height=960,framerate=30/1 ! v4l2h264enc extra-controls="controls,h264_profile=4,video_bitrate=2000000;" ! h264parse ! mp4mux ! filesink location=video.mp4
Stop the record by pressing Ctrl-C

Play newly recorded video

$ DISPLAY=:0 gst-play-1.0 video.mp4