Skip to content

feat: add 64-bit Raspberry Pi OS (Bookworm/Trixie) support via mpv rewrite#129

Open
alionar wants to merge 35 commits into
Anonymousdog:masterfrom
alionar:feature/mpv-64bit
Open

feat: add 64-bit Raspberry Pi OS (Bookworm/Trixie) support via mpv rewrite#129
alionar wants to merge 35 commits into
Anonymousdog:masterfrom
alionar:feature/mpv-64bit

Conversation

@alionar

@alionar alionar commented Mar 23, 2026

Copy link
Copy Markdown

Summary

omxplayer was removed in Raspberry Pi OS Bullseye/Bookworm and is no longer available on 64-bit ARM. This PR rewrites displaycameras to use mpv instead, enabling support for 64-bit Raspberry Pi OS Bookworm/Trixie (ARM64).

Changes

  • Replace omxplayer with mpv for all camera playback
  • Add mpv_ipccontrol (replaces omxplayer_dbuscontrol via IPC socket + socat)
  • Update install.sh: replace omxplayer packages, add X11/openbox setup
  • Update displaycameras.service: add Requires=xorg.service
  • Remove omxplayer_dbuscontrol
  • Add dev/ Docker test environment for local validation (arm64 + noVNC)

Tested on

  • Docker ARM64 container (vascoguita/raspios:arm64, official RPi OS Lite rootfs)
  • 6 live RTSP camera feeds confirmed working in Docker environment
  • ⚠️ NOT yet tested on real Raspberry Pi hardware. I don't have a spare Pi available for testing at this time

Call for testers

If you have a Raspberry Pi 4 running 64-bit Raspberry Pi OS Bookworm/Trixie, please test this branch and report back. Specifically:

  • Does sudo ./install.sh complete without errors?
  • Do cameras display correctly after sudo systemctl start displaycameras?
  • Is CPU usage reasonable with --hwdec=auto-safe?

Notes

  • Config files (displaycameras.conf, layout.conf.*) are unchanged, no migration needed
  • Legacy 32-bit Buster users should stay on the original omxplayer branch
  • A Docker-based dev environment is included in dev/ for local testing

alionar added 4 commits March 23, 2026 16:16
…ing mpv

- Replace omxplayer with mpv (ARM64 compatible)
- Add mpv_ipccontrol: replaces omxplayer_dbuscontrol via IPC socket + socat
- Add per-camera logging, restart counters, uptime tracking
- Add observe/debug/logs diagnostic commands
- Fix screen blanking: replace fbi with xset dpms (fbi broken on KMS)
- Fix RTSP timeout: use --demuxer-lavf-o=timeout instead of --network-timeout
- Use --hwdec=auto-safe for stability on kernel 6.12+
- Update install.sh: remove omxplayer, add X11/openbox setup, create xorg.service
- Update displaycameras.service: add Requires=xorg.service
- Remove omxplayer_dbuscontrol (replaced by mpv_ipccontrol)
- Add dev/ Docker test environment: arm64 Bookworm + Xvfb + noVNC + automated tests
- Replace omxplayer references with mpv throughout
- Add X11/openbox prerequisite and setup instructions
- Update install, removal, and configuration sections
- Add developer Docker test environment usage
- Add observe/debug/logs command documentation
- Add Bookworm KMS compatibility notes
- Add key differences table vs omxplayer branch
  - Switch base image to vascoguita/raspios:arm64 (official RPi OS Lite rootfs)
  - Replace Xvfb + x11vnc with TigerVNC (Xvnc) — more reliable VNC stack
  - Replace novnc apt package with direct GitHub install v1.4.0 (apt package broken on RPi OS)
  - Add python3-xdg and menu packages to fix openbox warnings
  - Remove set -e from entrypoint to prevent silent failures
  - Increase startup sleep timings for more reliable service startup
  - Reset layout.conf.default to test mode with placeholder RTSP URLs
  - Update README: docker compose up -d --build, run tests via docker exec
  - Add --title="$name" to mpv launch — shows camera name in window title
  - Fix --hwdec: auto-safe on Pi (was incorrectly no), keep no in Docker
  - Deploy openbox-rc.xml to disable mpv window decorations on Pi (install.sh)
  - Disable screen blanking via openbox autostart on Pi (xset -dpms)
  - Bake openbox-rc.xml and DPMS disable into Docker image (Dockerfile)
  - Replace fbi with procps in install.sh packages (watch command needed for observe)
  - Add openbox-rc.xml to dev/config/
