How to livestream Raspberry Pi camera using libcamera-vid & VLC

On the pi, run the following command

libcamera-vid -t0 --width 1920 --height 1080 --framerate 10 --nopreview --codec h264 --profile high --intra 5 --listen -o tcp://

On the computer where you want to play the livestream, run the following command

vlc tcp/h264://

where is the IP address of the raspberry pi.

Internally, this uses a raw H.264 stream over TCP. This works best over the local network, but it will also work over VPN or the internet, if your networking setup allows it.

Original source: Github discussion