ffmpeg-python
ffmpeg-python copied to clipboard
specify protocol option before input?
I'm trying to specify a protocol before my input so that I can capture a png from an RTSP stream. Right now I have
(
ffmpeg
.input(stream)
.filter("scale", width, -1)
.output(time_now + ".png", vframes=1)
.overwrite_output()
.run(capture_stdout=True, capture_stderr=True)
)
This captures frames, but is often gitchy as it grabs the first frame it sees and something something keyframes.
One soultion I found for this is to force tcp
$ ffmpeg -rtsp_transport tcp -i "$SOURCE" -frames 1 ./picture1.jpg
but I'm unclear on how I can specify the rtsp/tcp protocols.
Background https://stackoverflow.com/questions/23238295/force-ffmpeg-to-use-tcp-protocol-when-reading-a-rtsp-stream https://stackoverflow.com/questions/49868802/rtsp-frame-grabbing-creates-smeared-pixeled-and-corrupted-images
add to input call kwargs like ffmpeg.input(stream, ss="00:00:11.000")
Try this:
ffmpeg.input(stream, rtsp_transport='tcp')
Try this:
ffmpeg.input(stream, rtsp_transport='tcp')
Thank you, this worked for me.