Commit 6b7910d
committed
refactor(viewer): swap libmpv embed for QtMultimedia + GStreamer
The libmpv-embedded path engaged HW decode correctly on all 4 Qt6
boards but didn't move Pi 4 frame drops below the subprocess-mpv
baseline (562–2973 drops/60 s, same range as PR #2885). Real-device
verbose mpv logging confirmed the decoders engaged; the bottleneck
was V3D 6.0 fillrate through libmpv-render → QOpenGLWidget FBO →
Qt-compositor → eglfs swap. Skipping the FBO indirection by porting
to QOpenGLWindow crashed under eglfs's single-native-window-per-
process limit (reverted at f057198).
QtMultimedia + gstreamer is the next try:
- ``VideoView`` rewritten around QMediaPlayer + QVideoWidget +
QAudioOutput. QVideoWidget paints inside MainWindow's existing
eglfs native window, so we don't trip the single-window
restriction. Stats logger keeps the same /data/.anthias/mpv-stats.log
schema (INIT / LOADFILE / PLAYING / SAMPLE / END_FILE) with a
drop estimate computed from container_fps × elapsed − frames-
delivered (QVideoSink::videoFrameChanged counter).
- ``QT_MEDIA_BACKEND=gstreamer`` is set in the viewer Dockerfile so
Qt picks the gstreamer backend over its ffmpeg one — the rpi
``v4l2slh264dec`` / ``v4l2slh265dec`` elements (in rpt3
``gstreamer1.0-plugins-bad``, confirmed via ``dpkg-deb -c`` on
the .deb) route directly to QVideoSink.
- ``docker/_rpt1-ffmpeg-pin.j2`` extends the rpi-archive pin to
``gstreamer1.0-*`` + ``libgstreamer*`` so plugins-bad wins from
rpt3 over stock Debian (priority bump 100 → 1001).
- ``viewer_extra_apt_dependencies`` swaps libmpv2 for the
gstreamer1.0-{alsa,libav,plugins-{base,good,bad,ugly}} +
libqt6multimedia6 + libqt6multimediawidgets6 + qt6-multimedia-dev
set.
- ``MPVMediaPlayer`` Python options shrink to audio-device +
video-rotate (Pi 4 only). Removed: hwdec, video-sync,
vd-lavc-threads, the _PI_HWDEC_BY_CODEC table, _probe_video_codec,
_pi_hwdec_for_uri. Codec dispatch is now gstreamer's job.
- Python tests drop the ~12 per-codec / ffprobe-dispatch tests;
C++ tests drop the mpv_get_property_string round-trip in favour
of QMediaPlayer construction + option-passthrough assertions.
Codec-gate symmetry test replaced with "gate codecs ⊆
{h264, hevc}" — broader, catches a relaxation of the upload
gate at the same time.
Pi 4 perf gain is unverified — Pi 4 testbed went offline
mid-session (along with Pi 5 and Rock Pi 4). Real-device
validation pending.1 parent f057198 commit 6b7910d
10 files changed
Lines changed: 533 additions & 887 deletions
File tree
- docker
- src
- anthias_viewer
- anthias_webview
- src
- tests
- tests
- tools/image_builder
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | 20 | | |
| 21 | + | |
23 | 22 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
120 | 119 | | |
121 | 120 | | |
122 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
123 | 134 | | |
124 | 135 | | |
125 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | | - | |
| 5 | + | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
234 | 233 | | |
235 | 234 | | |
236 | 235 | | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | 236 | | |
344 | 237 | | |
345 | 238 | | |
| |||
357 | 250 | | |
358 | 251 | | |
359 | 252 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
380 | 273 | | |
| 274 | + | |
381 | 275 | | |
382 | 276 | | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | 277 | | |
389 | | - | |
390 | | - | |
391 | 278 | | |
392 | 279 | | |
393 | 280 | | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | 281 | | |
398 | 282 | | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
403 | 287 | | |
404 | 288 | | |
405 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
0 commit comments