8

First post here, hopefully i'm in the right place :)

I'm attempting to stream low-latency video from my Raspberry Pi to my Windows PC using Raspivid and VLC. I'm no expert on this stuff and i'm mainly following tutorials and trying to understand what I can. I'm streaming over RTSP.

Here is my code for starting the stream on the Pi. I've used some variations of this that i've found online, but it generally remains the same:

raspivid -o - -t 0 -n -w 600 -h 400 -fps 15 -rot 180 | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/}' :demux=h264

I connect on Windows in VLC using the address:

rtsp://192.168.1.2:8554/

I can start the stream on the Pi and it runs through code, only throwing the following three errors on different lines. In VLC, I can open the stream without issue.

main stream error: unknown query 0x30e in demux_vaControlHelper
main interface error: no suitable interface module
main libvlc error: interface "globalhotkeys,none" initialization failed

Once I get to the stream in VLC though, it freezes and the Pi's terminal gives the following errors:

 main input error: ES_OUT_SET_(GROUP_)PCR  is called too late (pts_delay increased to 1261 ms)

...then buffers to 100% before:

main input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 2939 ms)

...and this buffering and then error loop repeats continuously until right before I terminate the program where it gives this error:

main input error: ES_OUT_SET_(GROUP_)PCR  is called too late (jitter of 6511 ms ignored)
main decoder error: Timestamp conversion failed for 15860001: no reference clock
main decoder error: Could not convert timestamps 0, 0 for h264

Every time the stream buffers, the stream unfreezes and I get some movement in VLC, but nothing usable.

I've tried adding the following flags to my starting command without luck:

  • :network-caching=3000
  • :clock-jitter=0
  • --network-caching
  • --file-caching

Nothing i've found has worked to solve this so far. If anyone has a solution, I would be grateful to hear it. Thanks!

3 Answers 3

3

Some tests on my pi showed that this message vanishes when you set -fps to 50 or above.

2
  • This does seem to fix my immediate issue, which is awesome. However, my stream still has a 2-3 second delay that I can't seem to remedy. Any thoughts on what could cause that? Apr 6, 2019 at 21:08
  • @BenjaminHogervorst did you ever get this to work without the 2-3s delay?
    – CoderChris
    Dec 15, 2019 at 20:00
10

Use the --h264-fps option to suggest input stream fps to VLC.

raspivid -o - -t 0 -n -w 600 -h 400 -fps 15 -rot 180 | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/}' :demux=h264 --h264-fps=15

0

This should be the accepted answer.
Use the same value for raspivid -fps and cvlc --h263-fps= to avoid vlc reading more/less frames than raspivid delivers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.