Save mp4 files in 5 Minute chunks

About encoding, codec settings, muxers and filter usage
tecpoint1
New Cone
New Cone
Posts: 3
Joined: 16 Nov 2021 17:38

Save mp4 files in 5 Minute chunks

Postby tecpoint1 » 21 Nov 2021 15:39

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?

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: Save mp4 files in 5 Minute chunks

Postby mederi » 12 Dec 2021 13:54

Cycle sout module should be able to do it, but I haven't seen an example how to use it.

Rémi Denis-Courmont
Developer
Developer
Posts: 15279
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Save mp4 files in 5 Minute chunks

Postby Rémi Denis-Courmont » 12 Dec 2021 18:24

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.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 44 guests