ffmpeg-python icon indicating copy to clipboard operation
ffmpeg-python copied to clipboard

specify protocol option before input?

Open arlenarlenarlen opened this issue 5 years ago • 3 comments

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

arlenarlenarlen avatar Jan 04 '20 20:01 arlenarlenarlen

add to input call kwargs like ffmpeg.input(stream, ss="00:00:11.000")

kfur avatar Jan 15 '20 14:01 kfur

Try this:

ffmpeg.input(stream, rtsp_transport='tcp')

kkroening avatar Jan 23 '20 19:01 kkroening

Try this:

ffmpeg.input(stream, rtsp_transport='tcp')

Thank you, this worked for me.

DaniloAlves1995 avatar Mar 24 '22 14:03 DaniloAlves1995