How to fix Raspberry Pi libcamera-vid H.264 livestream stuck at first frame


If you’re using libcamera-vid to livestream h264 video as shown in our previous post using a command such as:

libcamera-vid -t 0 --width 1920 --height 1080 --codec h264 --inline --listen -o tcp://

with VLC etc as a client, you might experience VLC displaying the first frame but then getting stuck even though libcamera-vid showing that frames are being captured.

For me, this issue occured only on the Raspberry Pi 5.


I’m not 100% positive on what causes this issue but using mjpeg instead of h264 as the codec seems to fix the issue. You can use the following command to stream MJPEG video:

libcamera-vid -t 0 --width 1920 --height 1080 --codec mjpeg --inline --listen -o tcp://

and the following command to stream it:

vlc tcp/mjpeg://