You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every time the RPi system is rebooted the MediaMTX camera path with index RPICameraCamID=0 and the camera with index RPICameraCamID=1 have a chance of being switched.
e.g. This means that the MediaMTX camera at path camera_0 will be randomly assigned to physical camera at CSI0 or CSI1 every system boot. The camera at path camera_1 will be assigned to the other device.
If I open a WebRTC stream for one camera path [ e.g. http://192.168.1.211:8889/camera_0/] then the video will randomly switch between cameras after a system reboot.
Restarting the MediaMTX server does not affect this behaviour, only restarting the OS changes the camera mappings.
However, when calling the libcamera cli, the results are consistent across reboots, camera '0' is always CAM0
Edit: original comment was r.e. mediamtx-rpicamera / camera.cpp
Just double checked that libcamera CameraManager::cameras() order is indeed stable between system boots. Even if MediaMTX stream shows the cameras flipped, the cameras are always at the same index.
Test code:
int main()
{
std::unique_ptr<CameraManager> cm = std::make_unique<CameraManager>();
cm->start();
for (int i = 0; i < 2; i++)
std::cout << std::to_string(i) + " - " << cm->cameras()[i].get()->id() << std::endl;
cm->stop();
return 0;
}
[0:01:19.951268580] [1156] INFO Camera camera_manager.cpp:297 libcamera v0.0.5+83-bde9b04f
[0:01:20.001300324] [1157] INFO RPI vc4.cpp:437 Registered camera /base/soc/i2c0mux/i2c@0/imx290@1a to Unicam device /dev/media4 and ISP device /dev/media0
[0:01:20.017983955] [1157] INFO RPI vc4.cpp:437 Registered camera /base/soc/i2c0mux/i2c@1/imx290@1a to Unicam device /dev/media5 and ISP device /dev/media2
0 - /base/soc/i2c0mux/i2c@0/imx290@1a
1 - /base/soc/i2c0mux/i2c@1/imx290@1a
Which version are you using?
v1.9.3
Which operating system are you using?
Linux arm64 standard
Describe how to replicate the issue
Every time the RPi system is rebooted the MediaMTX camera path with index RPICameraCamID=0 and the camera with index RPICameraCamID=1 have a chance of being switched.
e.g. This means that the MediaMTX camera at path camera_0 will be randomly assigned to physical camera at CSI0 or CSI1 every system boot. The camera at path camera_1 will be assigned to the other device.
If I open a WebRTC stream for one camera path [ e.g. http://192.168.1.211:8889/camera_0/] then the video will randomly switch between cameras after a system reboot.
Restarting the MediaMTX server does not affect this behaviour, only restarting the OS changes the camera mappings.
However, when calling the libcamera cli, the results are consistent across reboots, camera '0' is always CAM0
libcamera-still --camera 0 --output test_c0_r11.jpg
[0:01:22.065130239] [1082] INFO RPI vc4.cpp:565 Sensor: /base/soc/i2c0mux/i2c@1/imx290@1a - Selected sensor format: 1920x1080-SRGGB12_1X12 - Selected unicam format: 1920x1080-pRCC
Server logs
No response
Network dump
No response
The text was updated successfully, but these errors were encountered: