[FFmpeg-user] Concurrent Segment/Concat Read/Writes

Nicolas George george at nsup.org
Sun Apr 26 12:31:37 CEST 2015

Le septidi 7 floréal, an CCXXIII, Robert Nagy a écrit :
> In what way does it depend on the formats? The files are streamed to/from
> in a nut container.

It would have been easier if the format itself was concatenable.

> I've managed to fake it on the segmenting side by buffering through a file,
> i.e. the segmenter writes to disk and then I wait for the segment_list
> items and start uploading and then remove from disk once finished.
> Unfortunately this solution will only upload completed segments, it cannot
> upload while writing since the segment_list is only updated for finished
> segments.

That is the gist of my ideas. You can probably do slightly better using
pipes. I do not think waiting for a full segment as a severe problem,
because when the process is really running, all (download, transcoding,
upload) will happen at the same speed on average. Waiting for the first
segment just adds a delay. But maybe you have another problem about it.

> On the concat side I haven't found any workaround.

That would be the same idea: download as much as you can in parallel into
files, and let ffmpeg read from them.

The hard part in this case is to detect when ffmpeg is done with a file do
remove it and start the next download. If you are running Linux, inotifywait
may be able to help. More portably, named pipes may do the trick.

If you want a more robust solution, I would suggest to use a HTTP proxy:

- On upload, it accepts data at full speed, caches it and uploads it as

- On download, it pre-fetches the next segments.

I do not know if existing web proxys can be configured or tricked into doing
that or if you would need code of your own.

> On Sun, Apr 26, 2015 at 11:20 AM, Nicolas George <george at nsup.org> wrote:

Please do not top-post on this mailing-list. If you do not know what it
means, look it up.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-user/attachments/20150426/d6be57b9/attachment.asc>

More information about the ffmpeg-user mailing list