I have successfully streamed an h264 video over the local network with this command.

raspivid -o - -t 0 -n -w 1280 -h 720  -vf -vs -fps 30  -b 3500000 | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/}' :demux=h264

I can view the stream on my iOS VLC app through the address


But I have no luck viewing the stream on my local computer. Here's a script I made.

import cv2
import imutils
from imutils.video import VideoStream

stream = "rtsp://"

vs = VideoStream(src=stream).start()

while True:
    frame = vs.read()

    cv2.imshow('frame', frame)

    if cv2.waitKey(1) != -1:

OpenCV is not able to get any frame from the address. Please correct me if I'm wrong, but I am wondering perhaps it needs the video to be wrapped in a container like mp4. Can anyone tell me how to achieve that? Can it be easily piped in the first command?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.