Skip to content

H264 streams are not playing properly

Using VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4) on Linux, I cannot achieve proper playback of an H264 stream.

The stream is coming from a Raspberry Pi with its camera and uses VLC to stream the video via RTSP:

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

Then on my laptop, to view the stream, I use the following command:

vlc rtsp://<ip of my raspberry pi>:8554/stream1

The stream is viewable BUT performances are terrible, there is a lot of delay (I don't mind the delay that much) and the image is sometimes "blocky":

image

When I use ffplay to play the same stream, it works great:

image

This is the ffplay command (I've excluded the arguments used to reduce the delay):

ffplay rtsp://<ip of my raspberry pi>:8554/stream1

Here is a video illustrating the difference between ffplay and VLC.

As you can see, the difference is quite huge, since ffplay can play the video feed without any issues (besides the delay which can be improved by tweaking some parameters), I assume that everything on the raspberry side is ok, and that the issue comes from my VLC client.

I tried with an UDP stream as well:

  • Raspberry "server" : libcamera-vid -t 0 --width 1920 --height 1080 --inline -o udp://CLIENT-IP-ADDRESS:1234
  • VLC client: vlc udp://@:1234 :demux=h264
  • fflplay client: ffplay udp://@:1234

The performances are the same.

This issue also happens on Windows but NOT on Android (I do not have an iOS device to test with).

It seems that I am not the only one experiencing this issue, as per the comment of a raspberry pi developper and the warning included on the raspberry documentation:

image

Is there a log I can provide to help resolve this issue ?

Regards,

Azsde.

Edited by Azsde
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information