Segmented Recording from input stream
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-... 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. Terje J. H
чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin < [email protected]>:
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-...
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.
Terje J. H
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu <[email protected]>:
чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin < [email protected]>:
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-...
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?
Terje J. H
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Den 30.05.2025 00:15, skrev Andrew Randrianasulu:
пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu <[email protected]>:
чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin <[email protected]>:
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-...
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, I simply did a test with my system's ffmpeg segment muxer: https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-... Input file: hdv09_04_h264.mp4 Duration: 00:03:58.88, start: 0.000000, bitrate: 8963 kb/s Tried 1 minute segment time: ffmpeg -hide_banner -i hdv09_04_h264.mp4 -threads 3 \ -vcodec copy -f segment -segment_time 01:00 \ -reset_timestamps 1 \ cam_out_h264_%02d.mp4 [segment @ 0x563c2874fa80] Opening 'cam_out_h264_01.mp4' for writingeed=52.1x [segment @ 0x563c2874fa80] Opening 'cam_out_h264_02.mp4' for writingeed=55.5x [segment @ 0x563c2874fa80] Opening 'cam_out_h264_03.mp4' for writingeed= 57x [out#0/segment @ 0x563c28727680] video:257421KiB audio:3749KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown frame= 5972 fps=1445 q=-1.0 Lsize=N/A time=00:03:58.80 bitrate=N/A speed=57.8x [aac @ 0x563c28721a40] Qavg: 454.522 68M cam_out_h264_00.mp4 63M cam_out_h264_01.mp4 59M cam_out_h264_02.mp4 68M cam_out_h264_03.mp4 -------- Duration: 00:01:00.38, start: 0.058000, bitrate: 9394 kb/s Duration: 00:01:00.00, start: 0.000000, bitrate: 8672 kb/s Duration: 00:01:00.60, start: 0.000000, bitrate: 8104 kb/s Duration: 00:00:57.93, start: 0.000000, bitrate: 9705 kb/s In total: 00:03:58.93 which is 00:00:00.03 (=3/100 sek) more than the input file which I think is good enough for practical purposes (editing and backup/preservation/archival) I wonder if it is within or out of our reach to make some targeted profiles for backup/preservation? I.e would it be of interest and possible to utilize/integrate/use oss tools and scripts as found here: https://avpres.net/Bash_AVpres/ https://avpres.net/FFmpeg/im_FFV1.html The programs dvgrab and possibly the newer vrecord can also autosplit by scenes https://linux.die.net/man/1/dvgrab https://github.com/amiaopensource/vrecord https://github.com/mipops/dvrescue
пт, 30 мая 2025 г., 15:55 Terje J. Hanssen <[email protected]>:
Den 30.05.2025 00:15, skrev Andrew Randrianasulu:
пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu <[email protected]>:
чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin < [email protected]>:
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-...
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) What worries me is audio. If segmented audio muxer cut it differently from video we will get desync. May be setting labels at specific intervals and then using "write new file at label" checkbox is better idea? I simply did a test with my system's ffmpeg segment muxer:
https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-...
Input file: hdv09_04_h264.mp4 Duration: 00:03:58.88, start: 0.000000, bitrate: 8963 kb/s
Tried 1 minute segment time:
ffmpeg -hide_banner -i hdv09_04_h264.mp4 -threads 3 \ -vcodec copy -f segment -segment_time 01:00 \ -reset_timestamps 1 \ cam_out_h264_%02d.mp4
[segment @ 0x563c2874fa80] Opening 'cam_out_h264_01.mp4' for writingeed=52.1x [segment @ 0x563c2874fa80] Opening 'cam_out_h264_02.mp4' for writingeed=55.5x [segment @ 0x563c2874fa80] Opening 'cam_out_h264_03.mp4' for writingeed= 57x [out#0/segment @ 0x563c28727680] video:257421KiB audio:3749KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown frame= 5972 fps=1445 q=-1.0 Lsize=N/A time=00:03:58.80 bitrate=N/A speed=57.8x [aac @ 0x563c28721a40] Qavg: 454.522
68M cam_out_h264_00.mp4 63M cam_out_h264_01.mp4 59M cam_out_h264_02.mp4 68M cam_out_h264_03.mp4 --------
Duration: 00:01:00.38, start: 0.058000, bitrate: 9394 kb/s Duration: 00:01:00.00, start: 0.000000, bitrate: 8672 kb/s Duration: 00:01:00.60, start: 0.000000, bitrate: 8104 kb/s Duration: 00:00:57.93, start: 0.000000, bitrate: 9705 kb/s
In total: 00:03:58.93 which is 00:00:00.03 (=3/100 sek) more than the input file which I think is good enough for practical purposes (editing and backup/preservation/archival)
I wonder if it is within or out of our reach to make some targeted profiles for backup/preservation? I.e would it be of interest and possible to utilize/integrate/use oss tools and scripts as found here: https://avpres.net/Bash_AVpres/ https://avpres.net/FFmpeg/im_FFV1.html
Up to interested party, I guess.
The programs dvgrab and possibly the newer vrecord can also autosplit by scenes https://linux.die.net/man/1/dvgrab https://github.com/amiaopensource/vrecord https://github.com/mipops/dvrescue
Yes, I was thinking about this, but unfortunately without any testable idea. Sorry.
On Fri, May 30, 2025 at 4:27 PM Andrew Randrianasulu <[email protected]> wrote:
пт, 30 мая 2025 г., 15:55 Terje J. Hanssen <[email protected]>:
Den 30.05.2025 00:15, skrev Andrew Randrianasulu:
пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu <[email protected]>:
чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin <[email protected]>:
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-...
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") 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: 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: root@slax:~# mpv /dev/shm/se*.mpeg Playing: /dev/shm/seg%02d.mpeg Failed to recognize file format. Playing: /dev/shm/seg00.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AO: [pulse] 48000Hz stereo 2ch s16 VO: [gpu] 720x576 => 768x576 yuv420p AV: 00:00:02 / 00:00:02 (97%) A-V: 0.000 Playing: /dev/shm/seg01.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg02.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg03.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg04.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg05.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg06.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:02 / 00:00:02 (98%) A-V: 0.000 Playing: /dev/shm/seg07.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg08.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg09.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg10.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg11.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:00 / 00:00:01 (91%) A-V: 0.000 Exiting... (Some errors happened) I've verified that at least audio track exist, but you better to run your own liestening test to hear if audio get desynchronized over longer runs
What worries me is audio. If segmented audio muxer cut it differently from video we will get desync.
May be setting labels at specific intervals and then using "write new file at label" checkbox is better idea?
I simply did a test with my system's ffmpeg segment muxer: https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-...
Input file: hdv09_04_h264.mp4 Duration: 00:03:58.88, start: 0.000000, bitrate: 8963 kb/s
Tried 1 minute segment time:
ffmpeg -hide_banner -i hdv09_04_h264.mp4 -threads 3 \ -vcodec copy -f segment -segment_time 01:00 \ -reset_timestamps 1 \ cam_out_h264_%02d.mp4
[segment @ 0x563c2874fa80] Opening 'cam_out_h264_01.mp4' for writingeed=52.1x [segment @ 0x563c2874fa80] Opening 'cam_out_h264_02.mp4' for writingeed=55.5x [segment @ 0x563c2874fa80] Opening 'cam_out_h264_03.mp4' for writingeed= 57x [out#0/segment @ 0x563c28727680] video:257421KiB audio:3749KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown frame= 5972 fps=1445 q=-1.0 Lsize=N/A time=00:03:58.80 bitrate=N/A speed=57.8x [aac @ 0x563c28721a40] Qavg: 454.522
68M cam_out_h264_00.mp4 63M cam_out_h264_01.mp4 59M cam_out_h264_02.mp4 68M cam_out_h264_03.mp4 --------
Duration: 00:01:00.38, start: 0.058000, bitrate: 9394 kb/s Duration: 00:01:00.00, start: 0.000000, bitrate: 8672 kb/s Duration: 00:01:00.60, start: 0.000000, bitrate: 8104 kb/s Duration: 00:00:57.93, start: 0.000000, bitrate: 9705 kb/s
In total: 00:03:58.93 which is 00:00:00.03 (=3/100 sek) more than the input file which I think is good enough for practical purposes (editing and backup/preservation/archival)
I wonder if it is within or out of our reach to make some targeted profiles for backup/preservation? I.e would it be of interest and possible to utilize/integrate/use oss tools and scripts as found here: https://avpres.net/Bash_AVpres/ https://avpres.net/FFmpeg/im_FFV1.html
Up to interested party, I guess.
The programs dvgrab and possibly the newer vrecord can also autosplit by scenes https://linux.die.net/man/1/dvgrab https://github.com/amiaopensource/vrecord https://github.com/mipops/dvrescue
Yes, I was thinking about this, but unfortunately without any testable idea. Sorry.
On 31.05.2025 05:33, Andrew Randrianasulu wrote:
On Fri, May 30, 2025 at 4:27 PM Andrew Randrianasulu <[email protected]> wrote:
пт, 30 мая 2025 г., 15:55 Terje J. Hanssen<[email protected]>:
Den 30.05.2025 00:15, skrev Andrew Randrianasulu:
пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu<[email protected]>:
чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin<[email protected]>:
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-...
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
root@slax:~# mpv /dev/shm/se*.mpeg Playing: /dev/shm/seg%02d.mpeg Failed to recognize file format. Playing: /dev/shm/seg00.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AO: [pulse] 48000Hz stereo 2ch s16 VO: [gpu] 720x576 => 768x576 yuv420p AV: 00:00:02 / 00:00:02 (97%) A-V: 0.000 Playing: /dev/shm/seg01.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg02.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg03.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg04.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg05.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg06.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:02 / 00:00:02 (98%) A-V: 0.000 Playing: /dev/shm/seg07.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg08.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg09.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg10.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg11.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:00 / 00:00:01 (91%) A-V: 0.000 Exiting... (Some errors happened)
I've verified that at least audio track exist, but you better to run your own liestening test to hear if audio get desynchronized over longer runs
What worries me is audio. If segmented audio muxer cut it differently from video we will get desync.
May be setting labels at specific intervals and then using "write new file at label" checkbox is better idea?
I simply did a test with my system's ffmpeg segment muxer: https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-...
Input file: hdv09_04_h264.mp4 Duration: 00:03:58.88, start: 0.000000, bitrate: 8963 kb/s
Tried 1 minute segment time:
ffmpeg -hide_banner -i hdv09_04_h264.mp4 -threads 3 \ -vcodec copy -f segment -segment_time 01:00 \ -reset_timestamps 1 \ cam_out_h264_%02d.mp4
[segment @ 0x563c2874fa80] Opening 'cam_out_h264_01.mp4' for writingeed=52.1x [segment @ 0x563c2874fa80] Opening 'cam_out_h264_02.mp4' for writingeed=55.5x [segment @ 0x563c2874fa80] Opening 'cam_out_h264_03.mp4' for writingeed= 57x [out#0/segment @ 0x563c28727680] video:257421KiB audio:3749KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown frame= 5972 fps=1445 q=-1.0 Lsize=N/A time=00:03:58.80 bitrate=N/A speed=57.8x [aac @ 0x563c28721a40] Qavg: 454.522
68M cam_out_h264_00.mp4 63M cam_out_h264_01.mp4 59M cam_out_h264_02.mp4 68M cam_out_h264_03.mp4 --------
Duration: 00:01:00.38, start: 0.058000, bitrate: 9394 kb/s Duration: 00:01:00.00, start: 0.000000, bitrate: 8672 kb/s Duration: 00:01:00.60, start: 0.000000, bitrate: 8104 kb/s Duration: 00:00:57.93, start: 0.000000, bitrate: 9705 kb/s
In total: 00:03:58.93 which is 00:00:00.03 (=3/100 sek) more than the input file which I think is good enough for practical purposes (editing and backup/preservation/archival)
I wonder if it is within or out of our reach to make some targeted profiles for backup/preservation? I.e would it be of interest and possible to utilize/integrate/use oss tools and scripts as found here: https://avpres.net/Bash_AVpres/ https://avpres.net/FFmpeg/im_FFV1.html Up to interested party, I guess.
The programs dvgrab and possibly the newer vrecord can also autosplit by scenes https://linux.die.net/man/1/dvgrab https://github.com/amiaopensource/vrecord https://github.com/mipops/dvrescue Yes, I was thinking about this, but unfortunately without any testable idea. Sorry.
вс, 1 июн. 2025 г., 00:03 Terje J. Hanssen <[email protected]>:
On 31.05.2025 05:33, Andrew Randrianasulu wrote:
On Fri, May 30, 2025 at 4:27 PM Andrew Randrianasulu<[email protected]> <[email protected]> wrote:
пт, 30 мая 2025 г., 15:55 Terje J. Hanssen <[email protected]> <[email protected]>:
Den 30.05.2025 00:15, skrev Andrew Randrianasulu:
пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu <[email protected]> <[email protected]>:
чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin <[email protected]> <[email protected]>:
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 athttps://unix.stackexchange.com/questions/1670/how-can-i-use-ffmpeg-to-split-...
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
You need to set bitrate explicitly for this profile, I think? in GUI or just add b=16M or what you like. Right now for longer segments you need to modify both profiles manually and set segment_time to value you want in both audio and video *.seg profiles If it works I think I know where in cingg code I should put override so our gui for format (muxer) options will work (right now it stumbles on difference between seg and segment )
root@slax:~# mpv /dev/shm/se*.mpeg Playing: /dev/shm/seg%02d.mpeg Failed to recognize file format. Playing: /dev/shm/seg00.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AO: [pulse] 48000Hz stereo 2ch s16 VO: [gpu] 720x576 => 768x576 yuv420p AV: 00:00:02 / 00:00:02 (97%) A-V: 0.000 Playing: /dev/shm/seg01.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg02.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg03.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg04.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg05.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg06.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:02 / 00:00:02 (98%) A-V: 0.000 Playing: /dev/shm/seg07.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg08.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg09.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg10.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg11.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:00 / 00:00:01 (91%) A-V: 0.000 Exiting... (Some errors happened)
I've verified that at least audio track exist, but you better to run your own liestening test to hear if audio get desynchronized over longer runs
What worries me is audio. If segmented audio muxer cut it differently from video we will get desync.
May be setting labels at specific intervals and then using "write new file at label" checkbox is better idea?
I simply did a test with my system's ffmpeg segment muxer:https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-...
Input file: hdv09_04_h264.mp4 Duration: 00:03:58.88, start: 0.000000, bitrate: 8963 kb/s
Tried 1 minute segment time:
ffmpeg -hide_banner -i hdv09_04_h264.mp4 -threads 3 \ -vcodec copy -f segment -segment_time 01:00 \ -reset_timestamps 1 \ cam_out_h264_%02d.mp4
[segment @ 0x563c2874fa80] Opening 'cam_out_h264_01.mp4' for writingeed=52.1x [segment @ 0x563c2874fa80] Opening 'cam_out_h264_02.mp4' for writingeed=55.5x [segment @ 0x563c2874fa80] Opening 'cam_out_h264_03.mp4' for writingeed= 57x [out#0/segment @ 0x563c28727680] video:257421KiB audio:3749KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown frame= 5972 fps=1445 q=-1.0 Lsize=N/A time=00:03:58.80 bitrate=N/A speed=57.8x [aac @ 0x563c28721a40] Qavg: 454.522
68M cam_out_h264_00.mp4 63M cam_out_h264_01.mp4 59M cam_out_h264_02.mp4 68M cam_out_h264_03.mp4 --------
Duration: 00:01:00.38, start: 0.058000, bitrate: 9394 kb/s Duration: 00:01:00.00, start: 0.000000, bitrate: 8672 kb/s Duration: 00:01:00.60, start: 0.000000, bitrate: 8104 kb/s Duration: 00:00:57.93, start: 0.000000, bitrate: 9705 kb/s
In total: 00:03:58.93 which is 00:00:00.03 (=3/100 sek) more than the input file which I think is good enough for practical purposes (editing and backup/preservation/archival)
I wonder if it is within or out of our reach to make some targeted profiles for backup/preservation? I.e would it be of interest and possible to utilize/integrate/use oss tools and scripts as found here:https://avpres.net/Bash_AVpres/https://avpres.net/FFmpeg/im_FFV1.html
Up to interested party, I guess.
The programs dvgrab and possibly the newer vrecord can also autosplit by sceneshttps://linux.die.net/man/1/dvgrabhttps://github.com/amiaopensource/vrecordh...
Yes, I was thinking about this, but unfortunately without any testable idea. Sorry.
with this patch (git am variety) I can set segment_time in gui, but for short test video actual cut time was dominated by same set of six keyframes, in my case. On Sun, Jun 1, 2025 at 4:56 AM Andrew Randrianasulu <[email protected]> wrote:
вс, 1 июн. 2025 г., 00:03 Terje J. Hanssen <[email protected]>:
On 31.05.2025 05:33, Andrew Randrianasulu wrote:
On Fri, May 30, 2025 at 4:27 PM Andrew Randrianasulu <[email protected]> wrote:
пт, 30 мая 2025 г., 15:55 Terje J. Hanssen <[email protected]>:
Den 30.05.2025 00:15, skrev Andrew Randrianasulu:
пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu <[email protected]>:
чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin <[email protected]>:
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-...
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
You need to set bitrate explicitly for this profile, I think?
in GUI or just add b=16M or what you like.
Right now for longer segments you need to modify both profiles manually and set segment_time to value you want in both audio and video *.seg profiles
If it works I think I know where in cingg code I should put override so our gui for format (muxer) options will work (right now it stumbles on difference between seg and segment )
root@slax:~# mpv /dev/shm/se*.mpeg Playing: /dev/shm/seg%02d.mpeg Failed to recognize file format. Playing: /dev/shm/seg00.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AO: [pulse] 48000Hz stereo 2ch s16 VO: [gpu] 720x576 => 768x576 yuv420p AV: 00:00:02 / 00:00:02 (97%) A-V: 0.000 Playing: /dev/shm/seg01.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg02.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg03.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg04.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg05.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg06.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:02 / 00:00:02 (98%) A-V: 0.000 Playing: /dev/shm/seg07.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg08.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg09.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg10.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg11.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:00 / 00:00:01 (91%) A-V: 0.000 Exiting... (Some errors happened)
I've verified that at least audio track exist, but you better to run your own liestening test to hear if audio get desynchronized over longer runs
What worries me is audio. If segmented audio muxer cut it differently from video we will get desync.
May be setting labels at specific intervals and then using "write new file at label" checkbox is better idea?
I simply did a test with my system's ffmpeg segment muxer: https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-...
Input file: hdv09_04_h264.mp4 Duration: 00:03:58.88, start: 0.000000, bitrate: 8963 kb/s
Tried 1 minute segment time:
ffmpeg -hide_banner -i hdv09_04_h264.mp4 -threads 3 \ -vcodec copy -f segment -segment_time 01:00 \ -reset_timestamps 1 \ cam_out_h264_%02d.mp4
[segment @ 0x563c2874fa80] Opening 'cam_out_h264_01.mp4' for writingeed=52.1x [segment @ 0x563c2874fa80] Opening 'cam_out_h264_02.mp4' for writingeed=55.5x [segment @ 0x563c2874fa80] Opening 'cam_out_h264_03.mp4' for writingeed= 57x [out#0/segment @ 0x563c28727680] video:257421KiB audio:3749KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown frame= 5972 fps=1445 q=-1.0 Lsize=N/A time=00:03:58.80 bitrate=N/A speed=57.8x [aac @ 0x563c28721a40] Qavg: 454.522
68M cam_out_h264_00.mp4 63M cam_out_h264_01.mp4 59M cam_out_h264_02.mp4 68M cam_out_h264_03.mp4 --------
Duration: 00:01:00.38, start: 0.058000, bitrate: 9394 kb/s Duration: 00:01:00.00, start: 0.000000, bitrate: 8672 kb/s Duration: 00:01:00.60, start: 0.000000, bitrate: 8104 kb/s Duration: 00:00:57.93, start: 0.000000, bitrate: 9705 kb/s
In total: 00:03:58.93 which is 00:00:00.03 (=3/100 sek) more than the input file which I think is good enough for practical purposes (editing and backup/preservation/archival)
I wonder if it is within or out of our reach to make some targeted profiles for backup/preservation? I.e would it be of interest and possible to utilize/integrate/use oss tools and scripts as found here: https://avpres.net/Bash_AVpres/ https://avpres.net/FFmpeg/im_FFV1.html
Up to interested party, I guess.
The programs dvgrab and possibly the newer vrecord can also autosplit by scenes https://linux.die.net/man/1/dvgrab https://github.com/amiaopensource/vrecord https://github.com/mipops/dvrescue
Yes, I was thinking about this, but unfortunately without any testable idea. Sorry.
Andrew, I have been contemplating this since you brought it up again with Terje. Should it be checked into GIT after Terje checks it? On Sun, Jun 1, 2025 at 1:06 AM Andrew Randrianasulu via Cin < [email protected]> wrote:
with this patch (git am variety) I can set segment_time in gui, but for short test video actual cut time was dominated by same set of six keyframes, in my case.
On Sun, Jun 1, 2025 at 4:56 AM Andrew Randrianasulu <[email protected]> wrote:
вс, 1 июн. 2025 г., 00:03 Terje J. Hanssen <[email protected]>:
On 31.05.2025 05:33, Andrew Randrianasulu wrote:
On Fri, May 30, 2025 at 4:27 PM Andrew Randrianasulu <[email protected]> wrote:
пт, 30 мая 2025 г., 15:55 Terje J. Hanssen <[email protected]>:
Den 30.05.2025 00:15, skrev Andrew Randrianasulu:
пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu <[email protected]
:
чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin <
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-...
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
You need to set bitrate explicitly for this profile, I think?
in GUI or just add b=16M or what you like.
Right now for longer segments you need to modify both profiles manually and set segment_time to value you want in both audio and video *.seg profiles
If it works I think I know where in cingg code I should put override so our gui for format (muxer) options will work (right now it stumbles on difference between seg and segment )
root@slax:~# mpv /dev/shm/se*.mpeg Playing: /dev/shm/seg%02d.mpeg Failed to recognize file format. Playing: /dev/shm/seg00.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AO: [pulse] 48000Hz stereo 2ch s16 VO: [gpu] 720x576 => 768x576 yuv420p AV: 00:00:02 / 00:00:02 (97%) A-V: 0.000 Playing: /dev/shm/seg01.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg02.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg03.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg04.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg05.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg06.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:02 / 00:00:02 (98%) A-V: 0.000 Playing: /dev/shm/seg07.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg08.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg09.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg10.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg11.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:00 / 00:00:01 (91%) A-V: 0.000 Exiting... (Some errors happened)
I've verified that at least audio track exist, but you better to run your own liestening test to hear if audio get desynchronized over longer runs
What worries me is audio. If segmented audio muxer cut it differently
from video we will get desync.
May be setting labels at specific intervals and then using "write new
file at label" checkbox is better idea?
I simply did a test with my system's ffmpeg segment muxer:
https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-...
Input file: hdv09_04_h264.mp4 Duration: 00:03:58.88, start: 0.000000, bitrate: 8963 kb/s
Tried 1 minute segment time:
ffmpeg -hide_banner -i hdv09_04_h264.mp4 -threads 3 \ -vcodec copy -f segment -segment_time 01:00 \ -reset_timestamps 1 \ cam_out_h264_%02d.mp4
[segment @ 0x563c2874fa80] Opening 'cam_out_h264_01.mp4' for
writingeed=52.1x
[segment @ 0x563c2874fa80] Opening 'cam_out_h264_02.mp4' for writingeed=55.5x [segment @ 0x563c2874fa80] Opening 'cam_out_h264_03.mp4' for writingeed= 57x [out#0/segment @ 0x563c28727680] video:257421KiB audio:3749KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown frame= 5972 fps=1445 q=-1.0 Lsize=N/A time=00:03:58.80 bitrate=N/A speed=57.8x [aac @ 0x563c28721a40] Qavg: 454.522
68M cam_out_h264_00.mp4 63M cam_out_h264_01.mp4 59M cam_out_h264_02.mp4 68M cam_out_h264_03.mp4 --------
Duration: 00:01:00.38, start: 0.058000, bitrate: 9394 kb/s Duration: 00:01:00.00, start: 0.000000, bitrate: 8672 kb/s Duration: 00:01:00.60, start: 0.000000, bitrate: 8104 kb/s Duration: 00:00:57.93, start: 0.000000, bitrate: 9705 kb/s
In total: 00:03:58.93 which is 00:00:00.03 (=3/100 sek) more than the input file which I think is good enough for practical purposes (editing and backup/preservation/archival)
I wonder if it is within or out of our reach to make some targeted profiles for backup/preservation? I.e would it be of interest and possible to utilize/integrate/use oss tools and scripts as found here: https://avpres.net/Bash_AVpres/ https://avpres.net/FFmpeg/im_FFV1.html
Up to interested party, I guess.
The programs dvgrab and possibly the newer vrecord can also autosplit by scenes https://linux.die.net/man/1/dvgrab https://github.com/amiaopensource/vrecord https://github.com/mipops/dvrescue
Yes, I was thinking about this, but unfortunately without any testable idea. Sorry.
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
пн, 9 июн. 2025 г., 19:32 Phyllis Smith <[email protected]>:
Andrew, I have been contemplating this since you brought it up again with Terje. Should it be checked into GIT after Terje checks it?
if it works .... May be with # comment line saying for different seg duration change value here and in corresponding audio file.
On Sun, Jun 1, 2025 at 1:06 AM Andrew Randrianasulu via Cin < [email protected]> wrote:
with this patch (git am variety) I can set segment_time in gui, but for short test video actual cut time was dominated by same set of six keyframes, in my case.
On Sun, Jun 1, 2025 at 4:56 AM Andrew Randrianasulu <[email protected]> wrote:
вс, 1 июн. 2025 г., 00:03 Terje J. Hanssen <[email protected]>:
On 31.05.2025 05:33, Andrew Randrianasulu wrote:
On Fri, May 30, 2025 at 4:27 PM Andrew Randrianasulu <[email protected]> wrote:
пт, 30 мая 2025 г., 15:55 Terje J. Hanssen <[email protected]>:
Den 30.05.2025 00:15, skrev Andrew Randrianasulu:
пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu <
чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin <
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-...
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
You need to set bitrate explicitly for this profile, I think?
in GUI or just add b=16M or what you like.
Right now for longer segments you need to modify both profiles manually and set segment_time to value you want in both audio and video *.seg profiles
If it works I think I know where in cingg code I should put override so our gui for format (muxer) options will work (right now it stumbles on difference between seg and segment )
root@slax:~# mpv /dev/shm/se*.mpeg Playing: /dev/shm/seg%02d.mpeg Failed to recognize file format. Playing: /dev/shm/seg00.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AO: [pulse] 48000Hz stereo 2ch s16 VO: [gpu] 720x576 => 768x576 yuv420p AV: 00:00:02 / 00:00:02 (97%) A-V: 0.000 Playing: /dev/shm/seg01.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg02.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg03.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg04.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg05.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg06.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:02 / 00:00:02 (98%) A-V: 0.000 Playing: /dev/shm/seg07.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg08.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg09.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg10.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg11.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:00 / 00:00:01 (91%) A-V: 0.000 Exiting... (Some errors happened)
I've verified that at least audio track exist, but you better to run your own liestening test to hear if audio get desynchronized over longer runs
What worries me is audio. If segmented audio muxer cut it differently
from video we will get desync.
May be setting labels at specific intervals and then using "write new
file at label" checkbox is better idea?
I simply did a test with my system's ffmpeg segment muxer:
https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-...
Input file: hdv09_04_h264.mp4 Duration: 00:03:58.88, start: 0.000000, bitrate: 8963 kb/s
Tried 1 minute segment time:
ffmpeg -hide_banner -i hdv09_04_h264.mp4 -threads 3 \ -vcodec copy -f segment -segment_time 01:00 \ -reset_timestamps 1 \ cam_out_h264_%02d.mp4
[segment @ 0x563c2874fa80] Opening 'cam_out_h264_01.mp4' for
writingeed=52.1x
[segment @ 0x563c2874fa80] Opening 'cam_out_h264_02.mp4' for writingeed=55.5x [segment @ 0x563c2874fa80] Opening 'cam_out_h264_03.mp4' for writingeed= 57x [out#0/segment @ 0x563c28727680] video:257421KiB audio:3749KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown frame= 5972 fps=1445 q=-1.0 Lsize=N/A time=00:03:58.80 bitrate=N/A speed=57.8x [aac @ 0x563c28721a40] Qavg: 454.522
68M cam_out_h264_00.mp4 63M cam_out_h264_01.mp4 59M cam_out_h264_02.mp4 68M cam_out_h264_03.mp4 --------
Duration: 00:01:00.38, start: 0.058000, bitrate: 9394 kb/s Duration: 00:01:00.00, start: 0.000000, bitrate: 8672 kb/s Duration: 00:01:00.60, start: 0.000000, bitrate: 8104 kb/s Duration: 00:00:57.93, start: 0.000000, bitrate: 9705 kb/s
In total: 00:03:58.93 which is 00:00:00.03 (=3/100 sek) more than the input file which I think is good enough for practical purposes (editing and backup/preservation/archival)
I wonder if it is within or out of our reach to make some targeted profiles for backup/preservation? I.e would it be of interest and possible to utilize/integrate/use oss tools and scripts as found here: https://avpres.net/Bash_AVpres/ https://avpres.net/FFmpeg/im_FFV1.html
Up to interested party, I guess.
The programs dvgrab and possibly the newer vrecord can also autosplit by scenes https://linux.die.net/man/1/dvgrab https://github.com/amiaopensource/vrecord https://github.com/mipops/dvrescue
Yes, I was thinking about this, but unfortunately without any testable idea. Sorry.
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Although the patch 0001-Fixup-seg-name-to-segment-so-format-gui-button-work.patch works at our current version of ffmpeg 7.0 as does the audio render format "bluray_lpcm.seg" with the first line of "segment_format=mpegts", the corresponding video render format "mpeg2hd422p.seg" does not -- at least it fails for me. Its error message is: FFMPEG::encode_activate: write header failed /tmp/ccc.seg
err: Muxer not found
I will see what I may have done wrong. On Mon, Jun 9, 2025 at 10:39 AM Andrew Randrianasulu < [email protected]> wrote:
пн, 9 июн. 2025 г., 19:32 Phyllis Smith <[email protected]>:
Andrew, I have been contemplating this since you brought it up again with Terje. Should it be checked into GIT after Terje checks it?
if it works ....
May be with # comment line saying for different seg duration change value here and in corresponding audio file.
On Sun, Jun 1, 2025 at 1:06 AM Andrew Randrianasulu via Cin < [email protected]> wrote:
with this patch (git am variety) I can set segment_time in gui, but for short test video actual cut time was dominated by same set of six keyframes, in my case.
On Sun, Jun 1, 2025 at 4:56 AM Andrew Randrianasulu <[email protected]> wrote:
вс, 1 июн. 2025 г., 00:03 Terje J. Hanssen <[email protected]>:
On 31.05.2025 05:33, Andrew Randrianasulu wrote:
On Fri, May 30, 2025 at 4:27 PM Andrew Randrianasulu <[email protected]> wrote:
пт, 30 мая 2025 г., 15:55 Terje J. Hanssen <[email protected]>:
Den 30.05.2025 00:15, skrev Andrew Randrianasulu:
пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu <
чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin <
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-...
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
You need to set bitrate explicitly for this profile, I think?
in GUI or just add b=16M or what you like.
Right now for longer segments you need to modify both profiles manually and set segment_time to value you want in both audio and video *.seg profiles
If it works I think I know where in cingg code I should put override so our gui for format (muxer) options will work (right now it stumbles on difference between seg and segment )
root@slax:~# mpv /dev/shm/se*.mpeg Playing: /dev/shm/seg%02d.mpeg Failed to recognize file format. Playing: /dev/shm/seg00.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AO: [pulse] 48000Hz stereo 2ch s16 VO: [gpu] 720x576 => 768x576 yuv420p AV: 00:00:02 / 00:00:02 (97%) A-V: 0.000 Playing: /dev/shm/seg01.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg02.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg03.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg04.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg05.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg06.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:02 / 00:00:02 (98%) A-V: 0.000 Playing: /dev/shm/seg07.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg08.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg09.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg10.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg11.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:00 / 00:00:01 (91%) A-V: 0.000 Exiting... (Some errors happened)
I've verified that at least audio track exist, but you better to run your own liestening test to hear if audio get desynchronized over longer runs
What worries me is audio. If segmented audio muxer cut it differently
from video we will get desync.
May be setting labels at specific intervals and then using "write new
file at label" checkbox is better idea?
I simply did a test with my system's ffmpeg segment muxer:
https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-...
Input file: hdv09_04_h264.mp4 Duration: 00:03:58.88, start: 0.000000, bitrate: 8963 kb/s
Tried 1 minute segment time:
ffmpeg -hide_banner -i hdv09_04_h264.mp4 -threads 3 \ -vcodec copy -f segment -segment_time 01:00 \ -reset_timestamps 1 \ cam_out_h264_%02d.mp4
[segment @ 0x563c2874fa80] Opening 'cam_out_h264_01.mp4' for
writingeed=52.1x
[segment @ 0x563c2874fa80] Opening 'cam_out_h264_02.mp4' for writingeed=55.5x [segment @ 0x563c2874fa80] Opening 'cam_out_h264_03.mp4' for writingeed= 57x [out#0/segment @ 0x563c28727680] video:257421KiB audio:3749KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown frame= 5972 fps=1445 q=-1.0 Lsize=N/A time=00:03:58.80 bitrate=N/A speed=57.8x [aac @ 0x563c28721a40] Qavg: 454.522
68M cam_out_h264_00.mp4 63M cam_out_h264_01.mp4 59M cam_out_h264_02.mp4 68M cam_out_h264_03.mp4 --------
Duration: 00:01:00.38, start: 0.058000, bitrate: 9394 kb/s Duration: 00:01:00.00, start: 0.000000, bitrate: 8672 kb/s Duration: 00:01:00.60, start: 0.000000, bitrate: 8104 kb/s Duration: 00:00:57.93, start: 0.000000, bitrate: 9705 kb/s
In total: 00:03:58.93 which is 00:00:00.03 (=3/100 sek) more than the input file which I think is good enough for practical purposes (editing and backup/preservation/archival)
I wonder if it is within or out of our reach to make some targeted profiles for backup/preservation? I.e would it be of interest and possible to utilize/integrate/use oss tools and scripts as found here: https://avpres.net/Bash_AVpres/ https://avpres.net/FFmpeg/im_FFV1.html
Up to interested party, I guess.
The programs dvgrab and possibly the newer vrecord can also autosplit by scenes https://linux.die.net/man/1/dvgrab https://github.com/amiaopensource/vrecord https://github.com/mipops/dvrescue
Yes, I was thinking about this, but unfortunately without any testable idea. Sorry.
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
вт, 10 июн. 2025 г., 18:43 Phyllis Smith <[email protected]>:
Although the patch 0001-Fixup-seg-name-to-segment-so-format-gui-button-work.patch works at our current version of ffmpeg 7.0 as does the audio render format "bluray_lpcm.seg" with the first line of "segment_format=mpegts", the corresponding video render format "mpeg2hd422p.seg" does not -- at least it fails for me. Its error message is:
FFMPEG::encode_activate: write header failed /tmp/ccc.seg
err: Muxer not found
I will see what I may have done wrong.
if it literally reads segment mpeg2video segment_format=mpegts segment_time=00:10 <= your segment time reset_timestamps=1 cin_pix_fmt=yuv422p then "your segment time" was comment not meant to put in there in this form, just reminder for human reader .... may be it choke on this?
On Mon, Jun 9, 2025 at 10:39 AM Andrew Randrianasulu < [email protected]> wrote:
пн, 9 июн. 2025 г., 19:32 Phyllis Smith <[email protected]>:
Andrew, I have been contemplating this since you brought it up again with Terje. Should it be checked into GIT after Terje checks it?
if it works ....
May be with # comment line saying for different seg duration change value here and in corresponding audio file.
On Sun, Jun 1, 2025 at 1:06 AM Andrew Randrianasulu via Cin < [email protected]> wrote:
with this patch (git am variety) I can set segment_time in gui, but for short test video actual cut time was dominated by same set of six keyframes, in my case.
On Sun, Jun 1, 2025 at 4:56 AM Andrew Randrianasulu <[email protected]> wrote:
вс, 1 июн. 2025 г., 00:03 Terje J. Hanssen <[email protected]>:
On 31.05.2025 05:33, Andrew Randrianasulu wrote:
On Fri, May 30, 2025 at 4:27 PM Andrew Randrianasulu <[email protected]> wrote:
пт, 30 мая 2025 г., 15:55 Terje J. Hanssen <[email protected]
:
Den 30.05.2025 00:15, skrev Andrew Randrianasulu:
пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu <
чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin <
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-...
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
You need to set bitrate explicitly for this profile, I think?
in GUI or just add b=16M or what you like.
Right now for longer segments you need to modify both profiles manually and set segment_time to value you want in both audio and video *.seg profiles
If it works I think I know where in cingg code I should put override so our gui for format (muxer) options will work (right now it stumbles on difference between seg and segment )
root@slax:~# mpv /dev/shm/se*.mpeg Playing: /dev/shm/seg%02d.mpeg Failed to recognize file format. Playing: /dev/shm/seg00.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AO: [pulse] 48000Hz stereo 2ch s16 VO: [gpu] 720x576 => 768x576 yuv420p AV: 00:00:02 / 00:00:02 (97%) A-V: 0.000 Playing: /dev/shm/seg01.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg02.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg03.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg04.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg05.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg06.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:02 / 00:00:02 (98%) A-V: 0.000 Playing: /dev/shm/seg07.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg08.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg09.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg10.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 Playing: /dev/shm/seg11.mpeg (+) Video --vid=1 (mpeg2video 720x576 25.000fps) (+) Audio --aid=1 (mp2 2ch 48000Hz) AV: 00:00:00 / 00:00:01 (91%) A-V: 0.000 Exiting... (Some errors happened)
I've verified that at least audio track exist, but you better to run your own liestening test to hear if audio get desynchronized over longer runs
What worries me is audio. If segmented audio muxer cut it
differently from video we will get desync.
May be setting labels at specific intervals and then using "write
new file at label" checkbox is better idea?
I simply did a test with my system's ffmpeg segment muxer:
https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-...
Input file: hdv09_04_h264.mp4 Duration: 00:03:58.88, start: 0.000000, bitrate: 8963 kb/s
Tried 1 minute segment time:
ffmpeg -hide_banner -i hdv09_04_h264.mp4 -threads 3 \ -vcodec copy -f segment -segment_time 01:00 \ -reset_timestamps 1 \ cam_out_h264_%02d.mp4
[segment @ 0x563c2874fa80] Opening 'cam_out_h264_01.mp4' for
writingeed=52.1x
[segment @ 0x563c2874fa80] Opening 'cam_out_h264_02.mp4' for writingeed=55.5x [segment @ 0x563c2874fa80] Opening 'cam_out_h264_03.mp4' for writingeed= 57x [out#0/segment @ 0x563c28727680] video:257421KiB audio:3749KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown frame= 5972 fps=1445 q=-1.0 Lsize=N/A time=00:03:58.80 bitrate=N/A speed=57.8x [aac @ 0x563c28721a40] Qavg: 454.522
68M cam_out_h264_00.mp4 63M cam_out_h264_01.mp4 59M cam_out_h264_02.mp4 68M cam_out_h264_03.mp4 --------
Duration: 00:01:00.38, start: 0.058000, bitrate: 9394 kb/s Duration: 00:01:00.00, start: 0.000000, bitrate: 8672 kb/s Duration: 00:01:00.60, start: 0.000000, bitrate: 8104 kb/s Duration: 00:00:57.93, start: 0.000000, bitrate: 9705 kb/s
In total: 00:03:58.93 which is 00:00:00.03 (=3/100 sek) more than the input file which I think is good enough for practical purposes (editing and backup/preservation/archival)
I wonder if it is within or out of our reach to make some targeted profiles for backup/preservation? I.e would it be of interest and possible to utilize/integrate/use oss tools and scripts as found here: https://avpres.net/Bash_AVpres/ https://avpres.net/FFmpeg/im_FFV1.html
Up to interested party, I guess.
The programs dvgrab and possibly the newer vrecord can also autosplit by scenes https://linux.die.net/man/1/dvgrab https://github.com/amiaopensource/vrecord https://github.com/mipops/dvrescue
Yes, I was thinking about this, but unfortunately without any testable idea. Sorry.
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Den 10.06.2025 17:48, skrev Andrew Randrianasulu:
вт, 10 июн. 2025 г., 18:43 Phyllis Smith <[email protected]>:
Although the patch 0001-Fixup-seg-name-to-segment-so-format-gui-button-work.patch works at our current version of ffmpeg 7.0 as does the audio render format "bluray_lpcm.seg" with the first line of "segment_format=mpegts", the corresponding video render format "mpeg2hd422p.seg" does not -- at least it fails for me. Its error message is:
FFMPEG::encode_activate: write header failed /tmp/ccc.seg err: Muxer not found
I will see what I may have done wrong.
if it literally reads
segment mpeg2video segment_format=mpegts segment_time=00:10 <= your segment time reset_timestamps=1 cin_pix_fmt=yuv422p
then "your segment time" was comment not meant to put in there in this form, just reminder for human reader .... may be it choke on this?
Another question: Maybe we should extend our segment counts to 3 digits, that is replace our current %02d with %03d ? Refere to these ffmpeg examples https://ffmpeg.org/ffmpeg-formats.html#Examples-15 https://ffmpeg.org/ffmpeg-formats.html#Examples-15
вт, 10 июн. 2025 г., 19:31 Terje J. Hanssen <[email protected]>:
Den 10.06.2025 17:48, skrev Andrew Randrianasulu:
вт, 10 июн. 2025 г., 18:43 Phyllis Smith <[email protected]>:
Although the patch 0001-Fixup-seg-name-to-segment-so-format-gui-button-work.patch works at our current version of ffmpeg 7.0 as does the audio render format "bluray_lpcm.seg" with the first line of "segment_format=mpegts", the corresponding video render format "mpeg2hd422p.seg" does not -- at least it fails for me. Its error message is:
FFMPEG::encode_activate: write header failed /tmp/ccc.seg
err: Muxer not found
I will see what I may have done wrong.
if it literally reads
segment mpeg2video segment_format=mpegts segment_time=00:10 <= your segment time reset_timestamps=1 cin_pix_fmt=yuv422p
then "your segment time" was comment not meant to put in there in this form, just reminder for human reader .... may be it choke on this?
Another question: Maybe we should extend our segment counts to 3 digits, that is replace our current %02d with %03d ?
Isn't this something you set as part of filename? Refere to these ffmpeg examples
Den 10.06.2025 18:44, skrev Andrew Randrianasulu:
вт, 10 июн. 2025 г., 19:31 Terje J. Hanssen <[email protected]>:
Den 10.06.2025 17:48, skrev Andrew Randrianasulu:
вт, 10 июн. 2025 г., 18:43 Phyllis Smith <[email protected]>:
Although the patch 0001-Fixup-seg-name-to-segment-so-format-gui-button-work.patch works at our current version of ffmpeg 7.0 as does the audio render format "bluray_lpcm.seg" with the first line of "segment_format=mpegts", the corresponding video render format "mpeg2hd422p.seg" does not -- at least it fails for me. Its error message is:
FFMPEG::encode_activate: write header failed /tmp/ccc.seg err: Muxer not found
I will see what I may have done wrong.
if it literally reads
segment mpeg2video segment_format=mpegts segment_time=00:10 <= your segment time reset_timestamps=1 cin_pix_fmt=yuv422p
then "your segment time" was comment not meant to put in there in this form, just reminder for human reader .... may be it choke on this?
Another question: Maybe we should extend our segment counts to 3 digits, that is replace our current %02d with %03d ?
Isn't this something you set as part of filename?
Yes, your right - my fault. Forget it :) '
Refere to these ffmpeg examples https://ffmpeg.org/ffmpeg-formats.html#Examples-15
I haven't had a chance to analyze it yet but I already fixed the comment. It reads:
segment mpeg2video segment_format=mpegts # Change the segment time in the next line as needed segment_time=00:10 reset_timestamps=1 cin_pix_fmt=yuv422p b=35M dc=10 muxrate=38M minrate=35M maxrate=35M bufsize=38M
bf=2
profile=high refs=1
On Tue, Jun 10, 2025 at 9:48 AM Andrew Randrianasulu < [email protected]> wrote:
вт, 10 июн. 2025 г., 18:43 Phyllis Smith <[email protected]>:
Although the patch 0001-Fixup-seg-name-to-segment-so-format-gui-button-work.patch works at our current version of ffmpeg 7.0 as does the audio render format "bluray_lpcm.seg" with the first line of "segment_format=mpegts", the corresponding video render format "mpeg2hd422p.seg" does not -- at least it fails for me. Its error message is:
FFMPEG::encode_activate: write header failed /tmp/ccc.seg
err: Muxer not found
I will see what I may have done wrong.
if it literally reads
segment mpeg2video segment_format=mpegts segment_time=00:10 <= your segment time reset_timestamps=1 cin_pix_fmt=yuv422p
then "your segment time" was comment not meant to put in there in this form, just reminder for human reader .... may be it choke on this?
On Mon, Jun 9, 2025 at 10:39 AM Andrew Randrianasulu < [email protected]> wrote:
пн, 9 июн. 2025 г., 19:32 Phyllis Smith <[email protected]>:
Andrew, I have been contemplating this since you brought it up again with Terje. Should it be checked into GIT after Terje checks it?
if it works ....
May be with # comment line saying for different seg duration change value here and in corresponding audio file.
On Sun, Jun 1, 2025 at 1:06 AM Andrew Randrianasulu via Cin < [email protected]> wrote:
with this patch (git am variety) I can set segment_time in gui, but for short test video actual cut time was dominated by same set of six keyframes, in my case.
On Sun, Jun 1, 2025 at 4:56 AM Andrew Randrianasulu <[email protected]> wrote:
вс, 1 июн. 2025 г., 00:03 Terje J. Hanssen <[email protected] : > > > > On 31.05.2025 05:33, Andrew Randrianasulu wrote: > > On Fri, May 30, 2025 at 4:27 PM Andrew Randrianasulu > <[email protected]> wrote: > > пт, 30 мая 2025 г., 15:55 Terje J. Hanssen <[email protected] : > > Den 30.05.2025 00:15, skrev Andrew Randrianasulu: > > > > пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu <
> > чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin < [email protected]>: > > 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-... > > 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
You need to set bitrate explicitly for this profile, I think?
in GUI or just add b=16M or what you like.
Right now for longer segments you need to modify both profiles manually and set segment_time to value you want in both audio and video *.seg profiles
If it works I think I know where in cingg code I should put override so our gui for format (muxer) options will work (right now it stumbles on difference between seg and segment )
> > root@slax:~# mpv /dev/shm/se*.mpeg > Playing: /dev/shm/seg%02d.mpeg > Failed to recognize file format. > Playing: /dev/shm/seg00.mpeg > (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > (+) Audio --aid=1 (mp2 2ch 48000Hz) > AO: [pulse] 48000Hz stereo 2ch s16 > VO: [gpu] 720x576 => 768x576 yuv420p > AV: 00:00:02 / 00:00:02 (97%) A-V: 0.000 > Playing: /dev/shm/seg01.mpeg > (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > (+) Audio --aid=1 (mp2 2ch 48000Hz) > AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > Playing: /dev/shm/seg02.mpeg > (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > (+) Audio --aid=1 (mp2 2ch 48000Hz) > AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > Playing: /dev/shm/seg03.mpeg > (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > (+) Audio --aid=1 (mp2 2ch 48000Hz) > AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > Playing: /dev/shm/seg04.mpeg > (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > (+) Audio --aid=1 (mp2 2ch 48000Hz) > AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > Playing: /dev/shm/seg05.mpeg > (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > (+) Audio --aid=1 (mp2 2ch 48000Hz) > AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > Playing: /dev/shm/seg06.mpeg > (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > (+) Audio --aid=1 (mp2 2ch 48000Hz) > AV: 00:00:02 / 00:00:02 (98%) A-V: 0.000 > Playing: /dev/shm/seg07.mpeg > (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > (+) Audio --aid=1 (mp2 2ch 48000Hz) > AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > Playing: /dev/shm/seg08.mpeg > (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > (+) Audio --aid=1 (mp2 2ch 48000Hz) > AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > Playing: /dev/shm/seg09.mpeg > (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > (+) Audio --aid=1 (mp2 2ch 48000Hz) > AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > Playing: /dev/shm/seg10.mpeg > (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > (+) Audio --aid=1 (mp2 2ch 48000Hz) > AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > Playing: /dev/shm/seg11.mpeg > (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > (+) Audio --aid=1 (mp2 2ch 48000Hz) > AV: 00:00:00 / 00:00:01 (91%) A-V: 0.000 > Exiting... (Some errors happened) > > > I've verified that at least audio track exist, but you better to run > your own liestening test to hear if audio get desynchronized over > longer runs > > What worries me is audio. If segmented audio muxer cut it differently from video we will get desync. > > May be setting labels at specific intervals and then using "write new file at label" checkbox is better idea? > > > I simply did a test with my system's ffmpeg segment muxer: > https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-... > > Input file: hdv09_04_h264.mp4 > Duration: 00:03:58.88, start: 0.000000, bitrate: 8963 kb/s > > Tried 1 minute segment time: > > ffmpeg -hide_banner -i hdv09_04_h264.mp4 -threads 3 \ > -vcodec copy -f segment -segment_time 01:00 \ > -reset_timestamps 1 \ > cam_out_h264_%02d.mp4 > > [segment @ 0x563c2874fa80] Opening 'cam_out_h264_01.mp4' for writingeed=52.1x > [segment @ 0x563c2874fa80] Opening 'cam_out_h264_02.mp4' for writingeed=55.5x > [segment @ 0x563c2874fa80] Opening 'cam_out_h264_03.mp4' for writingeed= 57x > [out#0/segment @ 0x563c28727680] video:257421KiB audio:3749KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown > frame= 5972 fps=1445 q=-1.0 Lsize=N/A time=00:03:58.80 bitrate=N/A speed=57.8x > [aac @ 0x563c28721a40] Qavg: 454.522 > > 68M cam_out_h264_00.mp4 > 63M cam_out_h264_01.mp4 > 59M cam_out_h264_02.mp4 > 68M cam_out_h264_03.mp4 > -------- > > Duration: 00:01:00.38, start: 0.058000, bitrate: 9394 kb/s > Duration: 00:01:00.00, start: 0.000000, bitrate: 8672 kb/s > Duration: 00:01:00.60, start: 0.000000, bitrate: 8104 kb/s > Duration: 00:00:57.93, start: 0.000000, bitrate: 9705 kb/s > > In total: 00:03:58.93 which is 00:00:00.03 (=3/100 sek) more than the input file > which I think is good enough for practical purposes (editing and backup/preservation/archival) > > I wonder if it is within or out of our reach to make some targeted profiles for backup/preservation? > I.e would it be of interest and possible to utilize/integrate/use oss tools and scripts as found here: > https://avpres.net/Bash_AVpres/ > https://avpres.net/FFmpeg/im_FFV1.html > > Up to interested party, I guess. > > > The programs dvgrab and possibly the newer vrecord can also autosplit by scenes > https://linux.die.net/man/1/dvgrab > https://github.com/amiaopensource/vrecord > https://github.com/mipops/dvrescue > > Yes, I was thinking about this, but unfortunately without any testable idea. Sorry. > > -- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
вт, 10 июн. 2025 г., 20:13 Phyllis Smith <[email protected]>:
I haven't had a chance to analyze it yet but I already fixed the comment. It reads:
Ah, hit the same problem just replace auto-filled seg extension in filename with mpg! segment mpeg2video
segment_format=mpegts # Change the segment time in the next line as needed segment_time=00:10 reset_timestamps=1 cin_pix_fmt=yuv422p b=35M dc=10 muxrate=38M minrate=35M maxrate=35M bufsize=38M
bf=2
profile=high refs=1
On Tue, Jun 10, 2025 at 9:48 AM Andrew Randrianasulu < [email protected]> wrote:
вт, 10 июн. 2025 г., 18:43 Phyllis Smith <[email protected]>:
Although the patch 0001-Fixup-seg-name-to-segment-so-format-gui-button-work.patch works at our current version of ffmpeg 7.0 as does the audio render format "bluray_lpcm.seg" with the first line of "segment_format=mpegts", the corresponding video render format "mpeg2hd422p.seg" does not -- at least it fails for me. Its error message is:
FFMPEG::encode_activate: write header failed /tmp/ccc.seg
err: Muxer not found
I will see what I may have done wrong.
if it literally reads
segment mpeg2video segment_format=mpegts segment_time=00:10 <= your segment time reset_timestamps=1 cin_pix_fmt=yuv422p
then "your segment time" was comment not meant to put in there in this form, just reminder for human reader .... may be it choke on this?
On Mon, Jun 9, 2025 at 10:39 AM Andrew Randrianasulu < [email protected]> wrote:
пн, 9 июн. 2025 г., 19:32 Phyllis Smith <[email protected]>:
Andrew, I have been contemplating this since you brought it up again with Terje. Should it be checked into GIT after Terje checks it?
if it works ....
May be with # comment line saying for different seg duration change value here and in corresponding audio file.
On Sun, Jun 1, 2025 at 1:06 AM Andrew Randrianasulu via Cin < [email protected]> wrote:
with this patch (git am variety) I can set segment_time in gui, but for short test video actual cut time was dominated by same set of six keyframes, in my case.
On Sun, Jun 1, 2025 at 4:56 AM Andrew Randrianasulu <[email protected]> wrote: > > > > вс, 1 июн. 2025 г., 00:03 Terje J. Hanssen <[email protected] >: >> >> >> >> On 31.05.2025 05:33, Andrew Randrianasulu wrote: >> >> On Fri, May 30, 2025 at 4:27 PM Andrew Randrianasulu >> <[email protected]> wrote: >> >> пт, 30 мая 2025 г., 15:55 Terje J. Hanssen < [email protected]>: >> >> Den 30.05.2025 00:15, skrev Andrew Randrianasulu: >> >> >> >> пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu < [email protected]>: >> >> чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin < [email protected]>: >> >> 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-... >> >> 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 > > > > You need to set bitrate explicitly for this profile, I think? > > in GUI or just add b=16M or what you like. > > Right now for longer segments you need to modify both profiles manually and set segment_time to value you want in both audio and video *.seg profiles > > If it works I think I know where in cingg code I should put override so our gui for format (muxer) options will work (right now it stumbles on difference between seg and segment ) > >> >> root@slax:~# mpv /dev/shm/se*.mpeg >> Playing: /dev/shm/seg%02d.mpeg >> Failed to recognize file format. >> Playing: /dev/shm/seg00.mpeg >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> AO: [pulse] 48000Hz stereo 2ch s16 >> VO: [gpu] 720x576 => 768x576 yuv420p >> AV: 00:00:02 / 00:00:02 (97%) A-V: 0.000 >> Playing: /dev/shm/seg01.mpeg >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> Playing: /dev/shm/seg02.mpeg >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> Playing: /dev/shm/seg03.mpeg >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> Playing: /dev/shm/seg04.mpeg >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> Playing: /dev/shm/seg05.mpeg >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> Playing: /dev/shm/seg06.mpeg >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> AV: 00:00:02 / 00:00:02 (98%) A-V: 0.000 >> Playing: /dev/shm/seg07.mpeg >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> Playing: /dev/shm/seg08.mpeg >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> Playing: /dev/shm/seg09.mpeg >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> Playing: /dev/shm/seg10.mpeg >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> Playing: /dev/shm/seg11.mpeg >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> AV: 00:00:00 / 00:00:01 (91%) A-V: 0.000 >> Exiting... (Some errors happened) >> >> >> I've verified that at least audio track exist, but you better to run >> your own liestening test to hear if audio get desynchronized over >> longer runs >> >> What worries me is audio. If segmented audio muxer cut it differently from video we will get desync. >> >> May be setting labels at specific intervals and then using "write new file at label" checkbox is better idea? >> >> >> I simply did a test with my system's ffmpeg segment muxer: >> https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-... >> >> Input file: hdv09_04_h264.mp4 >> Duration: 00:03:58.88, start: 0.000000, bitrate: 8963 kb/s >> >> Tried 1 minute segment time: >> >> ffmpeg -hide_banner -i hdv09_04_h264.mp4 -threads 3 \ >> -vcodec copy -f segment -segment_time 01:00 \ >> -reset_timestamps 1 \ >> cam_out_h264_%02d.mp4 >> >> [segment @ 0x563c2874fa80] Opening 'cam_out_h264_01.mp4' for writingeed=52.1x >> [segment @ 0x563c2874fa80] Opening 'cam_out_h264_02.mp4' for writingeed=55.5x >> [segment @ 0x563c2874fa80] Opening 'cam_out_h264_03.mp4' for writingeed= 57x >> [out#0/segment @ 0x563c28727680] video:257421KiB audio:3749KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown >> frame= 5972 fps=1445 q=-1.0 Lsize=N/A time=00:03:58.80 bitrate=N/A speed=57.8x >> [aac @ 0x563c28721a40] Qavg: 454.522 >> >> 68M cam_out_h264_00.mp4 >> 63M cam_out_h264_01.mp4 >> 59M cam_out_h264_02.mp4 >> 68M cam_out_h264_03.mp4 >> -------- >> >> Duration: 00:01:00.38, start: 0.058000, bitrate: 9394 kb/s >> Duration: 00:01:00.00, start: 0.000000, bitrate: 8672 kb/s >> Duration: 00:01:00.60, start: 0.000000, bitrate: 8104 kb/s >> Duration: 00:00:57.93, start: 0.000000, bitrate: 9705 kb/s >> >> In total: 00:03:58.93 which is 00:00:00.03 (=3/100 sek) more than the input file >> which I think is good enough for practical purposes (editing and backup/preservation/archival) >> >> I wonder if it is within or out of our reach to make some targeted profiles for backup/preservation? >> I.e would it be of interest and possible to utilize/integrate/use oss tools and scripts as found here: >> https://avpres.net/Bash_AVpres/ >> https://avpres.net/FFmpeg/im_FFV1.html >> >> Up to interested party, I guess. >> >> >> The programs dvgrab and possibly the newer vrecord can also autosplit by scenes >> https://linux.die.net/man/1/dvgrab >> https://github.com/amiaopensource/vrecord >> https://github.com/mipops/dvrescue >> >> Yes, I was thinking about this, but unfortunately without any testable idea. Sorry. >> >> -- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Andrew, that does get rid of the "muxer" error but still a problem and getting error message:
FFMPEG::encode_activate: write header failed /tmp/ccc.mpg err: Invalid argument
So commented out all but first 2 lines and still error. Going to try something else next! I did a full build just in case tool On Tue, Jun 10, 2025 at 12:35 PM Andrew Randrianasulu < [email protected]> wrote:
вт, 10 июн. 2025 г., 20:13 Phyllis Smith <[email protected]>:
I haven't had a chance to analyze it yet but I already fixed the comment. It reads:
Ah, hit the same problem
just replace auto-filled seg extension in filename with mpg!
segment mpeg2video
segment_format=mpegts # Change the segment time in the next line as needed segment_time=00:10 reset_timestamps=1 cin_pix_fmt=yuv422p b=35M dc=10 muxrate=38M minrate=35M maxrate=35M bufsize=38M
bf=2
profile=high refs=1
On Tue, Jun 10, 2025 at 9:48 AM Andrew Randrianasulu < [email protected]> wrote:
вт, 10 июн. 2025 г., 18:43 Phyllis Smith <[email protected]>:
Although the patch 0001-Fixup-seg-name-to-segment-so-format-gui-button-work.patch works at our current version of ffmpeg 7.0 as does the audio render format "bluray_lpcm.seg" with the first line of "segment_format=mpegts", the corresponding video render format "mpeg2hd422p.seg" does not -- at least it fails for me. Its error message is:
FFMPEG::encode_activate: write header failed /tmp/ccc.seg
err: Muxer not found
I will see what I may have done wrong.
if it literally reads
segment mpeg2video segment_format=mpegts segment_time=00:10 <= your segment time reset_timestamps=1 cin_pix_fmt=yuv422p
then "your segment time" was comment not meant to put in there in this form, just reminder for human reader .... may be it choke on this?
On Mon, Jun 9, 2025 at 10:39 AM Andrew Randrianasulu < [email protected]> wrote:
пн, 9 июн. 2025 г., 19:32 Phyllis Smith <[email protected]>:
Andrew, I have been contemplating this since you brought it up again with Terje. Should it be checked into GIT after Terje checks it?
if it works ....
May be with # comment line saying for different seg duration change value here and in corresponding audio file.
On Sun, Jun 1, 2025 at 1:06 AM Andrew Randrianasulu via Cin < [email protected]> wrote:
> with this patch (git am variety) I can set segment_time in gui, but > for short test video actual cut time was > dominated by same set of six keyframes, in my case. > > On Sun, Jun 1, 2025 at 4:56 AM Andrew Randrianasulu > <[email protected]> wrote: > > > > > > > > вс, 1 июн. 2025 г., 00:03 Terje J. Hanssen < > [email protected]>: > >> > >> > >> > >> On 31.05.2025 05:33, Andrew Randrianasulu wrote: > >> > >> On Fri, May 30, 2025 at 4:27 PM Andrew Randrianasulu > >> <[email protected]> wrote: > >> > >> пт, 30 мая 2025 г., 15:55 Terje J. Hanssen < > [email protected]>: > >> > >> Den 30.05.2025 00:15, skrev Andrew Randrianasulu: > >> > >> > >> > >> пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu < > [email protected]>: > >> > >> чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin < > [email protected]>: > >> > >> 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-... > >> > >> 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 > > > > > > > > You need to set bitrate explicitly for this profile, I think? > > > > in GUI or just add b=16M or what you like. > > > > Right now for longer segments you need to modify both profiles > manually and set segment_time to value you want in both audio and video > *.seg profiles > > > > If it works I think I know where in cingg code I should put > override so our gui for format (muxer) options will work (right now it > stumbles on difference between seg and segment ) > > > >> > >> root@slax:~# mpv /dev/shm/se*.mpeg > >> Playing: /dev/shm/seg%02d.mpeg > >> Failed to recognize file format. > >> Playing: /dev/shm/seg00.mpeg > >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > >> (+) Audio --aid=1 (mp2 2ch 48000Hz) > >> AO: [pulse] 48000Hz stereo 2ch s16 > >> VO: [gpu] 720x576 => 768x576 yuv420p > >> AV: 00:00:02 / 00:00:02 (97%) A-V: 0.000 > >> Playing: /dev/shm/seg01.mpeg > >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > >> (+) Audio --aid=1 (mp2 2ch 48000Hz) > >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > >> Playing: /dev/shm/seg02.mpeg > >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > >> (+) Audio --aid=1 (mp2 2ch 48000Hz) > >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > >> Playing: /dev/shm/seg03.mpeg > >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > >> (+) Audio --aid=1 (mp2 2ch 48000Hz) > >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > >> Playing: /dev/shm/seg04.mpeg > >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > >> (+) Audio --aid=1 (mp2 2ch 48000Hz) > >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > >> Playing: /dev/shm/seg05.mpeg > >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > >> (+) Audio --aid=1 (mp2 2ch 48000Hz) > >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > >> Playing: /dev/shm/seg06.mpeg > >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > >> (+) Audio --aid=1 (mp2 2ch 48000Hz) > >> AV: 00:00:02 / 00:00:02 (98%) A-V: 0.000 > >> Playing: /dev/shm/seg07.mpeg > >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > >> (+) Audio --aid=1 (mp2 2ch 48000Hz) > >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > >> Playing: /dev/shm/seg08.mpeg > >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > >> (+) Audio --aid=1 (mp2 2ch 48000Hz) > >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > >> Playing: /dev/shm/seg09.mpeg > >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > >> (+) Audio --aid=1 (mp2 2ch 48000Hz) > >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > >> Playing: /dev/shm/seg10.mpeg > >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > >> (+) Audio --aid=1 (mp2 2ch 48000Hz) > >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 > >> Playing: /dev/shm/seg11.mpeg > >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) > >> (+) Audio --aid=1 (mp2 2ch 48000Hz) > >> AV: 00:00:00 / 00:00:01 (91%) A-V: 0.000 > >> Exiting... (Some errors happened) > >> > >> > >> I've verified that at least audio track exist, but you better to > run > >> your own liestening test to hear if audio get desynchronized over > >> longer runs > >> > >> What worries me is audio. If segmented audio muxer cut it > differently from video we will get desync. > >> > >> May be setting labels at specific intervals and then using "write > new file at label" checkbox is better idea? > >> > >> > >> I simply did a test with my system's ffmpeg segment muxer: > >> > https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-... > >> > >> Input file: hdv09_04_h264.mp4 > >> Duration: 00:03:58.88, start: 0.000000, bitrate: 8963 kb/s > >> > >> Tried 1 minute segment time: > >> > >> ffmpeg -hide_banner -i hdv09_04_h264.mp4 -threads 3 \ > >> -vcodec copy -f segment -segment_time 01:00 \ > >> -reset_timestamps 1 \ > >> cam_out_h264_%02d.mp4 > >> > >> [segment @ 0x563c2874fa80] Opening 'cam_out_h264_01.mp4' for > writingeed=52.1x > >> [segment @ 0x563c2874fa80] Opening 'cam_out_h264_02.mp4' for > writingeed=55.5x > >> [segment @ 0x563c2874fa80] Opening 'cam_out_h264_03.mp4' for > writingeed= 57x > >> [out#0/segment @ 0x563c28727680] video:257421KiB audio:3749KiB > subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: > unknown > >> frame= 5972 fps=1445 q=-1.0 Lsize=N/A time=00:03:58.80 > bitrate=N/A speed=57.8x > >> [aac @ 0x563c28721a40] Qavg: 454.522 > >> > >> 68M cam_out_h264_00.mp4 > >> 63M cam_out_h264_01.mp4 > >> 59M cam_out_h264_02.mp4 > >> 68M cam_out_h264_03.mp4 > >> -------- > >> > >> Duration: 00:01:00.38, start: 0.058000, bitrate: 9394 kb/s > >> Duration: 00:01:00.00, start: 0.000000, bitrate: 8672 kb/s > >> Duration: 00:01:00.60, start: 0.000000, bitrate: 8104 kb/s > >> Duration: 00:00:57.93, start: 0.000000, bitrate: 9705 kb/s > >> > >> In total: 00:03:58.93 which is 00:00:00.03 (=3/100 sek) more > than the input file > >> which I think is good enough for practical purposes (editing and > backup/preservation/archival) > >> > >> I wonder if it is within or out of our reach to make some > targeted profiles for backup/preservation? > >> I.e would it be of interest and possible to utilize/integrate/use > oss tools and scripts as found here: > >> https://avpres.net/Bash_AVpres/ > >> https://avpres.net/FFmpeg/im_FFV1.html > >> > >> Up to interested party, I guess. > >> > >> > >> The programs dvgrab and possibly the newer vrecord can also > autosplit by scenes > >> https://linux.die.net/man/1/dvgrab > >> https://github.com/amiaopensource/vrecord > >> https://github.com/mipops/dvrescue > >> > >> Yes, I was thinking about this, but unfortunately without any > testable idea. Sorry. > >> > >> > -- > Cin mailing list > [email protected] > https://lists.cinelerra-gg.org/mailman/listinfo/cin >
With the patch (and even using extension of mpeg instead of seg), I simply have not been able to get this to work. So either I keep doing something wrong or it does. Patch to fileffmpeg.C is: 0001-Fixup-seg-name-to-segment-so-format-gui-button-work.patch . And the 2 presets are bluray_lpcm.seg and mpeg2hd422p.seg On Tue, Jun 10, 2025 at 1:52 PM Phyllis Smith <[email protected]> wrote:
Andrew, that does get rid of the "muxer" error but still a problem and getting error message:
FFMPEG::encode_activate: write header failed /tmp/ccc.mpg err: Invalid argument
So commented out all but first 2 lines and still error. Going to try something else next! I did a full build just in case tool
On Tue, Jun 10, 2025 at 12:35 PM Andrew Randrianasulu < [email protected]> wrote:
вт, 10 июн. 2025 г., 20:13 Phyllis Smith <[email protected]>:
I haven't had a chance to analyze it yet but I already fixed the comment. It reads:
Ah, hit the same problem
just replace auto-filled seg extension in filename with mpg!
segment mpeg2video
segment_format=mpegts # Change the segment time in the next line as needed segment_time=00:10 reset_timestamps=1 cin_pix_fmt=yuv422p b=35M dc=10 muxrate=38M minrate=35M maxrate=35M bufsize=38M
bf=2
profile=high refs=1
On Tue, Jun 10, 2025 at 9:48 AM Andrew Randrianasulu < [email protected]> wrote:
вт, 10 июн. 2025 г., 18:43 Phyllis Smith <[email protected]>:
Although the patch 0001-Fixup-seg-name-to-segment-so-format-gui-button-work.patch works at our current version of ffmpeg 7.0 as does the audio render format "bluray_lpcm.seg" with the first line of "segment_format=mpegts", the corresponding video render format "mpeg2hd422p.seg" does not -- at least it fails for me. Its error message is:
FFMPEG::encode_activate: write header failed /tmp/ccc.seg
err: Muxer not found
I will see what I may have done wrong.
if it literally reads
segment mpeg2video segment_format=mpegts segment_time=00:10 <= your segment time reset_timestamps=1 cin_pix_fmt=yuv422p
then "your segment time" was comment not meant to put in there in this form, just reminder for human reader .... may be it choke on this?
On Mon, Jun 9, 2025 at 10:39 AM Andrew Randrianasulu < [email protected]> wrote:
пн, 9 июн. 2025 г., 19:32 Phyllis Smith <[email protected]>:
> Andrew, I have been contemplating this since you brought it up again > with Terje. Should it be checked into GIT after Terje checks it? >
if it works ....
May be with # comment line saying for different seg duration change value here and in corresponding audio file.
> On Sun, Jun 1, 2025 at 1:06 AM Andrew Randrianasulu via Cin < > [email protected]> wrote: > >> with this patch (git am variety) I can set segment_time in gui, but >> for short test video actual cut time was >> dominated by same set of six keyframes, in my case. >> >> On Sun, Jun 1, 2025 at 4:56 AM Andrew Randrianasulu >> <[email protected]> wrote: >> > >> > >> > >> > вс, 1 июн. 2025 г., 00:03 Terje J. Hanssen < >> [email protected]>: >> >> >> >> >> >> >> >> On 31.05.2025 05:33, Andrew Randrianasulu wrote: >> >> >> >> On Fri, May 30, 2025 at 4:27 PM Andrew Randrianasulu >> >> <[email protected]> wrote: >> >> >> >> пт, 30 мая 2025 г., 15:55 Terje J. Hanssen < >> [email protected]>: >> >> >> >> Den 30.05.2025 00:15, skrev Andrew Randrianasulu: >> >> >> >> >> >> >> >> пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu < >> [email protected]>: >> >> >> >> чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin < >> [email protected]>: >> >> >> >> 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-... >> >> >> >> 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 >> > >> > >> > >> > You need to set bitrate explicitly for this profile, I think? >> > >> > in GUI or just add b=16M or what you like. >> > >> > Right now for longer segments you need to modify both profiles >> manually and set segment_time to value you want in both audio and video >> *.seg profiles >> > >> > If it works I think I know where in cingg code I should put >> override so our gui for format (muxer) options will work (right now it >> stumbles on difference between seg and segment ) >> > >> >> >> >> root@slax:~# mpv /dev/shm/se*.mpeg >> >> Playing: /dev/shm/seg%02d.mpeg >> >> Failed to recognize file format. >> >> Playing: /dev/shm/seg00.mpeg >> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> >> AO: [pulse] 48000Hz stereo 2ch s16 >> >> VO: [gpu] 720x576 => 768x576 yuv420p >> >> AV: 00:00:02 / 00:00:02 (97%) A-V: 0.000 >> >> Playing: /dev/shm/seg01.mpeg >> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> >> Playing: /dev/shm/seg02.mpeg >> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> >> Playing: /dev/shm/seg03.mpeg >> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> >> Playing: /dev/shm/seg04.mpeg >> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> >> Playing: /dev/shm/seg05.mpeg >> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> >> Playing: /dev/shm/seg06.mpeg >> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> >> AV: 00:00:02 / 00:00:02 (98%) A-V: 0.000 >> >> Playing: /dev/shm/seg07.mpeg >> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> >> Playing: /dev/shm/seg08.mpeg >> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> >> Playing: /dev/shm/seg09.mpeg >> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> >> Playing: /dev/shm/seg10.mpeg >> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >> >> Playing: /dev/shm/seg11.mpeg >> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >> >> AV: 00:00:00 / 00:00:01 (91%) A-V: 0.000 >> >> Exiting... (Some errors happened) >> >> >> >> >> >> I've verified that at least audio track exist, but you better to >> run >> >> your own liestening test to hear if audio get desynchronized over >> >> longer runs >> >> >> >> What worries me is audio. If segmented audio muxer cut it >> differently from video we will get desync. >> >> >> >> May be setting labels at specific intervals and then using >> "write new file at label" checkbox is better idea? >> >> >> >> >> >> I simply did a test with my system's ffmpeg segment muxer: >> >> >> https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-... >> >> >> >> Input file: hdv09_04_h264.mp4 >> >> Duration: 00:03:58.88, start: 0.000000, bitrate: 8963 kb/s >> >> >> >> Tried 1 minute segment time: >> >> >> >> ffmpeg -hide_banner -i hdv09_04_h264.mp4 -threads 3 \ >> >> -vcodec copy -f segment -segment_time 01:00 \ >> >> -reset_timestamps 1 \ >> >> cam_out_h264_%02d.mp4 >> >> >> >> [segment @ 0x563c2874fa80] Opening 'cam_out_h264_01.mp4' for >> writingeed=52.1x >> >> [segment @ 0x563c2874fa80] Opening 'cam_out_h264_02.mp4' for >> writingeed=55.5x >> >> [segment @ 0x563c2874fa80] Opening 'cam_out_h264_03.mp4' for >> writingeed= 57x >> >> [out#0/segment @ 0x563c28727680] video:257421KiB audio:3749KiB >> subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: >> unknown >> >> frame= 5972 fps=1445 q=-1.0 Lsize=N/A time=00:03:58.80 >> bitrate=N/A speed=57.8x >> >> [aac @ 0x563c28721a40] Qavg: 454.522 >> >> >> >> 68M cam_out_h264_00.mp4 >> >> 63M cam_out_h264_01.mp4 >> >> 59M cam_out_h264_02.mp4 >> >> 68M cam_out_h264_03.mp4 >> >> -------- >> >> >> >> Duration: 00:01:00.38, start: 0.058000, bitrate: 9394 kb/s >> >> Duration: 00:01:00.00, start: 0.000000, bitrate: 8672 kb/s >> >> Duration: 00:01:00.60, start: 0.000000, bitrate: 8104 kb/s >> >> Duration: 00:00:57.93, start: 0.000000, bitrate: 9705 kb/s >> >> >> >> In total: 00:03:58.93 which is 00:00:00.03 (=3/100 sek) >> more than the input file >> >> which I think is good enough for practical purposes (editing and >> backup/preservation/archival) >> >> >> >> I wonder if it is within or out of our reach to make some >> targeted profiles for backup/preservation? >> >> I.e would it be of interest and possible to >> utilize/integrate/use oss tools and scripts as found here: >> >> https://avpres.net/Bash_AVpres/ >> >> https://avpres.net/FFmpeg/im_FFV1.html >> >> >> >> Up to interested party, I guess. >> >> >> >> >> >> The programs dvgrab and possibly the newer vrecord can also >> autosplit by scenes >> >> https://linux.die.net/man/1/dvgrab >> >> https://github.com/amiaopensource/vrecord >> >> https://github.com/mipops/dvrescue >> >> >> >> Yes, I was thinking about this, but unfortunately without any >> testable idea. Sorry. >> >> >> >> >> -- >> Cin mailing list >> [email protected] >> https://lists.cinelerra-gg.org/mailman/listinfo/cin >> >
пт, 13 июн. 2025 г., 22:23 Phyllis Smith <[email protected]>:
With the patch (and even using extension of mpeg instead of seg), I simply have not been able to get this to work. So either I keep doing something wrong or it does. Patch to fileffmpeg.C is: 0001-Fixup-seg-name-to-segment-so-format-gui-button-work.patch . And the 2 presets are bluray_lpcm.seg and mpeg2hd422p.seg
Try extension mpg, not mpeg and be sure you have %d0 symbols in your filename? Note, this file will be created as 0-sized, you need to watch/load segment files manually.
On Tue, Jun 10, 2025 at 1:52 PM Phyllis Smith <[email protected]> wrote:
Andrew, that does get rid of the "muxer" error but still a problem and getting error message:
FFMPEG::encode_activate: write header failed /tmp/ccc.mpg err: Invalid argument
So commented out all but first 2 lines and still error. Going to try something else next! I did a full build just in case tool
On Tue, Jun 10, 2025 at 12:35 PM Andrew Randrianasulu < [email protected]> wrote:
вт, 10 июн. 2025 г., 20:13 Phyllis Smith <[email protected]>:
I haven't had a chance to analyze it yet but I already fixed the comment. It reads:
Ah, hit the same problem
just replace auto-filled seg extension in filename with mpg!
segment mpeg2video
segment_format=mpegts # Change the segment time in the next line as needed segment_time=00:10 reset_timestamps=1 cin_pix_fmt=yuv422p b=35M dc=10 muxrate=38M minrate=35M maxrate=35M bufsize=38M
bf=2
profile=high refs=1
On Tue, Jun 10, 2025 at 9:48 AM Andrew Randrianasulu < [email protected]> wrote:
вт, 10 июн. 2025 г., 18:43 Phyllis Smith <[email protected]>:
Although the patch 0001-Fixup-seg-name-to-segment-so-format-gui-button-work.patch works at our current version of ffmpeg 7.0 as does the audio render format "bluray_lpcm.seg" with the first line of "segment_format=mpegts", the corresponding video render format "mpeg2hd422p.seg" does not -- at least it fails for me. Its error message is:
FFMPEG::encode_activate: write header failed /tmp/ccc.seg > err: Muxer not found >
I will see what I may have done wrong.
if it literally reads
segment mpeg2video segment_format=mpegts segment_time=00:10 <= your segment time reset_timestamps=1 cin_pix_fmt=yuv422p
then "your segment time" was comment not meant to put in there in this form, just reminder for human reader .... may be it choke on this?
On Mon, Jun 9, 2025 at 10:39 AM Andrew Randrianasulu < [email protected]> wrote:
> > > пн, 9 июн. 2025 г., 19:32 Phyllis Smith <[email protected]>: > >> Andrew, I have been contemplating this since you brought it up >> again with Terje. Should it be checked into GIT after Terje checks it? >> > > if it works .... > > May be with # comment line saying for different seg duration change > value here and in corresponding audio file. > > > >> On Sun, Jun 1, 2025 at 1:06 AM Andrew Randrianasulu via Cin < >> [email protected]> wrote: >> >>> with this patch (git am variety) I can set segment_time in gui, but >>> for short test video actual cut time was >>> dominated by same set of six keyframes, in my case. >>> >>> On Sun, Jun 1, 2025 at 4:56 AM Andrew Randrianasulu >>> <[email protected]> wrote: >>> > >>> > >>> > >>> > вс, 1 июн. 2025 г., 00:03 Terje J. Hanssen < >>> [email protected]>: >>> >> >>> >> >>> >> >>> >> On 31.05.2025 05:33, Andrew Randrianasulu wrote: >>> >> >>> >> On Fri, May 30, 2025 at 4:27 PM Andrew Randrianasulu >>> >> <[email protected]> wrote: >>> >> >>> >> пт, 30 мая 2025 г., 15:55 Terje J. Hanssen < >>> [email protected]>: >>> >> >>> >> Den 30.05.2025 00:15, skrev Andrew Randrianasulu: >>> >> >>> >> >>> >> >>> >> пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu < >>> [email protected]>: >>> >> >>> >> чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin < >>> [email protected]>: >>> >> >>> >> 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-... >>> >> >>> >> 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 >>> > >>> > >>> > >>> > You need to set bitrate explicitly for this profile, I think? >>> > >>> > in GUI or just add b=16M or what you like. >>> > >>> > Right now for longer segments you need to modify both profiles >>> manually and set segment_time to value you want in both audio and video >>> *.seg profiles >>> > >>> > If it works I think I know where in cingg code I should put >>> override so our gui for format (muxer) options will work (right now it >>> stumbles on difference between seg and segment ) >>> > >>> >> >>> >> root@slax:~# mpv /dev/shm/se*.mpeg >>> >> Playing: /dev/shm/seg%02d.mpeg >>> >> Failed to recognize file format. >>> >> Playing: /dev/shm/seg00.mpeg >>> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >>> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >>> >> AO: [pulse] 48000Hz stereo 2ch s16 >>> >> VO: [gpu] 720x576 => 768x576 yuv420p >>> >> AV: 00:00:02 / 00:00:02 (97%) A-V: 0.000 >>> >> Playing: /dev/shm/seg01.mpeg >>> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >>> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >>> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >>> >> Playing: /dev/shm/seg02.mpeg >>> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >>> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >>> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >>> >> Playing: /dev/shm/seg03.mpeg >>> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >>> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >>> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >>> >> Playing: /dev/shm/seg04.mpeg >>> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >>> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >>> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >>> >> Playing: /dev/shm/seg05.mpeg >>> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >>> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >>> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >>> >> Playing: /dev/shm/seg06.mpeg >>> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >>> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >>> >> AV: 00:00:02 / 00:00:02 (98%) A-V: 0.000 >>> >> Playing: /dev/shm/seg07.mpeg >>> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >>> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >>> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >>> >> Playing: /dev/shm/seg08.mpeg >>> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >>> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >>> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >>> >> Playing: /dev/shm/seg09.mpeg >>> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >>> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >>> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >>> >> Playing: /dev/shm/seg10.mpeg >>> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >>> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >>> >> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000 >>> >> Playing: /dev/shm/seg11.mpeg >>> >> (+) Video --vid=1 (mpeg2video 720x576 25.000fps) >>> >> (+) Audio --aid=1 (mp2 2ch 48000Hz) >>> >> AV: 00:00:00 / 00:00:01 (91%) A-V: 0.000 >>> >> Exiting... (Some errors happened) >>> >> >>> >> >>> >> I've verified that at least audio track exist, but you better >>> to run >>> >> your own liestening test to hear if audio get desynchronized >>> over >>> >> longer runs >>> >> >>> >> What worries me is audio. If segmented audio muxer cut it >>> differently from video we will get desync. >>> >> >>> >> May be setting labels at specific intervals and then using >>> "write new file at label" checkbox is better idea? >>> >> >>> >> >>> >> I simply did a test with my system's ffmpeg segment muxer: >>> >> >>> https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-... >>> >> >>> >> Input file: hdv09_04_h264.mp4 >>> >> Duration: 00:03:58.88, start: 0.000000, bitrate: 8963 kb/s >>> >> >>> >> Tried 1 minute segment time: >>> >> >>> >> ffmpeg -hide_banner -i hdv09_04_h264.mp4 -threads 3 \ >>> >> -vcodec copy -f segment -segment_time 01:00 \ >>> >> -reset_timestamps 1 \ >>> >> cam_out_h264_%02d.mp4 >>> >> >>> >> [segment @ 0x563c2874fa80] Opening 'cam_out_h264_01.mp4' for >>> writingeed=52.1x >>> >> [segment @ 0x563c2874fa80] Opening 'cam_out_h264_02.mp4' for >>> writingeed=55.5x >>> >> [segment @ 0x563c2874fa80] Opening 'cam_out_h264_03.mp4' for >>> writingeed= 57x >>> >> [out#0/segment @ 0x563c28727680] video:257421KiB audio:3749KiB >>> subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: >>> unknown >>> >> frame= 5972 fps=1445 q=-1.0 Lsize=N/A time=00:03:58.80 >>> bitrate=N/A speed=57.8x >>> >> [aac @ 0x563c28721a40] Qavg: 454.522 >>> >> >>> >> 68M cam_out_h264_00.mp4 >>> >> 63M cam_out_h264_01.mp4 >>> >> 59M cam_out_h264_02.mp4 >>> >> 68M cam_out_h264_03.mp4 >>> >> -------- >>> >> >>> >> Duration: 00:01:00.38, start: 0.058000, bitrate: 9394 kb/s >>> >> Duration: 00:01:00.00, start: 0.000000, bitrate: 8672 kb/s >>> >> Duration: 00:01:00.60, start: 0.000000, bitrate: 8104 kb/s >>> >> Duration: 00:00:57.93, start: 0.000000, bitrate: 9705 kb/s >>> >> >>> >> In total: 00:03:58.93 which is 00:00:00.03 (=3/100 sek) >>> more than the input file >>> >> which I think is good enough for practical purposes (editing >>> and backup/preservation/archival) >>> >> >>> >> I wonder if it is within or out of our reach to make some >>> targeted profiles for backup/preservation? >>> >> I.e would it be of interest and possible to >>> utilize/integrate/use oss tools and scripts as found here: >>> >> https://avpres.net/Bash_AVpres/ >>> >> https://avpres.net/FFmpeg/im_FFV1.html >>> >> >>> >> Up to interested party, I guess. >>> >> >>> >> >>> >> The programs dvgrab and possibly the newer vrecord can also >>> autosplit by scenes >>> >> https://linux.die.net/man/1/dvgrab >>> >> https://github.com/amiaopensource/vrecord >>> >> https://github.com/mipops/dvrescue >>> >> >>> >> Yes, I was thinking about this, but unfortunately without any >>> testable idea. Sorry. >>> >> >>> >> >>> -- >>> Cin mailing list >>> [email protected] >>> https://lists.cinelerra-gg.org/mailman/listinfo/cin >>> >>
Den 13.06.2025 21:38, skrev Andrew Randrianasulu:
пт, 13 июн. 2025 г., 22:23 Phyllis Smith <[email protected]>:
With the patch (and even using extension of mpeg instead of seg), I simply have not been able to get this to work. So either I keep doing something wrong or it does. Patch to fileffmpeg.C is: 0001-Fixup-seg-name-to-segment-so-format-gui-button-work.patch . And the 2 presets are bluray_lpcm.seg and mpeg2hd422p.seg
Try extension mpg, not mpeg and be sure you have
%d0 symbols in your filename?
Note, this file will be created as 0-sized, you need to watch/load segment files manually.
......................... snip
>> >> пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu <[email protected]>: >> >> чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin <[email protected]>: >> >> 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-... >> >> 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. >>
............snip I went to the start and successful adapted the ffmpeg codeline for capturing mpeg2sd422p via v4l2 to segments 'a 30 sec, total time 120 sec: ffmpeg -hide_banner -f v4l2 -video_size 720x576 -framerate 50 -i /dev/video0 -f alsa -ch_layout stereo -i hw:CARD=UHD,DEV=0 -c:v mpeg2video -vf scale=720x576 -profile:v 422p -level:v main -refs 1 -bf 2 -b:v 30M -maxrate 30M -minrate 30M -bufsize 25M -muxrate 35M -c:a pcm_s16le -t 120 -f segment -segment_time 00:30 -reset_timestamps 1 mpeg2sd422p_30M_%02d.mkv Input #0, video4linux2,v4l2, from '/dev/video0': Duration: N/A, start: 139.588942, bitrate: 331776 kb/s Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 720x576, 331776 kb/s, 50 fps, 50 tbr, 1000k tbn Input #1, alsa, from 'hw:CARD=UHD,DEV=0': Duration: N/A, start: 1750676281.517256, bitrate: 1536 kb/s Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg2video (native)) Stream #1:0 -> #0:1 (pcm_s16le (native) -> pcm_s16le (native)) Press [q] to stop, [?] for help [mpeg2video @ 0x55d2ea6dd6c0] Warning vbv_delay will be set to 0xFFFF (=VBR) as the specified vbv buffer is too large for the given bitrate! [segment @ 0x55d2ea6f1840] Opening 'mpeg2sd422p_30M_00.mkv' for writing Output #0, segment, to 'mpeg2sd422p_30M_%02d.mkv': Metadata: encoder : Lavf61.7.100 Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv, progressive), 720x576, q=2-31, 30000 kb/s, 50 fps, 1k tbn Metadata: encoder : Lavc61.19.101 mpeg2video Side data: cpb: bitrate max/min/avg: 30000000/30000000/30000000 buffer size: 25000000 vbv_delay: N/A Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s Metadata: encoder : Lavc61.19.101 pcm_s16le [segment @ 0x55d2ea6f1840] Opening 'mpeg2sd422p_30M_01.mkv' for writing.999x [segment @ 0x55d2ea6f1840] Opening 'mpeg2sd422p_30M_02.mkv' for writing 1x [segment @ 0x55d2ea6f1840] Opening 'mpeg2sd422p_30M_03.mkv' for writing 1x [out#0/segment @ 0x55d2ea6f6b00] video:438690KiB audio:22499KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown frame= 6000 fps= 50 q=2.5 Lsize=N/A time=00:01:59.98 bitrate=N/A dup=0 drop=1 speed= 1x ---------- du -sh mpeg2sd422p_30M_* 113M mpeg2sd422p_30M_00.mkv 113M mpeg2sd422p_30M_01.mkv 113M mpeg2sd422p_30M_02.mkv 114M mpeg2sd422p_30M_03.mkv ----------- ffprobe -hide_banner mpeg2sd422p_30M_02.mkv Input #0, matroska,webm, from 'mpeg2sd422p_30M_02.mkv': Metadata: ENCODER : Lavf61.7.100 Duration: 00:00:30.02, start: 0.000000, bitrate: 31548 kb/s Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv, progressive), 720x576 [SAR 1:1 DAR 5:4], 50 fps, 50 tbr, 1k tbn Metadata: ENCODER : Lavc61.19.101 mpeg2video DURATION : 00:00:30.020000000 Side data: cpb: bitrate max/min/avg: 30000000/0/0 buffer size: 25001984 vbv_delay: N/A Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s Metadata: ENCODER : Lavc61.19.101 pcm_s16le DURATION : 00:00:30.000000000 ------------ ffprobe -hide_banner mpeg2sd422p_30M_03.mkv Input #0, matroska,webm, from 'mpeg2sd422p_30M_03.mkv': Metadata: ENCODER : Lavf61.7.100 Duration: 00:00:30.06, start: 0.000000, bitrate: 31550 kb/s Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv, progressive), 720x576 [SAR 1:1 DAR 5:4], 50 fps, 50 tbr, 1k tbn Metadata: ENCODER : Lavc61.19.101 mpeg2video DURATION : 00:00:30.059000000 Side data: cpb: bitrate max/min/avg: 30000000/0/0 buffer size: 25001984 vbv_delay: N/A Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s Metadata: ENCODER : Lavc61.19.101 pcm_s16le DURATION : 00:00:30.059000000
participants (3)
-
Andrew Randrianasulu -
Phyllis Smith -
Terje J. Hanssen