Reading from an RTSP stream in Python
import numpy as np
import subprocess as sp
FFMPEG_BIN = '/usr/bin/ffmpeg'
RTSP_STREAM = "https://590804fbbbc47.streamlock.net:444/ruidosowebcorp2/ruidosowebcorp2.stream/playlist.m3u8"
COMMAND = [ FFMPEG_BIN,
'-loglevel', 'panic',
'-i', RTSP_STREAM,
'-f', 'image2pipe',
'-pix_fmt', 'rgb24',
'-vcodec', 'rawvideo', '-']
VWIDTH = 800
VHEIGHT = 450
# Grab an image from the RTSP stream
pipe = sp.Popen(COMMAND, stdin = sp.PIPE, stdout = sp.PIPE)
raw_image = pipe.stdout.read(VWIDTH*VHEIGHT*3) # = 1 frame
image = np.frombuffer(raw_image, dtype='uint8').reshape((VHEIGHT,VWIDTH,3))
Source: http://zulko.github.io/blog/2013/09/27/read-and-write-video-frames-in-python-using-ffmpeg/