Home / FPV Video processing with Raspberry Pi
19 Oct 2026
HDMI from goggles or a digital VRX into a Raspberry Pi
Lab 02 / USB HDMI
Purpose
Take the HDMI picture that already leaves a pair of FPV goggles, or a digital video receiver, and run the person detector on a Raspberry Pi that stays on the desk.
This is the path for HDZero, Walksnail, DJI-class goggles, and any VRX with an HDMI socket. The grabber is a USB HDMI capture dongle. It is a different device from the analog EasyCAP: it expects HDMI, usually 720p or 1080p, not a yellow composite plug.
The extra device
The new piece is a USB HDMI capture dongle. HDMI from the goggles or the digital receiver goes in. USB goes into the Pi, on a USB 3 port if the Pi has one. No driver. It should appear as a camera. Bring an HDMI cable. The dongle does not include one.

The unit in the photograph is the Elgato Cam Link. The current one to order is the Cam Link 4K. This lab only asks for 720p or 1080p. A smaller dongle sold for the same job on a Pi is the Adafruit HDMI capture adapter. Either one is HDMI in, USB out.
Photograph by Jakub T. Jankiewicz, CC BY-SA 4.0, via Wikimedia Commons.
Words
- HDMI (High-Definition Multimedia Interface). The flat video plug on the goggles or the digital receiver. It carries a finished picture, usually 720p or 1080p.
- FPV (First Person View). The pilot's live picture.
- VTX (Video Transmitter). The digital video radio on the aircraft.
- USB (Universal Serial Bus). How the grabber plugs into the Pi.
- V4L2 (Video for Linux 2). The Pi's camera door. A grabber often lists several
/dev/videonodes. Use the one that reports a real picture size. - OpenCV (Open Source Computer Vision Library). Reads each frame.
- HOG (Histogram of Oriented Gradients). The built-in person shape model.
- SVM (Support Vector Machine). The yes/no classifier behind that model.
What you need
- Goggles or a digital ground unit with HDMI out
- USB HDMI capture dongle
- Raspberry Pi, Python 3, OpenCV
sudo apt install python3-opencv v4l-utils
v4l2-ctl --list-devices
HDMI grabbers often list several /dev/video nodes. Use the one whose formats include a real picture size (v4l2-ctl -d /dev/video2 --list-formats-ext).
Run
python3 detect_persons.py --device /dev/video2 --width 1280 --height 720
python3 detect_persons.py --file sample.mp4
Press q or Esc to stop.
What the code does
Same loop as the analog lab. open_capture() accepts a number or a /dev/videoN path because HDMI dongles rarely sit on index 0. The detector still narrows the frame to --max-width before the scan, so a 1080p grab does not have to be searched at full size.
Command
python3 detect_persons.py --device /dev/video2 --width 1280 --height 720
detect_persons.py
#!/usr/bin/env python3
"""Person boxes on an HDMI FPV picture. The Pi stays on the bench.
Path: goggles HDMI out, or a digital VRX HDMI out, into a USB HDMI
grabber, then into this script. Many grabbers expose more than one
/dev/video node. Pass the node that actually carries frames.
"""
import argparse
import sys
from pathlib import Path
import cv2
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from common.person_detector import PersonDetector, show_stream
def open_capture(args):
if args.file:
return cv2.VideoCapture(args.file)
source = args.device
if str(source).isdigit():
source = int(source)
capture = cv2.VideoCapture(source, cv2.CAP_V4L2)
capture.set(cv2.CAP_PROP_FRAME_WIDTH, args.width)
capture.set(cv2.CAP_PROP_FRAME_HEIGHT, args.height)
capture.set(cv2.CAP_PROP_FPS, args.fps)
return capture
def main():
parser = argparse.ArgumentParser(description="Detect people on a USB HDMI FPV capture.")
parser.add_argument("--device", default="0", help="V4L2 index or path, for example /dev/video2")
parser.add_argument("--width", default=1280, type=int)
parser.add_argument("--height", default=720, type=int)
parser.add_argument("--fps", default=30, type=int)
parser.add_argument("--file", default="", help="MP4 to rehearse with no grabber")
parser.add_argument("--max-width", default=480, type=int, help="Detector width. Lower is faster on a Pi.")
args = parser.parse_args()
show_stream(open_capture(args), PersonDetector(max_width=args.max_width))
if __name__ == "__main__":
main()
common/person_detector.py
#!/usr/bin/env python3
"""Mark people in one video frame.
The detector is the HOG + SVM person model that ships inside OpenCV.
No weight file to download. On a Raspberry Pi the search is slow, so each
frame is narrowed before the scan and the boxes are drawn back on the
full picture.
This file does not open a radio, a camera, or a network port. Each lab
opens its own picture source and calls PersonDetector.
"""
import time
import cv2
def _as_float(value):
if hasattr(value, "ravel"):
flat = value.ravel()
if len(flat):
return float(flat[0])
return float(value)
class PersonDetector:
"""Find people in a BGR frame and draw a box around each one."""
def __init__(self, max_width=480, hit_threshold=0.0):
self.hog = cv2.HOGDescriptor()
self.hog.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector())
self.max_width = int(max_width)
self.hit_threshold = float(hit_threshold)
def detect(self, frame):
"""Return (x, y, w, h, score) boxes in the original frame."""
height, width = frame.shape[:2]
scale = 1.0
work = frame
if width > self.max_width and self.max_width > 0:
scale = self.max_width / float(width)
work = cv2.resize(frame, (self.max_width, max(1, int(height * scale))))
rects, weights = self.hog.detectMultiScale(
work,
winStride=(8, 8),
padding=(8, 8),
scale=1.05,
hitThreshold=self.hit_threshold,
)
boxes = []
inv = 1.0 / scale
for rect, weight in zip(rects, weights):
x, y, w, h = rect
boxes.append((int(x * inv), int(y * inv), int(w * inv), int(h * inv), _as_float(weight)))
return boxes
def draw(self, frame, boxes):
for x, y, w, h, score in boxes:
cv2.rectangle(frame, (x, y), (x + w, y + h), (80, 180, 70), 2)
cv2.putText(
frame,
"person {:.2f}".format(score),
(x, max(18, y - 6)),
cv2.FONT_HERSHEY_SIMPLEX,
0.5,
(80, 180, 70),
1,
cv2.LINE_AA,
)
cv2.putText(
frame,
"persons {}".format(len(boxes)),
(12, 28),
cv2.FONT_HERSHEY_SIMPLEX,
0.7,
(230, 220, 180),
2,
cv2.LINE_AA,
)
return frame
def show_stream(capture, detector, window_name="FPV persons"):
"""Read until the picture ends or the operator presses q or Esc.
capture must provide isOpened(), read() -> (ok, frame), and release().
A cv2.VideoCapture does. The UDP lab's ffmpeg pipe does too.
"""
if capture is None or not capture.isOpened():
raise SystemExit("No picture. Check the source, then run again.")
last = time.time()
frames = 0
try:
while True:
ok, frame = capture.read()
if not ok or frame is None:
time.sleep(0.05)
continue
boxes = detector.detect(frame)
detector.draw(frame, boxes)
frames += 1
now = time.time()
if now - last >= 1.0:
print("frames/s {:.1f} persons {}".format(frames / (now - last), len(boxes)))
frames = 0
last = now
cv2.imshow(window_name, frame)
key = cv2.waitKey(1) & 0xFF
if key in (ord("q"), 27):
break
finally:
capture.release()
cv2.destroyAllWindows()
Copy both files, keep person_detector.py in a common folder next to the lab folder, and run the command above from the lab folder. Props off while you prove the picture. The Pi stays on the ground.