<p>Although probably not best practice, this seems to do the trick:</p>

<p>Take a NUT file, same codec and dimensions;
ffmpeg -i nutfile1.nut -frames 2 -c:a copy -c:v copy -f nut nutheader.nut</p>

<p>And then a little piping hijinks:</p>

<p>nc 192.168.1.161 6600 | cat nutheader.nut - | ffmpeg -i pipe:0 -c:a copy -c:v copy -map 0:a -map 0:v -f fifo -fifo-format nut -drop_pkts_on_overflow 1 pipe:1 | nc -L -p 6601</p>

<p>You get a 'discontinuous DTS' when you connect the first time and headers are duplicated, but whatever.</p>

<p>And you get one 'packet damaged' when you start the standard input after the headers, but it immediately and with extremely low latency resynchronizes.</p>

CC BY-SA 4.0
2018-09-03T18:18:18.377Z
2018-09-03T18:18:18.377Z
Andyz Smith
<p>If I do this
ffmpeg -f dshow -video_size 720x480 -framerate 29.97 -i video="Roxio Video Capture USB":audio="Line (Roxio Video Capture USB)" -c:v mjpeg -c:a pcm_s16le -map 0:v -map 0:a -f fifo -fifo_format nut -drop_pkts_on_overflow 1 tcp://localhost:6600</p>

<p>I can connect to TCP from a player only once.  The NUT headers are in the FIFO and part of the video stream is dropped so I stay close to real-time, but if I disconnect I've lost the nut headers and no player will reconnect even though the TCP port is still sending data.  Is there any way, BESIDES USING MPEG Transport Stream, to resend the headers?</p>

<ffmpeg><streaming><video-capture>
resend headers NUT formats
Andyz Smith
# resend headers NUT formats

(Asked by: username_0 on 2018-09-02)

If I do this
ffmpeg -f dshow -video\_size 720x480 -framerate 29.97 -i video="Roxio Video Capture USB":audio="Line (Roxio Video Capture USB)" -c:v mjpeg -c:a pcm\_s16le -map 0:v -map 0:a -f fifo -fifo\_format nut -drop\_pkts\_on\_overflow 1 tcp://localhost:6600

I can connect to TCP from a player only once. The NUT headers are in the FIFO and part of the video stream is dropped so I stay close to real-time, but if I disconnect I've lost the nut headers and no player will reconnect even though the TCP port is still sending data. Is there any way, BESIDES USING MPEG Transport Stream, to resend the headers?

**Tags:** ffmpeg, streaming, video-capture


---

## 1 answers

### Answer by username_0 on 2018-09-03. Score: 0

Although probably not best practice, this seems to do the trick:

Take a NUT file, same codec and dimensions;
ffmpeg -i nutfile1.nut -frames 2 -c:a copy -c:v copy -f nut nutheader.nut

And then a little piping hijinks:

nc 192.168.1.161 6600 | cat nutheader.nut - | ffmpeg -i pipe:0 -c:a copy -c:v copy -map 0:a -map 0:v -f fifo -fifo-format nut -drop\_pkts\_on\_overflow 1 pipe:1 | nc -L -p 6601

You get a 'discontinuous DTS' when you connect the first time and headers are duplicated, but whatever.

And you get one 'packet damaged' when you start the standard input after the headers, but it immediately and with extremely low latency resynchronizes.


---

