On 31.05.2025 05:33, Andrew
Randrianasulu wrote:
On Fri, May 30, 2025 at 4:27 PM Andrew Randrianasulu
<randrianasulu@gmail.com> wrote:
пт, 30 мая 2025 г., 15:55 Terje J. Hanssen <terjejhanssen@gmail.com>:
Den 30.05.2025 00:15, skrev Andrew Randrianasulu:
пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu <randrianasulu@gmail.com>:
чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin <cin@lists.cinelerra-gg.org>:
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?
Typical example:
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.
Similar example code using an input file instead at
https://unix.stackexchange.com/questions/1670/how-can-i-use-ffmpeg-to-split-mpeg-video-into-10-minute-chunks
Just use what is built into ffmpeg to do exactly this.
ffmpeg -i invid.mp4 -threads 3 \
-vcodec copy -f segment -segment_time 10:00 \
-reset_timestamps 1 \
cam_out_h264_%02d.mp4
This will split it into roughly 10-minute chunks, split at the relevant keyframes, and will output to the files cam_out_h264_01.mp4, cam_out_h264_02.mp4, etc.
Very interesting question! Never tried this, did not even know it existed!
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.
I'll try this with termux's version, but I do not have audio here so it will be incomplete.
so I created this file:
cat ffmpeg/video/mpeg2.seg
segment mpeg2video
segment_format=mpeg
segment_time=00:10
reset_timestamps=1
trellis=2
mbd=rd
cmp=2
subcmp=2
b=4000000
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.
You can try to modify it back to 10:00 segment time and see how it work for longer encode?
As I'm not sure if and how you applied your file above with regards to Cingg Record,
just put file where other video profiles live? (ffmpeg/video folder of your cingg installation)
Attaching test profile trying to utilize segmented muxer for mpeg
system streams
Put them according to their content into
/usr/share/cin/ffmpeg/video and /usr/share/cin/ffmpeg/audio for
standard rpm/deb cinelerra install
make sure they readable by your user (chown -R your_username:users
/usr/share/cin/ffmpeg might fix weird issues like "bad file format")
I upgraded to the latest rpm for Leap15.6
terje@localhost:/usr/share/cin/ffmpeg>
ls -lt audio/*.seg audio/seg.* video/*.seg video/seg.*
-rw-r--r-- 1 terje users 159 mai 31 17:49 video/mpeg2.seg
-rw-r--r-- 1 terje users 14 mai 31 17:49 video/seg.dfl
-rw-r--r-- 1 terje users 77 mai 31 17:47 audio/mpeg2_mp2.seg
-rw-r--r-- 1 terje users 14 mai 31 17:47 audio/seg.dfl
In cingg shift-R, select seg from dropdown menu, select both audio and
video encoding (there will be grand total of one choice in each
category),
then put filename like /dev/shm/file%02d.mpeg and try to render
It will give you files:
Loaded a hdv 1080i50 file
Very short segments, maybe just 10 sec each
root@slax:~# ls -la /dev/shm/seg*
-rw-r--r-- 1 guest users 0 мая 31 06:19 /dev/shm/seg%02d.mpeg
-rw-r--r-- 1 guest users 0 мая 31 05:57 /dev/shm/seg%02d.seg
-rw-r--r-- 1 guest users 2375680 мая 31 06:19 /dev/shm/seg00.mpeg
-rw-r--r-- 1 guest users 1980416 мая 31 06:19 /dev/shm/seg01.mpeg
-rw-r--r-- 1 guest users 1947648 мая 31 06:19 /dev/shm/seg02.mpeg
-rw-r--r-- 1 guest users 2009088 мая 31 06:19 /dev/shm/seg03.mpeg
-rw-r--r-- 1 guest users 2170880 мая 31 06:19 /dev/shm/seg04.mpeg
-rw-r--r-- 1 guest users 2205696 мая 31 06:19 /dev/shm/seg05.mpeg
-rw-r--r-- 1 guest users 2535424 мая 31 06:19 /dev/shm/seg06.mpeg
-rw-r--r-- 1 guest users 1966080 мая 31 06:19 /dev/shm/seg07.mpeg
-rw-r--r-- 1 guest users 1945600 мая 31 06:19 /dev/shm/seg08.mpeg
-rw-r--r-- 1 guest users 2023424 мая 31 06:19 /dev/shm/seg09.mpeg
-rw-r--r-- 1 guest users 2101248 мая 31 06:19 /dev/shm/seg10.mpeg
-rw-r--r-- 1 guest users 1026048 мая 31 06:19 /dev/shm/seg11.mpeg
Now you can play all fo them gapless with mpv:
mpv worked best for audio, though blocking pixels in the video
vlc got dropouts in audio also within a segment
Tried similar with Shift-P: 1920x1080, 50fps, yuv422 and mpeg2_hq
profile changed to 50Mbps bitrate, then r (record from v4l2
/dev/video0 (ms2130)
Got short segments, yuv422 at low bitrate