-
Notifications
You must be signed in to change notification settings - Fork 200
Development ~ Room for Improvement
Currently, video decoding on the receiver side is done use a modified hello_video.bin. hello_video.bin is an example program supplied by the Raspberry foundation for decoding h264 video using the Pi h264 hardware decoder.
The modifications to the original hello_video.bin (thanks a lot to RCGroups forum member "mmormota") make sure that the video playback is smooth by looking for frame delimiters in the videostream and delaying the playback of each frame until a new vsync has occured.
There are two issues with that though:
- Looking for the frame delimiter is done "in software" using the main CPU, this adds significant processing overhead, i.e. the hello_video.bin process has higher CPU usage
- Since the delivery of the frame to the GPU for decoding is delayed in userspace, this means, that the decoding of the frame takes place after the "correct" (i.e. when vsync just occured) time. This isn't a problem as long as the decoding time is constant, however, since the decoding time is not constant, it creates additional jitter and delay.
What could be improved about that:
-
Use of the GPU for parsing the h264 stream and looking for delimiters, see the links about the gst-mmal project below for more information and code examples.
-
Make sure that the frames get delivered to the GPU for decoding as soon as they are received (so that the GPU can already start decoding while we're waiting for the next vsync to occur).
-
Slightly change the HDMI clock when appropriate to compensate for the camera framerate clock on the air Pi and the refresh-rate clock on the ground Pi drifting apart.
Several frames are buffered inside the GPU when decoding. According to different postings on the Raspberry forum, this can be reduced to one frame by setting some parameter (max_dec_frame_buffering=1). If we can reduce the buffering by only one frame, we would already save about 16ms of latency, two frames would be 32ms!
- https://www.raspberrypi.org/forums/viewtopic.php?t=41584
- https://www.raspberrypi.org/forums/viewtopic.php?t=41053
- https://gridforums.nvidia.com/default/topic/752/benchmarks/vdi-click-to-photon-with-raspberry-pi/
- https://www.raspberrypi.org/forums/viewtopic.php?f=70&t=148390
- https://www.raspberrypi.org/forums/viewtopic.php?t=157049
- https://github.com/raspberrypi/firmware/search?utf8=%E2%9C%93&q=SLICE&type=
- https://gstreamer.freedesktop.org/data/events/gstreamer-conference/2016/John%20Sadler%20-%20Smooth%20video%20on%20Raspberry%20Pi%20with%20gst-mmal%20(Lightning%20Talk).pdf
- https://github.com/youviewtv/gst-mmal
See here: https://www.rcgroups.com/forums/showpost.php?p=38225602&postcount=3214
General
Hardware Setup
- Proper Wiring
- Power Supply (BECs)
- Supported Pi models
- Supported Cameras
- Supported WiFi Adapters
- Supported Displays
- Antennas
- DIY builds
Software Setup
- Basic configuration options
- Advanced Options
RC Control
- General
- RC with Ardupilot (MAVlink)
- RC with iNav
- DIY builds
Ground Stations
- Mission Planner (Windows)
- QGroundControl (Windows / Linux / Mac / Android /iOS)
- APM Planner (Windows / Mac / Linux)
- Tower (Android)
- FPV_VR (Android)
- GStreamer (Windows / Mac / Linux)
- Fishing FanCam (iOS)
Expert Settings
- OSD MAVLink message types
- Transmit power settings
- SSH shell
- Raspivid camera settings
- Optimizing-Power-Consumption
Extensions / AddOns
- HDMI-in cards
- WebCams
- Video Switcher
- Thermal (FLIR, Seek)
- 360° cameras
Community-HUB
Developer's Corner
- Room for Improvement
- Mounting Images
- Reducing Images size
- WinSCP (copying files)