Introductory
Currently, the C3V Ubuntu rootfs have included the GStreamer 1.22.9 pre-built by default, it carries most of the commonly used elements and hardware media codec functions. The users can use gst-inspect-1.0 to check the installed elements directly.
Info |
---|
To use hardware media codecs, please run the command chmod +777 /dev/video6* to change the video codec permissions, otherwise, the GStreamer will not find the v4l2 codec element. |
In addition to some common plugins, the system also comes with RTSP and its test program, which allows users to test the h264 and jpeg hardware encoding capabilities with the following two commands:
Code Block |
---|
//test V4L2 h264 encoder
test-lanuch --gst-debug-level=1 "videotestsrc ! video/x-raw,width=1280,height=720 ! v4l2h264enc ! h264parse ! rtph264pay pt=96 name=pay0"
//test V4L2 jpeg encode
test-lanuch --gst-debug-level=1 "videotestsrc ! video/x-raw,width=1280,height=720 ! v4l2jpegenc ! jpegparse ! rtpjpegpay pt=26 name=pay0" |
If successful, the screen can be viewed with the RTSP tool with the address rtsp://x.x.x.x:8554/test.
If your C3V system doesn’t have the GStreamer or you feel that the provided GStreamer does not meet your needs, you can recompile one of the plugins or the entire Gstreamer as below.
...
Compile and install Gstreamer to the target version 1.22.9 with C3V Codec supported:
...
Code Block |
---|
sudo apt update
sudo apt install -y build-essential meson ninja-build python3-pip bison libglib2.0-dev flex git
sudo apt install -y libx264-dev
sudo apt install --reinstall libx11-dev libxext-dev libxrender-dev libxv-dev libxrandr-dev libxi-dev
pip3 install --upgrade meson
sudo pip3 install --upgrade meson |
...