Last active
July 19, 2023 09:42
-
-
Save intx82/e9c9ee16a525452444b928e3eef5ff73 to your computer and use it in GitHub Desktop.
gst-plugin-cedar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on nano-pi: | |
pre-read: https://wvthoog.nl/nanopi-ov5640-camera | |
Kernel: | |
1. Put into arch/arm/boot/dts/sun8i-h3.dtsi above 'soc' | |
``` DTS | |
reserved-memory { | |
#address-cells = <1>; | |
#size-cells = <1>; | |
ranges; | |
cma_pool: cma@43c00000 { | |
compatible = "shared-dma-pool"; | |
reusable; | |
reg = <0x4a000000 0x6000000>; | |
linux,cma-default; | |
}; | |
}; | |
``` | |
2. Change syscon into: | |
```dts | |
syscon: system-control@1c00000 { | |
compatible = "allwinner,sun8i-h3-system-control","syscon"; | |
reg = <0x01c00000 0x1000>; | |
#address-cells = <1>; | |
#size-cells = <1>; | |
ranges; | |
sram_a2: sram@40000 { | |
compatible = "mmio-sram"; | |
reg = <0x00040000 0xc000>; | |
#address-cells = <1>; | |
#size-cells = <1>; | |
ranges = <0 0x00040000 0xc000>; | |
scpi_sram: scp-shmem@bc00 { | |
compatible = "arm,scp-shmem"; | |
reg = <0xbc00 0x200>; | |
}; | |
}; | |
sram_c: sram@1d00000 { | |
compatible = "mmio-sram"; | |
reg = <0x01d00000 0x80000>; | |
#address-cells = <1>; | |
#size-cells = <1>; | |
ranges = <0 0x01d00000 0x80000>; | |
ve_sram: sram-section@0 { | |
compatible = "allwinner,sun8i-h3-sram-c1", | |
"allwinner,sun4i-a10-sram-c1"; | |
reg = <0x000000 0x80000>; | |
}; | |
}; | |
}; | |
``` | |
3. Build cedar_ve module from [https://github.com/uboborov/sunxi-cedar-mainline] | |
``` | |
make KERNEL_SOURCE=/usr/src/linux-6.1.30 | |
make KERNEL_SOURCE=/usr/src/linux-6.1.30 -C /usr/src/linux-6.1.30 M=$PWD modules_install | |
``` | |
4. Reboot, and grep 'cedar_ve' module | |
GST | |
1. sudo apt-get install libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev gstreamer1.0-videosink | |
2. git clone https://github.com/gtalusan/gst-plugin-cedar | |
3. ./autogen.sh | |
4. make | |
5. make install | |
6. GST_PLUGIN_PATH=/usr/local/lib/gstreamer-1.0/ gst-launch-1.0 -ve videotestsrc ! cedar_h264enc ! h264parse ! matroskamux ! filesink location="cedar.mkv" | |
or webcam (only if camera supports only mjpeg): | |
GST_PLUGIN_PATH=/usr/local/lib/gstreamer-1.0 gst-launch-1.0 -v v4l2src device=/dev/video0 ! jpegdec ! videoconvert ! cedar_h264enc ! rtph264pay ! udpsink host=192.168.2.27 port=5000 | |
or even without jpegdec | |
GST_PLUGIN_PATH=/usr/local/lib/gstreamer-1.0 gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,width=1920 ! videoconvert ! cedar_h264enc ! rtph264pay ! udpsink host=192.168.2.27 port=5000 | |
--- | |
on laptop: | |
gst-launch-1.0 -v udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment