<p>you can specify -autoexit it works for me</p>

CC BY-SA 4.0
2022-09-23T13:24:20.990Z
2022-09-23T13:24:20.990Z
user39410
<p>So I have been testing the SRT streaming to use with OBS.  so far love it BUT ffplay will not close when the stream ends and try to reconnect. it just stays paused at last frame and the ffplay window stays up</p>
<p>my code is here:</p>
<pre><code>%ffplay% srt://0.0.0.0:43560?mode=listener&amp;transtype=live&amp;latency=0&amp;recv_buffer_size=0 -window_title &quot;SRT Player 1.0 - Viewer (powered by FFPlay)&quot; -x 720 -y 480 -sync audio -autoexit 
</code></pre>
<p>I have tried using these commands too:</p>
<pre><code>connect_timeout=milliseconds

linger=seconds

timeout=microseconds
</code></pre>
<p>What I would like to achieve that if stream ends it closes and then starts ffplay over again.  I have even used FFMPEG to grab the original and if it finds it to start ffplay like this:</p>
<pre><code>%ffmpeg% -hide_banner -loglevel 0 -stats  -re -i srt://127.0.0.1:5000?mode=listener -c copy -f mpegts &quot;srt://127.0.0.1:43560?mode=caller&amp;transtype=live&amp;latency=400000&quot; | %ffplay% srt://0.0.0.0:43560?mode=listener&amp;transtype=live&amp;latency=0&amp;recv_buffer_size=0 -window_title &quot;SRTt Player 1.0 - Viewer (powered by FFPlay)&quot; -x 720 -y 480 -sync audio -autoexit -exitonmousedown -autorotate
</code></pre>
<p>But this fails as well because of stream ends it just sits open.</p>

<ffmpeg><ffplay>
FFplay will not close and reconnect when SRT stream ends
hammer head down
# FFplay will not close and reconnect when SRT stream ends

(Asked by: username_0 on 2022-04-25)

So I have been testing the SRT streaming to use with OBS.  so far love it BUT ffplay will not close when the stream ends and try to reconnect. it just stays paused at last frame and the ffplay window stays up
my code is here:
%ffplay% srt://0.0.0.0:43560?mode=listener&transtype=live&latency=0&recv_buffer_size=0 -window_title "SRT Player 1.0 - Viewer (powered by FFPlay)" -x 720 -y 480 -sync audio -autoexit 

I have tried using these commands too:
connect_timeout=milliseconds

linger=seconds

timeout=microseconds

What I would like to achieve that if stream ends it closes and then starts ffplay over again.  I have even used FFMPEG to grab the original and if it finds it to start ffplay like this:
%ffmpeg% -hide_banner -loglevel 0 -stats  -re -i srt://127.0.0.1:5000?mode=listener -c copy -f mpegts "srt://127.0.0.1:43560?mode=caller&transtype=live&latency=400000" | %ffplay% srt://0.0.0.0:43560?mode=listener&transtype=live&latency=0&recv_buffer_size=0 -window_title "SRTt Player 1.0 - Viewer (powered by FFPlay)" -x 720 -y 480 -sync audio -autoexit -exitonmousedown -autorotate

But this fails as well because of stream ends it just sits open.

**Tags:** ffmpeg, ffplay


---

## 1 answers

### Answer by username_1 on 2022-09-23. Score: 0

you can specify -autoexit it works for me


---

