TomRay74
TomRay74

Reputation: 523

How to get ffmpeg to append to existing ouput file and not overwrite it?

I am receiving an MPEG-TS Stream via UDP and saving the contents to a file using FFmpeg (using codec copy and mapping all streams). In cases where the stream stops, I would like to restart FFmpeg the moment it resumes and append to the existing file already written to.

How can I configure FFmpeg to append to the file and not overwrite it when it starts again?

The input and output containers are both MPEG-TS and the number of streams and codecs will be the same.

Upvotes: 6

Views: 5998

Answers (1)

aergistal
aergistal

Reputation: 31219

You can output to stdout and use shell redirection to output to the file. This only works for formats that are directly concatenable such as mpegts and will create discontinuities:

ffmpeg -re -i udp://... -f mpegts - >> output.ts

Upvotes: 3

Related Questions