<p>All you have to do is output to a <a href="https://en.wikipedia.org/wiki/MPEG_transport_stream" rel="nofollow noreferrer">.ts container</a>.  It's designed for broadcasting systems, so it works fine with incomplete files.</p>

<pre><code>ffmpeg -i INPUT -c copy OUTPUT.ts
</code></pre>

<p>You just have to put a compatible codec in the container.  I haven't been able to find a list of what's compatible, but through testing I've found that H.264 and H.265 work.</p>

<p>.ts containers aren't the best once the file is complete, though, because seeking can take a while and they're about 7% bigger, so you can copy the data into an .mp4 container (assuming you're using H.264) when you're finished with</p>

<pre><code>ffmpeg -i INPUT.ts -c copy OUTPUT.mp4
</code></pre>

CC BY-SA 3.0
2017-07-13T08:55:41.450Z
Thank you, seems suitable. Now I remember these files from dvd's. And cameras, which are practically my use-case (learned there are variations of ts with timestamps for seeking). And the stream is usually split into smaller files too. Know any alternatives to ts and its descendants just in case or they're the dominant standard?
Alexey Orekhov
CC BY-SA 3.0
2017-07-14T07:55:24.947Z
There's no alternative containers that I'm aware of.  I don't know if they don't exist, or if I just haven't found them yet.
PunctualEmoticon
CC BY-SA 3.0
2017-07-13T02:41:41.730Z
2017-07-14T05:31:37.613Z
2017-07-14T05:31:37.613Z
PunctualEmoticon
<p>The situation is described <a href="https://video.stackexchange.com/questions/21896/is-there-standard-protocol-or-way-for-frameserving">here</a>.</p>

<p>In short, I need a way to save infinite video real-time, playable while being saved. Suppose, there are ways to do this.</p>

<p>I imagine it's done like in web DASH, in chunks, but saved locally.
Ideally (though not necessary) so that any modern player program could play it by clicking on file.
Also prefer open software and standards like ffmpeg and vp9.</p>

<p>Thanks for help!</p>

<encoding>
How to save playable infinite video?
Alexey Orekhov
# How to save playable infinite video?

(Asked by: username_0 on 2017-07-11)

The situation is described [here](https://video.stackexchange.com/questions/21896/is-there-standard-protocol-or-way-for-frameserving).

In short, I need a way to save infinite video real-time, playable while being saved. Suppose, there are ways to do this.

I imagine it's done like in web DASH, in chunks, but saved locally.
Ideally (though not necessary) so that any modern player program could play it by clicking on file.
Also prefer open software and standards like ffmpeg and vp9.

Thanks for help!

**Tags:** encoding


---

## 1 answers

### Answer by username_1 on 2017-07-13. Score: 1 | Accepted answer

All you have to do is output to a .ts container.  It's designed for broadcasting systems, so it works fine with incomplete files.
ffmpeg -i INPUT -c copy OUTPUT.ts

You just have to put a compatible codec in the container.  I haven't been able to find a list of what's compatible, but through testing I've found that H.264 and H.265 work.
.ts containers aren't the best once the file is complete, though, because seeking can take a while and they're about 7% bigger, so you can copy the data into an .mp4 container (assuming you're using H.264) when you're finished with
ffmpeg -i INPUT.ts -c copy OUTPUT.mp4

> **Comments:**
> **username_0**: Thank you, seems suitable. Now I remember these files from dvd's. And cameras, which are practically my use-case (learned there are variations of ts with timestamps for seeking). And the stream is usually split into smaller files too. Know any alternatives to ts and its descendants just in case or they're the dominant standard?  
> **username_1**: There's no alternative containers that I'm aware of.  I don't know if they don't exist, or if I just haven't found them yet.  

---

