I am using pyav
to process a live RTSP stream:
import av
import time
URL = "RTSP_url"
container = av.open(
url, 'r',
options={
'rtsp_transport': 'tcp',
'stimeout': '5000000',
'max_delay': '5000000',
}
)
for packet in self.container.demux(video=0):
for frame in packet.decode():
# do something
time.sleep(10)
What happens if I do something
too slow? Are frames / packets dropped or are they buffered?
I guess the same question would apply to libav
or ffmpeg
.
In my experience gstreamer could store in a buffer old frames and return them even minutes later. Not sure if PyAv would do the same.