🛠 Accélération GPU et streaming vidéo (Intel UHD, VAAPI)

LattePanda 3 Delta (id: lattepanda-3) · avance · Schéma : IMG-lattepanda-3-avance-2-acceleration-video.svg — Flux vidéo entrant transcodé par le GPU Intel UHD via VAAPI puis diffusé en HLS, avec sortie HDMI 2.0b et sortie réseau vers des clients.

Objectives

The Celeron N5105 (Jasper Lake) integrates an Intel UHD GPU (450–800 MHz) with hardware decoding/encoding. On Linux, the VAAPI API exposes this acceleration: transcoding video using the GPU instead of 4 CPU threads, connecting a 4K screen via HDMI 2.0b, or streaming a feed to other devices. This tutorial verifies the graphics stack, transcodes with accelerated ffmpeg, and measures the CPU gain. Useful context: at product launch, CNX Software noted imperfect 4K YouTube playback on early Jasper Lake systems — a platform software maturity issue, not a board defect; since then, the VAAPI stack has matured on recent kernels.

Hardware

Complete code

# 1. Installer la pile de décodage matériel
sudo apt update
sudo apt install -y vainfo intel-gpu-tools ffmpeg mesa-va-drivers

# 2. Vérifier les codecs accélérés disponibles (attendu : H.264, VP8, VP9, JPEG...)
vainfo

# 3. Transcoder UNE vidéo en utilisant le GPU (comparez 'top' pendant le run)
ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi \
  -vaapi_device /dev/dri/renderD128 \
  -i entree.mp4 \
  -vf 'format=nv12|vaapi,hwupload,scale_vaapi=w=1280:h=720' \
  -c:v h264_vaapi -b:v 2M sortie_720p.mp4

# 4. Diffuser en direct sur le réseau (HLS), lu par n'importe quel navigateur
mkdir -p /tmp/hls
ffmpeg -re -i entree.mp4 \
  -c:v h264_vaapi -b:v 2M -g 50 \
  -f hls -hls_time 4 -hls_list_size 6 -hls_flags delete_segments \
  /tmp/hls/direct.m3u8 &
cd /tmp/hls && python3 -m http.server 8000
# Sur un autre poste : http://IP-de-la-carte:8000/direct.m3u8

# 5. Contrôler l'occupation GPU/CPU pendant la diffusion
sudo apt install -y intel-gpu-tools
grep -r . /sys/class/drm/card0/gt_act_freq_mhz 2>/dev/null || true
top -o %CPU

Expected verification

vainfo lists VA-API entries (VAProfileH264…) without errors; during transcoding, top shows ffmpeg well below 100% total CPU usage (the GPU does the work) whereas software transcoding (-c:v libx264) saturates the 4 threads. The HLS stream plays in a browser from another device. The HDMI output displays the interface smoothly.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials