gstreamer with raspberry pi 5 + dual cam csi 1 + 2

With raspberry pi 5 dual camera setup i want to use the second camera on csi. With setting the input parameter “-i rpi” only the first one can be used. How to select the second camera?

Using

python3 pose_estimation.py -i rpi

worked for default camera and the second camera is also listed, but i do not know how to select it. Please help :slight_smile:

[2:14:48.062524074] [17343]  INFO Camera camera_manager.cpp:325 libcamera v0.3.2+99-1230f78d
[2:14:48.072457436] [17372]  INFO RPI pisp.cpp:695 libpisp version v1.0.7 28196ed6edcf 29-08-2024 (16:33:32)
[2:14:48.081826763] [17372]  INFO RPI pisp.cpp:1154 Registered camera /base/axi/pcie@120000/rp1/i2c@88000/imx477@1a to CFE device /dev/media0 and ISP device /dev/media2 using PiSP variant BCM2712_C0
[2:14:48.081903188] [17372]  INFO RPI pisp.cpp:695 libpisp version v1.0.7 28196ed6edcf 29-08-2024 (16:33:32)
[2:14:48.090827684] [17372]  INFO RPI pisp.cpp:1154 Registered camera /base/axi/pcie@120000/rp1/i2c@80000/imx477@1a to CFE device /dev/media1 and ISP device /dev/media4 using PiSP variant BCM2712_C0
[2:14:48.094455482] [17389]  INFO Camera camera.cpp:1197 configuring streams: (0) 1536x864-BGR888
[2:14:48.094605629] [17372]  INFO RPI pisp.cpp:1450 Sensor: /base/axi/pcie@120000/rp1/i2c@88000/imx477@1a - Selected sensor format: 2028x1080-SBGGR12_1X12 - Selected CFE format: 2028x1080-PC1B

The output of libcamera-hello --list-cameras:

Available cameras
-----------------
0 : imx477 [4056x3040 12-bit RGGB] (/base/axi/pcie@120000/rp1/i2c@88000/imx477@1a)
    Modes: 'SRGGB10_CSI2P' : 1332x990 [120.05 fps - (696, 528)/2664x1980 crop]
           'SRGGB12_CSI2P' : 2028x1080 [50.03 fps - (0, 440)/4056x2160 crop]
                             2028x1520 [40.01 fps - (0, 0)/4056x3040 crop]
                             4056x3040 [10.00 fps - (0, 0)/4056x3040 crop]

1 : imx477 [4056x3040 12-bit RGGB] (/base/axi/pcie@120000/rp1/i2c@80000/imx477@1a)
    Modes: 'SRGGB10_CSI2P' : 1332x990 [120.05 fps - (696, 528)/2664x1980 crop]
           'SRGGB12_CSI2P' : 2028x1080 [50.03 fps - (0, 440)/4056x2160 crop]
                             2028x1520 [40.01 fps - (0, 0)/4056x3040 crop]
                             4056x3040 [10.00 fps - (0, 0)/4056x3040 crop]

I want to use two cameras—one from CSI and the other from USB—and merge their outputs into a single video. The USB camera’s output should be displayed in the bottom-right corner as an overlay, running the HEF model, while the CSI camera’s output remains as the main feed.