🛠 Serveur multimédia HDMI avec le GPU VideoCore IV
Objectives
Transform the Raspberry Pi 3 A+ into a living room media player: 1080p30 video hardware-decoded by the VideoCore IV GPU (H.264 and MPEG-4, 1080p30 decoding and encoding, OpenGL ES 1.1/2.0), full-size HDMI output — plus composite video via the 4-pole jack for older TVs. All over WiFi, without Ethernet.
Hardware
- Raspberry Pi 3 A+, 5 V/2.5 A power supply, TV via HDMI (or composite jack)
- microSD ≥ 16 GB; video streams via WiFi from a network share
- 512 MB of RAM shared between CPU/GPU:
gpu_memtuning is essential - "Appliance" alternative: dedicated LibreELEC image for Kodi
Full code
# 1) Allouer la mémoire GPU (128 Mo suffisent pour du 1080p ; au-delà,
# l'OS n'a plus que 384 Mo sur les 512 Mo partagés)
echo 'gpu_mem=128' | sudo tee -a /boot/firmware/config.txt
# 2) Lecteur avec décodage matériel H.264
sudo apt install -y omxplayer mpv
omxplayer --horizon 0 video_1080p.mp4 # décodage GPU VideoCore
mpv --hwdec=mmal video_1080p.mp4 # ou lecture via Kodi/mpv
# 3) Montage du NAS en WiFi (seul réseau de la carte)
sudo mkdir -p /mnt/nas && sudo mount -t nfs nas:/videos /mnt/nas
# 4) Sortie composite (téléviseur cathodique) : ajouter au config.txt
# sdtv_mode=pal puis redémarrer ; l'HDMI reste disponible.
sudo reboot
Expected verification
omxplayer plays a 1080p30 H.264 file smoothly while watch vcgencmd get_throttled remains at 0x0; the CPU (4× A53) stays below 40% thanks to GPU decoding. Audio outputs via the 4-pole jack or HDMI depending on the setting.
Common errors
- Running a browser + Kodi simultaneously: with 512 MB of RAM, the OS saturates quickly (swap/OOM) — choose a single use case, or use LibreELEC.
gpu_mem=256copied from a Pi 4 tutorial: the OS no longer has enough RAM on this board; stick to 96–128 MB.- Expecting 4K/H.265: the VideoCore IV only decodes H.264/MPEG-4 at 1080p30; HEVC would have to be decoded by the CPUs, to no avail.
- Choppy network streams: WiFi 802.11ac is good but finicky behind furniture — move the router closer rather than increasing power.
- >
Other tutorials for this board
Code examples for this board
led_blink.pyPythonbutton_led.pyPythonservo_sweep.pyPythondht_temp.pyPythonoled_i2c.pyPythonmcp3008_read.pyPython