Page 1 of 1

Save mp4 files in 5 Minute chunks

Posted: 21 Nov 2021 15:39
by tecpoint1
Using a script I continuously record a video source into a file named yes_ch9.mp4
This is the script
"C: \ Program Files \ VideoLAN \ VLC \ vlc.exe" -vvv "udp: //@238.0.3.4: 1234" --sout = # standard {access = file, mux = ts, dst = c: \ t \ yes_ch9.mp4}
This script creates a file whose volume increases as time goes on
I want the script to create a new file every 5 minutes instead of a continuous file that grows over time
Can anyone help?

Re: Save mp4 files in 5 Minute chunks

Posted: 12 Dec 2021 13:54
by mederi
Cycle sout module should be able to do it, but I haven't seen an example how to use it.

Re: Save mp4 files in 5 Minute chunks

Posted: 12 Dec 2021 18:24
by RĂ©mi Denis-Courmont
cycle: initial support for splitting stream output in time (refs #561)

Example:
#cycle{duration=20m,
dst=std{mux=ts,access=file,dst=sport.ts}, duration=5m},
dst=std{mux=ts,access=file,dst=weather.ts}, duration=5m}

Skips 20 minutes, then records 5 minutes to sport.ts, then 5 more
minutes to weather.ts and restarts.

"duration" specifies the duration of the previous phase
"offset" specifies the offset at which the previous phase ends
and the next phase begins
(mutually exclusive with duration)
"dst" specifies the stream output chain for the phase
(if missing, the phase is skipped/discarded)

Durations and offsets are so far expressed as an integer, optionally
followed by a unit: w=week, d=day, h=hour, m=minute, s=second. Second
is the default.

Currently only the decoding time stamp can be used as a reference, but
adding local or UTC clocks should be relatively easy.

ES synchronization and reference frames management is left for
further study.
To avoid clobbering each file with the next one, you probably need to use --sout-file-format as well.