0

I am playing streaming from an IP camera with FFPLAY, using a Raspberry Pi with an HDMI monitor connected to it. Everything goes well (window placing, resizing, etc), except that I need FFPLAY to stop afer N seconds.

I have tried a few things, including

env DISPLAY=:0 ffplay -rtsp_transport tcp -left 0 -top 0 -noborder -t 00:00:10 -i rtsp://user:pass@192.168.4.157:46449/live -vf scale=480:240 -an -autoexit

The issue is that at 10 seconds, the screen image freezes but FFPLAY does not exit. It keeps running and incrementing the time count, even when the image is frozen.

This is for instance 50 seconds after the start:

Input #0, rtsp, from 'rtsp://user:pass@192.168.4.157:46449/live':
Metadata: title : RTSP Session/2.0 Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: h264 (Baseline), yuv420p(progressive), 1280x720, 25.08 tbr, 90k tbn, 180k tbc Stream #0:1: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s

50.93 M-V: -4.542 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0

I have also tried to pipe from FFMPEG to FFPLAY, with exactly the same result:

ffmpeg -rtsp_transport tcp  -t 00:00:10 -i rtsp://user:pass@192.168.4.157:46449/live -vf scale=480:240 -an -f matroska - | env DISPLAY=:0 ffplay -left 0 -top 0 -noborder -

FFPLAY keeps running ok, as I can stop it with Esc from the GUI.

PiBer2
  • 159
  • 10
  • 2
    Try `-autoexit` – kesh Oct 10 '22 at 00:54
  • @kesh Great! I have added -autoexit to FFPLAY in the first example, to no avail. Using it in the second example (the pipe) made it work. Thanks a lot, maybe you want to post the solution. – PiBer2 Oct 10 '22 at 11:48

0 Answers0