Important
Warning, this is an experimental project.
Use this software at your own risk.
WFB-ng client (Video Decoder) for Rockchip platform powered by the Rockchip MPP library. It also displays a simple cairo based OSD that shows the bandwidth, decoding latency, and framerate of the decoded video, and wfb-ng link statistics.
This project is based on a unique frozen development FPVue_rk by Gee He.
Tested on RK3566 (Radxa Zero 3W) and RK3588s (Orange Pi 5).
Build on the Rockchip linux system directly.
- drm, cairo, mpp, logging
sudo apt install libdrm-dev libcairo-dev librockchip-mpp-dev libspdlog-dev
- gstreamer
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev
Build and run application in production environment:
cmake -B build
sudo cmake --build build --target install
build/pixelpilot
Build and run application for debugging purposes:
cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build
build/pixelpilot --osd
Show command line options:
pixelpilot --help
- Video is cropped when the fpv feed resolution is bigger than the screen mode.
- Crashes when video feed resolution is higher than the screen resolution.
It uses mpp
library to decode MPEG frames using Rockchip hardware decoder.
It uses gstreamer
to read the RTP media stream from video UDP.
It uses mavlink
decoder to read Mavlink telemetry from telemetry UDP (if enabled), see mavlink.c
It uses cairo
library to draw OSD elements (if enabled), see osd.c
.
It uses Direct Rendering Manager (DRM) to
display video on the screen, see drm.c
.
It writes raw MPEG stream to file as DVR (if enabled) using minimp4.h
library.
Pixelpilot starts several threads:
- main thread
controls gstreamer which reads RTP, extracts MPEG frames and
- feeds them to MPP hardware decoder
- sends them to DVR thread via mutex-protected
std::queue
(if enabled)
- DVR_THREAD (if enabled)
reads frames from main thread via
std::queue
and writes them to disk usingminimp4
library it yields on a condition variable for DVR queue orkill
signal variable - FRAME_THREAD
reads decoded video frames from MPP hardware decoder and forwards them to
DISPLAY_THREAD
through DRMoutput_list
protected byvideo_mutex
Seems that thread vields onmpi->decode_get_frame()
call waiting for HW decoder to return a new frame - DISPLAY_THREAD
reads frames and OSD from
video_mutex
-protectedoutput_list
and callsdrm*
functions to render them on the screen The loop yields onvideo_mutex
andvideo_cond
waiting for a new frame to display from FRAME_THREAD - MAVLINK_THREAD (if OSD and mavlink configured)
reads mavlink packets from UDP, decodes and updates
osd_vars
(without any mutex) The loop yields on UDP read - OSD_THREAD (if OSD is enabled)
takes
drm_fd
andoutput_list
as thread parameters draws telemetry on a buffer insideoutput_list
based onosd_vars
using Cairo library The loop yelds on explicitsleep
to control refresh rate
- update project version in
CMakeList.txt
,project(pixelpilot, VERSION <X.Y.Z>)
, commit - push that commit to master (either directly or with PR)
- tag the tip of the master branch with the same
<X.Y.Z>
version - run
git push --tags
; it will publish a new GitHub release