Main Content

Use Raspberry Pi Camera Board for Bookworm Raspbian Linux Operating System

Currently, the V4L2 Video Capture block does not support the Raspberry Pi® camera board for the Bookworm Raspbian Linux® operating system running on your Raspberry Pi board. Alternatively, you can use the USB web camera.

However, as a workaround to use the Raspberry Pi camera board for the Bookworm operating system, follow these steps.

  1. Execute these commands on the MATLAB® Command Window to open the Raspberry Pi terminal.

    r=raspberrypi('<Raspberry Pi IP address>','<Raspberry Pi username>','<Raspberry Pi password>');
    r.openShell

  2. Execute this command on the Raspberry Pi terminal to generate a RTSP video stream using the Raspberry Pi camera board.

    sudo libcamera-vid -t 0 --inline --width 640 --height 480 --framerate 30 -o - | cvlc stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/stream1}' :demux=h264

  3. To receive the RTSP video stream, use the RTSP Video Stream Receive block in your Simulink® model. Ensure to configure the same parameters as used in the command to generate a video stream in the Block Parameters dialog box of the RTSP Video Stream Receive block.

See Also

|

Related Topics