2253 Raspberry Pi
From Sensoray Technical Wiki
Compiling the 2253 driver on a Raspberry Pi board
Assuming Debian Raspbian installed, verify that build-essential and dkms packages are installed.
sudo apt-get install build-essential dkms
Choose one of the following methods to install the kernel headers:
- Find out the version of the kernel using
uname -r
, then download and install headers package for version of kernel from https://www.niksula.hut.fi/~mhiienka/Rpi/linux-headers-rpi/
sudo dpkg -i ./linux-headers-4.1.18+_4.1.18+-2_armhf.deb sudo apt-get install -f
- Use the
rpi-source
command to install kernel source (recommended if the other option gives an error)
sudo rpi-source
Compile the driver:
sudo make -C driver sudo make install
If the modprobe fails, the install step may have put the driver in the wrong modules directory if the kernel version has '+' at the end. Fix by doing:
sudo mv /lib/modules/4.1.18/extra /lib/modules/4.1.18+/ sudo depmod -a sudo modprobe s2253
In order to use gstreamer, you may need to install the following packages:
sudo apt-get install gstreamer1.0-tools gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-omx
Here is an example gstreamer command:
gst-launch-1.0 v4l2src device=/dev/video0 ! \ 'video/x-h264,standard=255,format=MP42,width=720,height=480,framerate=30000/1001,pixelformat=h264,profile=high' ! \ h264parse ! mpegtsmux ! filesink location=recording.mp4
Note: in order for the recording to be seekable, first you must do this:
# Set H.264 format (to enable codec controls) v4l2-ctl -v pixelformat='H264' # Set H.264 IDR frames (to allow seeking in recordings) v4l2-ctl -c video_h_264_idr_period=1