@BaltasarParreira

BaltasarParreira commented Mar 23, 2026

Copy link
Copy Markdown

Hi, install works without any problems and I can see my camera feed.

But I'm having problems trying to use full LCD screen as camera image is rotated and on center of screen.
I have the correct settings on OS so that booting and text is showing ok in layout mode, but camera feed is always like in portrait (vertical).

Tried also the rotate option on displaycameras conf file, but still nothing changes.

I'm using a HDMI 800x480 screen on a Raspberry pi.

EDIT: If I call mpv manually from console with this commands all works ok:
mpv --rtsp-transport=tcp 'rtsp://<mystreamurl>' --video-rotate=270

EDIT2: I just solve this editing the line 118 on file "displaycameras" and change this:
DISPLAY=$XDISPLAY mpv \
to this:
DISPLAY=$XDISPLAY mpv --video-rotate=270 \

Them I installed all again with the normal execution from the checkout source directory:
sudo ./install.sh

Anyway after this I found a new problem when running my feed, starting from the command:
sudo systemctl start displaycameras
this command never exits and checking processes I keep seeing start and restart like in a loop and the camera log keeping passing once in a while this:

[   9.050][e][vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION.
[   9.079][e][vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION.
[   9.086][w][ad] Invalid audio PTS: 1.977875 -> 2.253375
[   9.116][e][vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION.
[   9.168][v][ipc_5] Client connected
[   9.169][v][ipc_5] Client disconnected
[   9.169][d][ipc_5] Exiting...
[   9.244][v][ipc_6] Client connected
[   9.245][v][ipc_6] Client disconnected
[   9.245][d][ipc_6] Exiting...
[   9.466][e][vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION.
[   9.521][e][vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION.
[   9.541][e][vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION.
[   9.563][e][vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION.
[   9.598][e][vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION

and so on looping this disconnected error and the image on the screen shows on and off like each 4s to 10s.

alionar added 2 commits March 24, 2026 17:11
  Add mpv_extra_opts to displaycameras.conf to allow passing arbitrary
  mpv flags without editing the script. Add Troubleshooting section to
  README covering OpenGL INVALID_OPERATION errors (fix: --vo=x11) and
  video rotation vs camera rotation confusion.
@alionar

alionar commented Mar 24, 2026

Copy link
Copy Markdown
Author

Hi, install works without any problems and I can see my camera feed.

But I'm having problems trying to use full LCD screen as camera image is rotated and on center of screen. I have the correct settings on OS so that booting and text is showing ok in layout mode, but camera feed is always like in portrait (vertical).

Tried also the rotate option on displaycameras conf file, but still nothing changes.

I'm using a HDMI 800x480 screen on a Raspberry pi.

EDIT: If I call mpv manually from console with this commands all works ok: mpv --rtsp-transport=tcp 'rtsp://<mystreamurl>' --video-rotate=270

EDIT2: I just solve this editing the line 118 on file "displaycameras" and change this: DISPLAY=$XDISPLAY mpv \ to this: DISPLAY=$XDISPLAY mpv --video-rotate=270 \

Them I installed all again with the normal execution from the checkout source directory: sudo ./install.sh

Anyway after this I found a new problem when running my feed, starting from the command: sudo systemctl start displaycameras this command never exits and checking processes I keep seeing start and restart like in a loop and the camera log keeping passing once in a while this:

[   9.050][e][vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION.
[   9.079][e][vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION.
[   9.086][w][ad] Invalid audio PTS: 1.977875 -> 2.253375
[   9.116][e][vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION.
[   9.168][v][ipc_5] Client connected
[   9.169][v][ipc_5] Client disconnected
[   9.169][d][ipc_5] Exiting...
[   9.244][v][ipc_6] Client connected
[   9.245][v][ipc_6] Client disconnected
[   9.245][d][ipc_6] Exiting...
[   9.466][e][vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION.
[   9.521][e][vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION.
[   9.541][e][vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION.
[   9.563][e][vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION.
[   9.598][e][vo/gpu/opengl] after rendering: OpenGL error INVALID_OPERATION

and so on looping this disconnected error and the image on the screen shows on and off like each 4s to 10s.

Hi @BaltasarParreira, thanks for testing!

  • Video rotation:
    rotate=true cycles camera feeds through window positions, it doesn't affect video orientation. The original displaycameras had no option for this, but I've added a video_rotate option for your case. Set it in /etc/displaycameras/displaycameras.conf:
video_rotate=270   # or 90, 180 depending on your camera mount
  • OpenGL restart loop:
    Your display's GPU driver maybe doesn't support mpv's default OpenGL output, common on non-standard HDMI screens like 800×480. Add mpv_extra_opts to /etc/displaycameras/displaycameras.conf:
mpv_extra_opts="--vo=x11"

This switches mpv to software X11 rendering. No extra packages needed. CPU usage goes up slightly but the feed plays without restarting.

Both options are pushed to this branch. Pull the latest and give it a try.

@BaltasarParreira

Copy link
Copy Markdown

Hi, thanks for the quick reply and trying to fix the problems.

I just installed the new version and add the new option for my OpenGL problem in "displaycameras.conf" file:
mpv_extra_opts="--vo=x11"

But now nothing works, no feed showing and I get this on the log file:

[   1.387][v][vo/x11/x11] X11 opening display: :0
[   1.389][e][vo/x11/x11] couldn't open the X11 display (:0)!
[   1.389][d][vo/x11/x11] uninit ...
[   1.389][f][cplayer] Error opening/initializing the selected video_out (--vo) device.
[   1.390][v][lavf] deselect track 0
[   1.390][i][cplayer] Video: no video
[   1.391][v][ad] Codec list:
[   1.392][v][ad]     pcm_alaw - PCM A-law / G.711 A-law
[   1.392][v][ad] Opening decoder pcm_alaw
[   1.393][v][ad] Requesting 1 threads for decoding.
[   1.393][v][ad] Selected codec: pcm_alaw (PCM A-law / G.711 A-law)
[   1.394][v][af] User filter list:
[   1.394][v][af]   (empty)
[   1.394][v][cplayer] Starting playback...
[   1.395][v][cplayer] EOF code: 6  
[   1.395][d][ad] Uninit decoder.
[   1.395][d][cplayer] Terminating demuxers...
[   1.396][d][cplayer] Done terminating demuxers.
[   1.397][v][cplayer] finished playback, something happened (reason 4)
[   1.397][i][cplayer] 
[   1.397][i][cplayer] Exiting... (Errors when loading file)
[   1.398][d][console] Exiting...
[   1.399][d][stats] Exiting...
[   1.401][d][ytdl_hook] Exiting...
[   1.408][d][cplayer] Run command: change-list, flags=64, args=[name="shared-script-properties", operation="append", value="osc-margins=0.000000,0.000000,0.000000,0.000000"]
[   1.408][v][cplayer] Set property: shared-script-properties -> 1
[   1.408][d][cplayer] Run command: change-list, flags=64, args=[name="shared-script-properties", operation="remove", value="osc-margins"]
[   1.408][v][cplayer] Set property: shared-script-properties -> 1
[   1.411][d][osc] Exiting...

Looks like something related with x11 or display number.

@alionar

alionar commented Mar 24, 2026

Copy link
Copy Markdown
Author

@BaltasarParreira Seems like an X display auth issue. Try changing to --vo=xv in your config:

mpv_extra_opts="--vo=xv"

Let me know if that works.

  User=pi caused X auth mismatch since displaycameras runs as root.
  Also fixes setups where the pi user does not exist (Bookworm default).
@alionar

alionar commented Mar 24, 2026

Copy link
Copy Markdown
Author

@BaltasarParreira In the meantime, pushed a fix for the X display auth issue. Please pull the latest and retry with --vo=x11

@BaltasarParreira

BaltasarParreira commented Mar 24, 2026

Copy link
Copy Markdown

Ok, still the same auth problem using the normal systemctl service as you can see in this part of the log:

[   1.424][v][vo/x11/x11] X11 opening display: :0
Authorization required, but no authorization protocol specified

 1.425][d][vo/x11/x11] uninit ...
[   1.426][f][cplayer] Error opening/initializing the selected video_out (--vo) device.
[   1.426][v][lavf] deselect track 0
[   1.426][i][cplayer] Video: no video
[   1.427][v][ad] Codec list:
[   1.427][v][ad]     pcm_alaw - PCM A-law / G.711 A-law
[   1.427][v][ad] Opening decoder pcm_alaw
[   1.428][v][ad] Requesting 1 threads for decoding.
[   1.428][v][ad] Selected codec: pcm_alaw (PCM A-law / G.711 A-law)
[   1.428][v][af] User filter list:
[   1.428][v][af]   (empty)
[   1.428][v][cplayer] Starting playback...
[   1.428][v][cplayer] EOF code: 6  
[   1.428][d][ad] Uninit decoder.
[   1.430][d][cplayer] Terminating demuxers...
[   1.431][d][cplayer] Done terminating demuxers.
[   1.431][v][cplayer] finished playback, something happened (reason 4)
[   1.431][i][cplayer] 
[   1.431][i][cplayer] Exiting... (Errors when loading file)

But running manual from SSH console and now I have to do it like this or he can't find the display:
sudo DISPLAY=:0 /usr/bin/displaycameras start

Old version was not needed to pass the: "DISPLAY=:0" calling displaycameras command.
Anyway I can see the feed running this manually, but now is a really small window with all black around a bit to the right side of the screen and I didn't change any configuration related with sizes and positions, still using this as before:

# 1x1 full screen
windows=(full_screen)
# Make sure to account for each window above in the list below.

# Windows positions

window_positions=(
"0 0 799 479"
)

# Camera Names

camera_names=(DOORCAM)
# Make sure to account for each camera above in the list of feeds below.

# Camera Feeds

camera_feeds=(
'rtsp://<my stream url>'
)

EDIT: Also now, after booting screen no longer shows the console login text and always has a mouse cursor with black background, before this cursor never showed.

@BaltasarParreira

BaltasarParreira commented Mar 26, 2026

Copy link
Copy Markdown

Tried to figure out this auth problem myself, but still no go for now.
All tests around .Xauthority credentials and sudo didn't solve it.

EDIT: I solved the auth problem with this:

 export DISPLAY=:0
sudo xhost si:localuser:root

But then when I do "sudo systemctl start displaycameras" the feed shows with the small windows on the right middle side of the screen and hangs a bit them that command returns this error:

Job for displaycameras.service failed because a timeout was exceeded.
See "systemctl status displaycameras.service" and "journalctl -xeu displaycameras.service" for details.

Apart this, the small square showing the feed stays on the screen working.
This is what it looks like:

EDIT2; Anyway after a few time the feed disappears and reapers like a restart and I see this on the camera log:

[   4.066][v][ipc_1] Client connected
[   4.066][v][ipc_1] Client disconnected
[   4.066][d][ipc_1] Exiting...
[   4.132][v][ipc_2] Client connected
[   4.132][v][ipc_2] Client disconnected
[   4.132][d][ipc_2] Exiting...
[  86.971][w][cplayer] Invalid video timestamp: 84.515744 -> 84.130478
[  87.418][w][ad] Invalid audio PTS: 85.774750 -> 85.283625
[  88.004][w][cplayer] Invalid video timestamp: 85.484311 -> 85.131667
[  88.065][w][ad] Invalid audio PTS: 85.923625 -> 86.199125
[  88.702][w][ad] Invalid audio PTS: 86.839125 -> 87.115500
[  88.930][w][cplayer] Invalid video timestamp: 86.486656 -> 86.132689
tail: /var/log/displaycameras/mpv-DOORCAM.log: file truncated
[   0.027][v][cplayer] mpv 0.35.1 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
[   0.027][v][cplayer]  built on UNKNOWN
[   0.027][v][cplayer] FFmpeg library versions:
[   0.027][v][cplayer]    libavutil       57.28.100
[   0.027][v][cplayer]    libavcodec      59.37.100
[   0.027][v][cplayer]    libavformat     59.27.100
[   0.027][v][cplayer]    libswscale      6.7.100
[   0.027][v][cplayer]    libavfilter     8.44.100
[   0.027][v][cplayer]    libswresample   4.7.100
[   0.027][v][cplayer] FFmpeg version: 5.1.8-0+deb12u1+rpt1
[   0.027][v][cplayer] 
[   0.027][v][cplayer] Configuration: meson configure build -Dprefix=/usr -Dbuildtype=plain -Doptimization=plain

@BaltasarParreira

BaltasarParreira commented Mar 26, 2026

Copy link
Copy Markdown

Ah ah ah ahhh.... ; )
Small feed window fixed, for some reason the coordinates now they are sort of flipped.
Before was working with this:

window_positions=(
"0 0 799 479"
)

Now I get full window with this:

window_positions=(
"0 0 479 799"
)

@alionar

alionar commented Apr 1, 2026

Copy link
Copy Markdown
Author

Hey @BaltasarParreira, I checked your photos and logs. Three guesses at root causes:

  • The timeout / restart loop

    The service file sets Type=forking, but the script never forks. It starts mpv in the background, does its health checks, and exits. systemd keeps waiting for a fork signal, times out, then Restart=on-failure kills the mpv processes and starts over. That loop matches your on/off behavior.

    The master branch used Type=oneshot with RemainAfterExit=yes. The script launches things and gets out of the way. That pattern fits better.

  • X11 auth
    Your xhost si:localuser:root workaround tracks. The service file has no Environment=DISPLAY=:0 or Environment=XAUTHORITY=/root/.Xauthority lines. omxplayer bypassed X11 entirely through the GPU overlay, so the old branch never needed them.

    On Bookworm, startx from a systemd service also needs allowed_users=anybody in /etc/X11/Xwrapper.config (default console blocks it) and Environment=HOME=/root in the xorg.service so startx writes .Xauthority to the right place.

  • The "flipped" coordinates

    mpv's --geometry respects video aspect ratio and shrinks the window to fit. omxplayer's --win placed pixels at exact coordinates on the GPU overlay. Adding --no-keepaspect-window to the mpv flags should force it to fill the specified geometry. Your original "0 0 799 479" coordinates should work with that flag, no swap needed.

I'll try to spare some time to push these changes to a branch as well.

@BaltasarParreira

BaltasarParreira commented Apr 1, 2026

Copy link
Copy Markdown

Ok, news tests with your last information.

1. The timeout / restart loop:

I think this is the correct way.
I edit this file:
sudo vi /etc/systemd/system/displaycameras.service

and changed the Type to:
Type=oneshot

adding on the same group the new line:
RemainAfterExit=yes

Them I run:
sudo systemctl daemon-reload

Ressult: The calling of sudo systemctl stop displaycameras get's stuck without never exiting to prompt again and once in a while this connect/disconnect showing on the log like this:

[  93.248][w][ffmpeg/demuxer] rtsp: CSeq 18 expected, 16 received.
[  95.435][w][cplayer] Invalid video timestamp: 71.935633 -> 71.045967
[  98.475][w][cplayer] Invalid video timestamp: 74.103422 -> 73.980722
[  99.202][w][ffmpeg/demuxer] rtsp: CSeq 19 expected, 17 received.
[ 105.167][w][cplayer] Invalid video timestamp: 80.672900 -> 77.971300
[ 106.076][w][cplayer] Invalid video timestamp: 78.878300 -> 78.089411
[ 109.840][w][cplayer] Invalid video timestamp: 81.838544 -> 81.016289
[ 112.753][w][cplayer] Invalid video timestamp: 83.925833 -> 83.904000
[ 118.663][v][ipc_4] Client connected
[ 118.664][v][ipc_4] Client disconnected
[ 118.664][d][ipc_4] Exiting...
[ 120.893][w][cplayer] Invalid video timestamp: 92.043444 -> 87.956422
[ 123.777][w][cplayer] Invalid video timestamp: 90.844944 -> 90.087889
[ 126.735][w][cplayer] Invalid video timestamp: 93.057311 -> 92.943156
[ 127.100][w][cplayer] Invalid video timestamp: 93.312156 -> 93.069178
[ 128.107][w][cplayer] Invalid video timestamp: 94.076178 -> 93.960489
[ 138.097][w][cplayer] Invalid video timestamp: 103.950544 -> 98.905222
[ 138.583][w][cplayer] Invalid video timestamp: 99.376222 -> 99.022667
[ 139.947][w][cplayer] Invalid video timestamp: 100.386167 -> 100.034578
[ 141.308][w][cplayer] Invalid video timestamp: 101.394700 -> 101.042500

but no more the on/off effect on the screen and camera feed showing at least.

2. X11 auth.

I didn't test nothing further since my previous changes are still in effect and don't get AUTH errors starting the service, etc,
Maybe when a new revision with this changed as you are doing it soon, I can try. I have to see how to reset the things I did to fix it, worst scenario I do a fresh install of everything from scratch formatting the SD and so on.

3. The "flipped" coordinatesc.

Adding the "--no-keepaspect-window" to the "mpv_extra_opts=" on the conf file didn't change nothing when I revert back the size to "0 0 799 479".
The feed shows as a small landscape square on the middle right side of the screen and not full screen.

alionar added 3 commits April 4, 2026 23:07
displaycameras.service was using Type=forking with an empty PIDFile, causing a restart loop. Restored upstream's Type=oneshot design with RemainAfterExit=yes. Added -ac flag to startx in xorg.service to disable X11 access control, fixing "Authorization required" errors when mpv connects to the display.
Add --no-keepaspect to mpv so camera feeds stretch to fill the configured window region like omxplayer did. Add -nocursor to X server startup to hide the mouse cursor on the kiosk display. Add troubleshooting docs for rotated display window sizing.
  - Add rotate/rotaterev cases using mpv IPC geometry (ported from upstream)
  - Fix getplaystatus to query core-idle via IPC instead of PID check
  - Remove fbi blanking (broken under X11+KMS), add x11-xserver-utils
  - Add setvideopos IPC command, seq_step validation, update docs
@alionar

alionar commented Apr 4, 2026

Copy link
Copy Markdown
Author

Hi @BaltasarParreira , here's what changed:

  • systemctl stop hang: service file had no stop timeout. Added TimeoutStopSec=30.
  • X11 auth: xorg.service now passes -ac to the X server, turns off access control. You won't need your xhost si:localuser:root workaround.
  • Small window: I gave you the wrong flag. --no-keepaspect-window only affects WM hints. The right one is --no-keepaspect, which stretches video to fill the geometry like omxplayer. Try reverting to your
    original "0 0 799 479". If still wrong, check DISPLAY=:0 xdpyinfo | grep dimensions — OS display rotation can flip effective resolution to 480×800.
  • Cursor: hidden via -nocursor on X server.
  • Feed cycling: rotate/rotaterev implemented via mpv IPC. Repositions windows without restarting streams.
  • 10-minute screen blank: x11-xserver-utils was missing from install, so xset DPMS commands failed silently. Now included.

alionar added 9 commits April 5, 2026 00:24
mpv 0.35.1 ignores set_property geometry for repositioning.  wmctrl moves windows via X11, matching omxplayer's original behavior.
mpv ≥0.39 no longer forces window position from --geometry. Feature-detect --force-window-position via mpv --list-options and inject it when available. No-op on Bookworm's mpv 0.35.1.
X11 root window handles screen blanking. fbi + black.png was the omxplayer-era approach for framebuffer blanking
 is_alive() was never called. get_uptime() can't be used inside watch subshell
Cron runs repair every 60s. With multiple broken cameras, repair can exceed 60s and overlap. flock -n makes the second invocation exit immediately. Also removed unnecessary PIDFILE delete/recreate from the repair loop
@alionar alionar changed the title feat: add 64-bit Raspberry Pi OS (Bookworm) support via mpv rewrite feat: add 64-bit Raspberry Pi OS (Bookworm/Trixie) support via mpv rewrite Apr 5, 2026
@BaltasarParreira

BaltasarParreira commented Apr 5, 2026

Copy link
Copy Markdown

Hi, fresh install from scratch of the OS and downloaded your latest "feature/mpv-64bit" revision.
All ok except the screen orientation with the flag "--no-keepaspect" that still is not working, with this and the original "0 0 799 479" size configuration now I have the streaming square on the full half right of the screen like squashed width so it fits on that half part.

Changing back to the flipped coordinates settings ( "0 0 479 799") and without that flag I got the full landscape feed on the screen again like before.

The command:
DISPLAY=:0 xdpyinfo | grep dimensions
gives me this:
dimensions: 480x800 pixels (127x211 millimeters)

EDIT: Well... after a certain time on running, It starts getting a few freezes on the feed and/or huge delay on the image and this starts showing on the log:

[ 196.122][v][ipc_12] Client disconnected
[ 196.122][d][ipc_12] Exiting...
[ 196.158][v][ipc_13] Client connected
[ 196.158][v][ipc_13] Client disconnected
[ 196.158][d][ipc_13] Exiting...

Maybe is a hardware limitation as I'm running everything on a Raspberry pi zero 2w.
If I disable the log writing could help if its possible to do that... no?
I think as too many lines passing could create the feed delaying because of processing all of them.

@alionar

alionar commented Apr 5, 2026

Copy link
Copy Markdown
Author

Even with Docker for dev testing, mpv with a 2×2 grid can already overload the container CPU. The Pi Zero 2W is probably the bottleneck.

The Pi Zero 2W doesn't have enough headroom for mpv under X11. omxplayer decoded on the VideoCore GPU overlay at ~5% CPU. mpv goes through X11 and software decode, which eats 50%+ CPU per stream. I hit the same thing and had to drop from 9 cameras to 4 in dev Docker setup.

Hi, fresh install from scratch of the OS and downloaded your latest "feature/mpv-64bit" revision. All ok except the screen orientation with the flag "--no-keepaspect" that still is not working, with this and the original "0 0 799 479" size configuration now I have the streaming square on the full half right of the screen like squashed width so it fits on that half part.

Changing back to the flipped coordinates settings ( "0 0 479 799") and without that flag I got the full landscape feed on the screen again like before.

The command: DISPLAY=:0 xdpyinfo | grep dimensions gives me this: dimensions: 480x800 pixels (127x211 millimeters)

EDIT: Well... after a certain time on running It starts getting a few freezes on the feed and/or huge delay on the image and this starts showing on the log:

[ 196.122][v][ipc_12] Client disconnected
[ 196.122][d][ipc_12] Exiting...
[ 196.158][v][ipc_13] Client connected
[ 196.158][v][ipc_13] Client disconnected
[ 196.158][d][ipc_13] Exiting...

Maybe is a hardware limitation as I'm running everything on a Raspberry pi zero 2w. If I disable the log writing could help if its possible to do that... no? I think as too many lines passing could create the feed delaying because of processing all of them.

@alionar

alionar commented Apr 6, 2026

Copy link
Copy Markdown
Author

@BaltasarParreira I pushed a few changes that should make a noticeable difference on your hardware:

  • hwdec was broken: turns out --hwdec=auto-safe never actually tries v4l2m2m (it's not in mpv's whitelist). The script now checks for /dev/video10 and uses --hwdec=v4l2m2m-copy explicitly. Your Zero 2W has the bcm2835-codec so hardware decode should actually kick in now. That alone should cut CPU from ~50% to ~5-10% per stream.
  • 150MB buffer per stream is gone: mpv defaults to 150MB demuxer cache, which is 30% of your 512MB RAM. Now 512K.
  • audio disabled: also fixes those Invalid audio PTS warnings in your logs.

@BaltasarParreira

Copy link
Copy Markdown

Hi, ok I just update with the latest changes but the feed delays after a certain time is still there.
I notice this since the timestamp clock on the feed starts to be less than +/- 1m from the real time and if I pass my hand in front of the camera it takes that time so I can see it on the screen.

The log still shows a lot of this:

[ 147.288][w][cplayer] Invalid video timestamp: 110.287022 -> 106.100889
[ 147.717][w][cplayer] Invalid video timestamp: 106.537889 -> 106.183689
[ 150.434][w][cplayer] Invalid video timestamp: 108.896067 -> 108.174933
[ 151.823][w][cplayer] Invalid video timestamp: 109.496067 -> 109.142533
[ 161.680][w][cplayer] Invalid video timestamp: 119.068033 -> 115.083478
[ 162.697][w][cplayer] Invalid video timestamp: 116.090478 -> 115.200511
[ 164.704][w][cplayer] Invalid video timestamp: 117.217678 -> 117.135111
[ 165.682][w][cplayer] Invalid video timestamp: 118.109111 -> 117.253489
[ 167.006][w][cplayer] Invalid video timestamp: 118.581922 -> 118.227922
[ 168.367][w][cplayer] Invalid video timestamp: 119.591356 -> 119.238656
[ 170.642][w][cplayer] Invalid video timestamp: 121.518389 -> 121.139122
[ 180.845][v][ipc_9] Client connected
[ 180.846][v][ipc_9] Client disconnected
[ 180.847][d][ipc_9] Exiting...
[ 180.884][v][ipc_10] Client connected
[ 180.884][v][ipc_10] Client disconnected
[ 180.885][d][ipc_10] Exiting...
[ 199.866][w][cplayer] Invalid video timestamp: 150.357411 -> 137.011811
[ 200.676][w][cplayer] Invalid video timestamp: 137.816811 -> 137.129544
[ 203.498][w][cplayer] Invalid video timestamp: 139.955556 -> 139.132989
[ 204.507][w][cplayer] Invalid video timestamp: 140.139989 -> 140.017511
[ 205.237][w][cplayer] Invalid video timestamp: 140.756511 -> 140.133500

Cpu and memory optimization at least looking to "top" looks ok I guess:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants