[vlc-devel] (no subject)

Rémi Denis-Courmont remi at remlab.net
Thu Oct 12 11:35:19 CEST 2017

Le 12 octobre 2017 12:17:00 GMT+03:00, "Jérémy VIGNELLES" <jeremy.vignelles at dev3i.fr> a écrit :
>Use case
>I need a way to record permanently a CCTV camera in a rolling buffer
>say, 1 day. As far as I know, this is not possible currently with VLC.
>I have seen the ticket #561, opened 12 years ago, which asks
>for a similar feature.
>A "cycle" stream output plugin has been implemented, but it works in a
>different way : predefine a loop of files and write in them
>My implementation differs from the "cycle" module in the way that
>is overwritten, and it's up to an external hypervisor to retain or
>files as needed.
>How does it work
>MPEG-TS is a muxing format in which blocks are normally 188 bytes long
>(VLC can do "unaligned" blocks). Starting a file from any of the blocks
>gives a valid MPEG-TS stream.
>Based on that statement, the idea is to fill a file with blocks, until
>limit is reached, and then switch between files between two blocks.
>MPEG-TS also has an option to specify a key, so that the stream can be
>encrypted, which is useful when working on sensitive stream, like in
>Configuration parameters
>`dst=` in the sout chain specifies the directory to which files are
>The file name can be formatted using the
>`--sout-segments-format` specifier, which takes strftime format as
>`--sout-segments-max-filesize` limits the file size before
>which we need to switch files. Defaults to 94MB, which is a round
>of 188-bytes blocks.
>Example usage
>vlc -vv
>--sout="#std{access=segments,mux=ts,dst=/path/to/recording/folder}" \
>--sout-segments-format "%Y%m%d%H%M%S.ts" --sout-max-filesize 1880000 \
>--sout-ts-crypt-audio --sout-ts-crypt-video --sout-ts-csa-ck
>0123456789ABCDEF \
>Example replaying
>cat /path/to/recording/folder/*.ts | vlc --ts-csa-ck 0123456789ABCDEF -
>Or you can just play one by one.
>- The file format can only be precise in seconds, due to the way
>works. If the max-filesize represents less than 1 second of video,
>is a risk that two files have the same name, and thus, the second
>will be overwriting the first one
>- Obviously, it does only work with MPEG-TS stream and was optimized
>for that 
>muxer. There is no check that the stream is actually muxed with
>- There is no guarantee that the first block in a file contains a
>When replaying, there can be a latency before anything is shown on the
>Please send me your (kind) remarks about this code, about my usage
>("You could have done this that way!")...
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:

I don't see how the described functionality is any different from cycling with a single entry per cycle. The existing cycle module is perfectly able to output a different file at every iteration when combined with the file output module time format function.
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.

More information about the vlc-devel mailing list