<div dir="auto"><div><br><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">пт, 30 мая 2025 г., 15:55 Terje J. Hanssen <<a href="mailto:terjejhanssen@gmail.com">terjejhanssen@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div>
<br>
<br>
<div>Den 30.05.2025 00:15, skrev Andrew
Randrianasulu:<br>
</div>
<blockquote type="cite">
<div dir="auto">
<div><br>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">пт, 30 мая 2025 г., 00:30
Andrew Randrianasulu <<a href="mailto:randrianasulu@gmail.com" target="_blank" rel="noreferrer">randrianasulu@gmail.com</a>>:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="auto">
<div><br>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">чт, 29 мая 2025
г., 23:42 Terje J. Hanssen via Cin <<a href="mailto:cin@lists.cinelerra-gg.org" rel="noreferrer noreferrer" target="_blank">cin@lists.cinelerra-gg.org</a>>:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div> Is it possible with CinGG's Record utility
(via FFMPEG) to record a stream to file segments
of same duration or file size and use
auto-naming?<br>
<br>
Typical example:<br>
Record a video/audio input stream (i.e from
playing a camcorder tape cassette) and encode to
output file segments of 10 minutes or 10 GB each
and auto-name file numbers.<br>
<br>
Similar example code using an input file instead
at<br>
<a href="https://unix.stackexchange.com/questions/1670/how-can-i-use-ffmpeg-to-split-mpeg-video-into-10-minute-chunks" rel="noreferrer noreferrer noreferrer" target="_blank">https://unix.stackexchange.com/questions/1670/how-can-i-use-ffmpeg-to-split-mpeg-video-into-10-minute-chunks</a><br>
<div>
<p>Just use what is built into ffmpeg to do
exactly this.</p>
<pre><code><font size="5">ffmpeg -i invid.mp4 -threads 3 \
-vcodec copy <b>-f segment -segment_time 10:00 \
-reset_timestamps 1 \
cam_out_h264_%02d.mp4</b></font>
</code></pre>
<p>This will split it into roughly 10-minute
chunks, split at the relevant keyframes, and
will output to the files <b><font size="4"><code>cam_out_h264_01.mp4</code>,
<code>cam_out_h264_02.mp4</code></font></b>,
etc.</p>
</div>
</div>
</blockquote>
</div>
</div>
<div dir="auto">Very interesting question! Never tried
this, did not even know it existed!</div>
<div dir="auto"><br>
</div>
<div dir="auto">As long as this -f just ordinary
avformat muxer you probably can copy your favourite
ffmpeg video/audio profiles with new .seg name and put
"segmented" at very first line there , where "mov" or
"matroska" or other format name was, and add rest of
options. And add pattern (%02d) into name just as with
ffmpeg-based image lists.</div>
<div dir="auto"><br>
</div>
<div dir="auto">I'll try this with termux's version, but
I do not have audio here so it will be incomplete.</div>
</div>
</blockquote>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">so I created this file:</div>
<div dir="auto"><br>
</div>
<div dir="auto">
<div dir="auto">cat ffmpeg/video/mpeg2.seg</div>
<div dir="auto">segment mpeg2video</div>
<div dir="auto">segment_format=mpeg</div>
<div dir="auto">segment_time=00:10</div>
<div dir="auto">reset_timestamps=1</div>
<div dir="auto">trellis=2</div>
<div dir="auto">mbd=rd</div>
<div dir="auto">cmp=2</div>
<div dir="auto">subcmp=2</div>
<div dir="auto">b=4000000</div>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">and it worked! in sense it created six
segments, each with corresponding increasing timecode. But
they all uneven duration, probably due to mpeg2 codec
placing keyframes at will.</div>
<div dir="auto"><br>
</div>
<div dir="auto">You can try to modify it back to 10:00 segment
time and see how it work for longer encode?</div>
</div>
<div dir="auto"><br>
</div>
</div>
</blockquote>
<br>
As I'm not sure if and how you applied your file above with regards
to Cingg Record,<br></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">just put file where other video profiles live? (ffmpeg/video folder of your cingg installation)</div><div dir="auto"><br></div><div dir="auto">What worries me is audio. If segmented audio muxer cut it differently from video we will get desync.</div><div dir="auto"><br></div><div dir="auto">May be setting labels at specific intervals and then using "write new file at label" checkbox is better idea?</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
I simply did a test with my system's ffmpeg segment muxer:<br>
<a href="https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-ssegment" target="_blank" rel="noreferrer">https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-ssegment</a><br>
<br>
Input file: hdv09_04_h264.mp4<br>
Duration: 00:03:58.88, start: 0.000000, bitrate: 8963 kb/s<br>
<br>
Tried 1 minute segment time:<br>
<br>
ffmpeg -hide_banner -i hdv09_04_h264.mp4 -threads 3 \<br>
-vcodec copy -f segment -segment_time 01:00 \<br>
-reset_timestamps 1 \<br>
cam_out_h264_%02d.mp4<br>
<br>
[segment @ 0x563c2874fa80] Opening 'cam_out_h264_01.mp4' for
writingeed=52.1x <br>
[segment @ 0x563c2874fa80] Opening 'cam_out_h264_02.mp4' for
writingeed=55.5x <br>
[segment @ 0x563c2874fa80] Opening 'cam_out_h264_03.mp4' for
writingeed= 57x <br>
[out#0/segment @ 0x563c28727680] video:257421KiB audio:3749KiB
subtitle:0KiB other streams:0KiB global headers:0KiB muxing
overhead: unknown<br>
frame= 5972 fps=1445 q=-1.0 Lsize=N/A time=00:03:58.80 bitrate=N/A
speed=57.8x <br>
[aac @ 0x563c28721a40] Qavg: 454.522<br>
<br>
68M cam_out_h264_00.mp4<br>
63M cam_out_h264_01.mp4<br>
59M cam_out_h264_02.mp4<br>
68M cam_out_h264_03.mp4<br>
--------<br>
<br>
Duration: 00:01:00.38, start: 0.058000, bitrate: 9394 kb/s<br>
Duration: 00:01:00.00, start: 0.000000, bitrate: 8672 kb/s<br>
Duration: 00:01:00.60, start: 0.000000, bitrate: 8104 kb/s<br>
Duration: 00:00:57.93, start: 0.000000, bitrate: 9705 kb/s<br>
<br>
In total: 00:03:58.93 which is 00:00:00.03 (=3/100 sek) more
than the input file<br>
which I think is good enough for practical purposes (editing and
backup/preservation/archival)<br>
<br>
I wonder if it is within or out of our reach to make some targeted
profiles for backup/preservation?<br>
I.e would it be of interest and possible to utilize/integrate/use
oss tools and scripts as found here:<br>
<a href="https://avpres.net/Bash_AVpres/" target="_blank" rel="noreferrer">https://avpres.net/Bash_AVpres/</a><br>
<a href="https://avpres.net/FFmpeg/im_FFV1.html" target="_blank" rel="noreferrer">https://avpres.net/FFmpeg/im_FFV1.html</a></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Up to interested party, I guess.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>
<br>
The programs dvgrab and possibly the newer vrecord can also
autosplit by scenes<br>
<a href="https://linux.die.net/man/1/dvgrab" target="_blank" rel="noreferrer">https://linux.die.net/man/1/dvgrab</a><br>
<a href="https://github.com/amiaopensource/vrecord" target="_blank" rel="noreferrer">https://github.com/amiaopensource/vrecord</a><br>
<a href="https://github.com/mipops/dvrescue" target="_blank" rel="noreferrer">https://github.com/mipops/dvrescue</a></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Yes, I was thinking about this, but unfortunately without any testable idea. Sorry.</div><div dir="auto"><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>
<br>
<br>
</div>
</blockquote></div></div></div>