mediamtx: Incompatibility with libcamera 0.1.0 and Raspberry Pi 5
Which version are you using?
v1.2.0
Which operating system are you using?
- Linux amd64 standard
- Linux amd64 Docker
- Linux arm64 standard
- Linux arm64 Docker
- Linux arm7 standard
- Linux arm7 Docker
- Linux arm6 standard
- Linux arm6 Docker
- Windows amd64 standard
- Windows amd64 Docker (WSL backend)
- macOS amd64 standard
- macOS amd64 Docker
- Other (please describe)
Describe the issue
Description
mediamtx fails to work after apt-get upgrade
Libcamera: v0.1.0+52-a858d20b
Describe how to replicate the issue
sudo apt-get update && sudo apt-get upgrade-y
Did you attach the server logs?
/dev/shm/rtspss-embeddedexe-1698423452247192666: error while loading shared libraries: libcamera.so.0.0: cannot open shared object file: No such file or directory
yes
Did you attach a network dump?
no
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 33 (7 by maintainers)
Commits related to this issue
- rpi: embed libcamera and libfreetype into the server (#2581) — committed to bluenviron/mediamtx by aler9 2 years ago
- rpi: embed libcamera and libfreetype into the server (#2581) — committed to bluenviron/mediamtx by aler9 2 years ago
- rpi: embed libcamera and libfreetype into the server (#2581) — committed to bluenviron/mediamtx by aler9 2 years ago
- rpi: embed libcamera and libfreetype into the server (#2581) — committed to bluenviron/mediamtx by aler9 2 years ago
- rpi: embed libcamera and libfreetype into the server (#2581) (#3665) — committed to bluenviron/mediamtx by aler9 2 years ago
- rpi: add H264 software encoder (#2581) This allows to use the RPI camera on the Raspberry Pi 5 too. — committed to bluenviron/mediamtx by aler9 2 years ago
- rpi: add H264 software encoder (#2581) This allows to use the RPI camera on the Raspberry Pi 5 too. — committed to bluenviron/mediamtx by aler9 2 years ago
- add H264 software encoder (https://github.com/bluenviron/mediamtx/issues/2581) (#10) — committed to bluenviron/mediamtx-rpicamera by aler9 2 years ago
- rpi: add H264 software encoder (#2581) (#3670) This allows to use the RPI camera on the Raspberry Pi 5 too. — committed to bluenviron/mediamtx by aler9 2 years ago
I was able to compile against libcamera 0.2.0 (part of current RasbperryPi OS, Bookworm) by removing these lines. Would it be possible to provide a compile-time switch to be able to compile against the current version rather than manually patching the code?
It there an estimate on how long mediamtx will be dependent on
0.0.5or0.1.0before migrating to0.2.0?In 1.2.1 I had to create library links in bookworm to get it running:
@masipcat, I tried your solution
and it works for my Raspberry Pi 5 (Raspberry Pi OS (64-bit)). It takes up to 5 seconds to start the stream, then it streams with a subsecond delay to my laptop over wifi. It even works for two cameras.
My script with tiny improvements:
new libcamera changes related to transform pushed to bookworm 😉
raspberry pi5 bookworm camera v3 docker docker run --rm -it --network=host --privileged --tmpfs /dev/shm:exec -v /run/udev:/run/udev:ro -e MTX_PATHS_CAM_SOURCE=rpiCamera bluenviron/mediamtx:latest-rpi 2023/11/28 13:39:58 INF MediaMTX v1.3.1 2023/11/28 13:39:58 INF configuration loaded from /mediamtx.yml 2023/11/28 13:39:58 INF [path cam] [RPI Camera source] started 2023/11/28 13:39:58 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP) 2023/11/28 13:39:58 INF [RTMP] listener opened on :1935 2023/11/28 13:39:58 INF [HLS] listener opened on :8888 2023/11/28 13:39:58 INF [WebRTC] listener opened on :8889 (HTTP), :8189 (ICE/UDP) 2023/11/28 13:39:58 INF [SRT] listener opened on :8890 (UDP) [0:32:34.424405642] [13] INFO Camera camera_manager.cpp:297 libcamera v0.0.5+83-bde9b04f 2023/11/28 13:39:59 ERR [path cam] [RPI Camera source] camera_create(): selected camera is not available [0:32:39.569273539] [19] INFO Camera camera_manager.cpp:297 libcamera v0.0.5+83-bde9b04f 2023/11/28 13:40:04 ERR [path cam] [RPI Camera source] camera_create(): selected camera is not available
MediaMTX now supports serving the Raspberry Pi Camera feed on both Raspberry Pi OS Bookworm and Bullseye (because dependencies have been embedded inside the server) and on the Raspberry Pi 5 (because a H264 software encoder was added as failback).
Libcamera 0.3.0 has been pushed to bookworm and removed transform altogether. In order to compile from source, you need to use the new orientation enumeration. Replace the lines by @Topper69 with:
And replace
using libcamera::Transform;withusing libcamera::Orientation;If I run
apt-get install libcamera0on Pi5 it somehow kills my GUI… I can stillsshinto the pi.Before I had
libcamera-hello --list-camerasbut obviously this has now gonemediamtx.ymlincludesas per docs
I have no
rpicam-vidcommand availableWorse for the delay ?