<p>You can create a batch file:</p>
<pre><code>:START
ffmpeg ... &lt;here is your command&gt;
if errorlevel 1 goto START
</code></pre>
<p>That code should auto-restart your command if there was any error.</p>

CC BY-SA 4.0
2022-02-05T20:16:26.677Z
2022-02-05T20:16:26.677Z
Lex
<p>I want to create an rtmp player that receives the stream from the server and displays it on the &quot;Decklink mini monitor&quot;
this is my command</p>
<pre><code>ffmpeg -thread_queue_size 32768 -i rtmp://myserver/live/rahim -bufsize 5000k -preset ultrafast -async 1 -vsync -1 -c:a pcm_s16le -ac 2 -ar 48000 -r 50000/1000 -s 1280x720 -pix_fmt uyvy422 -f decklink 'DeckLink Mini Monitor'
</code></pre>
<p>Everything is fine</p>
<p>but !!!
ffmpeg can not continue when the stream is disconnected and reconnected for any reason and ffmpeg output is:</p>
<pre><code>[flv @ 0x55b1c4d76d40] DTS 0 &lt; 7258 out of order6.90 bitrate=N/A speed=1.13x
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!x
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!360 speed=0.506x
    Last message repeated 2 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 7 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 5 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!362 speed=0.516x
    Last message repeated 9 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 5 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 3 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 6 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 9 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 6 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 1 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 4 times
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!362 speed=0.554x
    Last message repeated 2 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 7 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 6 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!362 speed=0.564x
    Last message repeated 9 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 7 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
Last message repeated 8 times
</code></pre>
<p>Does anyone have a solution</p>

<ffmpeg>
ffmpeg playout rtmp stream continuously when rtmp stream lost for few seconds
rahim
# ffmpeg playout rtmp stream continuously when rtmp stream lost for few seconds

(Asked by: username_0 on 2022-02-05)

I want to create an rtmp player that receives the stream from the server and displays it on the "Decklink mini monitor"
this is my command
ffmpeg -thread_queue_size 32768 -i rtmp://myserver/live/username_0 -bufsize 5000k -preset ultrafast -async 1 -vsync -1 -c:a pcm_s16le -ac 2 -ar 48000 -r 50000/1000 -s 1280x720 -pix_fmt uyvy422 -f decklink 'DeckLink Mini Monitor'

Everything is fine
but !!!
ffmpeg can not continue when the stream is disconnected and reconnected for any reason and ffmpeg output is:
[flv @ 0x55b1c4d76d40] DTS 0 < 7258 out of order6.90 bitrate=N/A speed=1.13x
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!x
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!360 speed=0.506x
    Last message repeated 2 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 7 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 5 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!362 speed=0.516x
    Last message repeated 9 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 5 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 3 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 6 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 9 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 6 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 1 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 4 times
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!362 speed=0.554x
    Last message repeated 2 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 7 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 6 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!362 speed=0.564x
    Last message repeated 9 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
    Last message repeated 7 times
[decklink @ 0x55b1c4d8aec0] There are not enough buffered video frames. Video may misbehave!
[decklink @ 0x55b1c4d8aec0] There's no buffered audio. Audio will misbehave!
Last message repeated 8 times

Does anyone have a solution

**Tags:** ffmpeg


---

## 1 answers

### Answer by username_1 on 2022-02-05. Score: 1

You can create a batch file:
:START
ffmpeg ... 
if errorlevel 1 goto START

That code should auto-restart your command if there was any error.


---

