23,776
edits
mNo edit summary |
mNo edit summary |
||
Line 19: | Line 19: | ||
1. Get source code | 1. Get source code | ||
< | <syntaxhighlight lang="bash"> | ||
VERSION=1.14.5 | VERSION=1.14.5 | ||
Line 31: | Line 31: | ||
wget https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-$VERSION.tar.xz --no-check-certificate | wget https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-$VERSION.tar.xz --no-check-certificate | ||
for a in `ls -1 *.tar.*`; do tar -xf $a; done | for a in `ls -1 *.tar.*`; do tar -xf $a; done | ||
</ | </syntaxhighlight> | ||
2. Install dependencies | 2. Install dependencies | ||
< | <syntaxhighlight lang="bash"> | ||
sudo apt-get install build-essential dpkg-dev flex bison autotools-dev automake \ | sudo apt-get install build-essential dpkg-dev flex bison autotools-dev automake \ | ||
autopoint libtool gtk-doc-tools libgstreamer1.0-dev \ | autopoint libtool gtk-doc-tools libgstreamer1.0-dev \ | ||
Line 43: | Line 43: | ||
libx264-dev libmad0-dev | libx264-dev libmad0-dev | ||
</ | </syntaxhighlight> | ||
3. Export PKG_CONFIG_PATH and LD_LIBRARY_PATH | 3. Export PKG_CONFIG_PATH and LD_LIBRARY_PATH | ||
< | <syntaxhighlight lang="bash"> | ||
export PKG_CONFIG_PATH=/home/$USER/gst_$VERSION/out/lib/pkgconfig | export PKG_CONFIG_PATH=/home/$USER/gst_$VERSION/out/lib/pkgconfig | ||
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/aarch64-linux-gnu/pkgconfig | export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/aarch64-linux-gnu/pkgconfig | ||
export LD_LIBRARY_PATH=/home/$USER/gst_$VERSION/out/lib/ | export LD_LIBRARY_PATH=/home/$USER/gst_$VERSION/out/lib/ | ||
</ | </syntaxhighlight> | ||
4. Build | 4. Build | ||
< | <syntaxhighlight lang="bash"> | ||
VERSION=1.14.5 | VERSION=1.14.5 | ||
NPROC=$(nproc) | NPROC=$(nproc) | ||
Line 96: | Line 96: | ||
cd .. | cd .. | ||
</ | </syntaxhighlight> | ||
5. Export LD_LIBRARY_PATH | 5. Export LD_LIBRARY_PATH | ||
< | <syntaxhighlight lang="bash"> | ||
VERSION=1.14.5 | VERSION=1.14.5 | ||
export LD_LIBRARY_PATH=/home/$USER/gst_$VERSION/out/lib/ | export LD_LIBRARY_PATH=/home/$USER/gst_$VERSION/out/lib/ | ||
</ | </syntaxhighlight> | ||
6. Copy the NVIDIA libraries | 6. Copy the NVIDIA libraries | ||
< | <syntaxhighlight lang="bash"> | ||
ls /usr/lib/aarch64-linux-gnu/gstreamer-1.0 | grep nv | ls /usr/lib/aarch64-linux-gnu/gstreamer-1.0 | grep nv | ||
libgstaudioconvert.so | libgstaudioconvert.so | ||
Line 124: | Line 124: | ||
cd ~/gst_$VERSION | cd ~/gst_$VERSION | ||
</ | </syntaxhighlight> | ||
== Steps to patch GStreamer to support RAW10 == | == Steps to patch GStreamer to support RAW10 == | ||
Line 131: | Line 131: | ||
1- Apply the following patch to the gst-plugins good: | 1- Apply the following patch to the gst-plugins good: | ||
< | <syntaxhighlight lang="bash"> | ||
mkdir patches | mkdir patches | ||
cd patches | cd patches | ||
echo 0001-Add-Bayer10-V4l2-support.patch > series | echo 0001-Add-Bayer10-V4l2-support.patch > series | ||
</ | </syntaxhighlight> | ||
Create a file called: '''patches/0001-Add-Bayer10-V4l2-support.patch''' with the following contents: | Create a file called: '''patches/0001-Add-Bayer10-V4l2-support.patch''' with the following contents: | ||
< | <syntaxhighlight lang="bash"> | ||
diff --git a/gst_1.14.5/gst-plugins-good-1.14.5/sys/v4l2/gstv4l2object.c b/gst_1.14.5/gst-plugins-good-1.14.5/sys/v4l2/gstv4l2object.c | diff --git a/gst_1.14.5/gst-plugins-good-1.14.5/sys/v4l2/gstv4l2object.c b/gst_1.14.5/gst-plugins-good-1.14.5/sys/v4l2/gstv4l2object.c | ||
index 124c778..8fdcc42 100644 | index 124c778..8fdcc42 100644 | ||
Line 217: | Line 217: | ||
} else if (g_str_equal (mimetype, "video/x-sonix")) { | } else if (g_str_equal (mimetype, "video/x-sonix")) { | ||
fourcc = V4L2_PIX_FMT_SN9C10X; | fourcc = V4L2_PIX_FMT_SN9C10X; | ||
</ | </syntaxhighlight> | ||
Apply the patch | Apply the patch | ||
< | <syntaxhighlight lang="bash"> | ||
cd .. | cd .. | ||
quilt push | quilt push | ||
</ | </syntaxhighlight> | ||
2- Recompile the plugins good: | 2- Recompile the plugins good: | ||
< | <syntaxhighlight lang="bash"> | ||
cd gst-plugins-good-$VERSION | cd gst-plugins-good-$VERSION | ||
./configure --prefix=/home/$USER/gst_$VERSION/out ; time make ; make install ; | ./configure --prefix=/home/$USER/gst_$VERSION/out ; time make ; make install ; | ||
</ | </syntaxhighlight> | ||
3- Export the libraries: | 3- Export the libraries: | ||
< | <syntaxhighlight lang="bash"> | ||
VERSION=1.14.5 | VERSION=1.14.5 | ||
export LD_LIBRARY_PATH=/home/$USER/gst_$VERSION/out/lib/ | export LD_LIBRARY_PATH=/home/$USER/gst_$VERSION/out/lib/ | ||
</ | </syntaxhighlight> | ||
4- Capturing from a sensor using RAW10 in either rggb,gbrg,grbg ot bggr pixel order using gstreamer should be posible now, try running the following example pipeline: | 4- Capturing from a sensor using RAW10 in either rggb,gbrg,grbg ot bggr pixel order using gstreamer should be posible now, try running the following example pipeline: | ||
< | <syntaxhighlight lang="bash"> | ||
gst-launch-1.0 -vvv v4l2src num-buffers=10 ! "video/x-bayer,width=1920,height=1080 format=bggr" ! fakesink -v | gst-launch-1.0 -vvv v4l2src num-buffers=10 ! "video/x-bayer,width=1920,height=1080 format=bggr" ! fakesink -v | ||
gst-launch-1.0 -vvv v4l2src num-buffers=10 ! "video/x-bayer,width=1920,height=1080,format=bggr,framerate=30/1" ! multifilesink location=test%d.raw -v | gst-launch-1.0 -vvv v4l2src num-buffers=10 ! "video/x-bayer,width=1920,height=1080,format=bggr,framerate=30/1" ! multifilesink location=test%d.raw -v | ||
</ | </syntaxhighlight> | ||
== See also == | == See also == |