<div dir="ltr"><div class="gmail_default" style="font-size:small">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:<br></div><div class="gmail_default" style="font-size:small"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_default" style="font-size:small"> FFMPEG::encode_activate: write header failed /tmp/ccc.seg<br> err: Muxer not found<br></div></blockquote><div><br></div><div style="font-size:small" class="gmail_default">I will see what I may have done wrong.<br></div><div><br></div><div style="font-size:small" class="gmail_default"><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, Jun 9, 2025 at 10:39 AM Andrew Randrianasulu <<a href="mailto:randrianasulu@gmail.com">randrianasulu@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">пн, 9 июн. 2025 г., 19:32 Phyllis Smith <<a href="mailto:phylsmith2017@gmail.com" target="_blank">phylsmith2017@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Andrew, I have been contemplating this since you brought it up again with Terje. Should it be checked into GIT after Terje checks it?<br></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">if it works ....</div><div dir="auto"><br></div><div dir="auto">May be with # comment line saying for different seg duration change value here and in corresponding audio file.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small"></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jun 1, 2025 at 1:06 AM Andrew Randrianasulu via Cin <<a href="mailto:cin@lists.cinelerra-gg.org" rel="noreferrer" target="_blank">cin@lists.cinelerra-gg.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">with this patch (git am variety) I can set segment_time in gui, but<br>
for short test video actual cut time was<br>
dominated by same set of six keyframes, in my case.<br>
<br>
On Sun, Jun 1, 2025 at 4:56 AM Andrew Randrianasulu<br>
<<a href="mailto:randrianasulu@gmail.com" rel="noreferrer" target="_blank">randrianasulu@gmail.com</a>> wrote:<br>
><br>
><br>
><br>
> вс, 1 июн. 2025 г., 00:03 Terje J. Hanssen <<a href="mailto:terjejhanssen@gmail.com" rel="noreferrer" target="_blank">terjejhanssen@gmail.com</a>>:<br>
>><br>
>><br>
>><br>
>> On 31.05.2025 05:33, Andrew Randrianasulu wrote:<br>
>><br>
>> On Fri, May 30, 2025 at 4:27 PM Andrew Randrianasulu<br>
>> <<a href="mailto:randrianasulu@gmail.com" rel="noreferrer" target="_blank">randrianasulu@gmail.com</a>> wrote:<br>
>><br>
>> пт, 30 мая 2025 г., 15:55 Terje J. Hanssen <<a href="mailto:terjejhanssen@gmail.com" rel="noreferrer" target="_blank">terjejhanssen@gmail.com</a>>:<br>
>><br>
>> Den 30.05.2025 00:15, skrev Andrew Randrianasulu:<br>
>><br>
>><br>
>><br>
>> пт, 30 мая 2025 г., 00:30 Andrew Randrianasulu <<a href="mailto:randrianasulu@gmail.com" rel="noreferrer" target="_blank">randrianasulu@gmail.com</a>>:<br>
>><br>
>> чт, 29 мая 2025 г., 23:42 Terje J. Hanssen via Cin <<a href="mailto:cin@lists.cinelerra-gg.org" rel="noreferrer" target="_blank">cin@lists.cinelerra-gg.org</a>>:<br>
>><br>
>> Is it possible with CinGG's Record utility (via FFMPEG) to record a stream to file segments of same duration or file size and use auto-naming?<br>
>><br>
>> Typical example:<br>
>> Record a video/audio input stream (i.e from playing a camcorder tape cassette) and encode to output file segments of 10 minutes or 10 GB each and auto-name file numbers.<br>
>><br>
>> Similar example code using an input file instead at<br>
>> <a href="https://unix.stackexchange.com/questions/1670/how-can-i-use-ffmpeg-to-split-mpeg-video-into-10-minute-chunks" rel="noreferrer noreferrer" target="_blank">https://unix.stackexchange.com/questions/1670/how-can-i-use-ffmpeg-to-split-mpeg-video-into-10-minute-chunks</a><br>
>><br>
>> Just use what is built into ffmpeg to do exactly this.<br>
>><br>
>> ffmpeg -i invid.mp4 -threads 3 \<br>
>> -vcodec copy -f segment -segment_time 10:00 \<br>
>> -reset_timestamps 1 \<br>
>> cam_out_h264_%02d.mp4<br>
>><br>
>> 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.<br>
>><br>
>> Very interesting question! Never tried this, did not even know it existed!<br>
>><br>
>> 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.<br>
>><br>
>> I'll try this with termux's version, but I do not have audio here so it will be incomplete.<br>
>><br>
>> so I created this file:<br>
>><br>
>> cat ffmpeg/video/mpeg2.seg<br>
>> segment mpeg2video<br>
>> segment_format=mpeg<br>
>> segment_time=00:10<br>
>> reset_timestamps=1<br>
>> trellis=2<br>
>> mbd=rd<br>
>> cmp=2<br>
>> subcmp=2<br>
>> b=4000000<br>
>><br>
>><br>
>> 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.<br>
>><br>
>> You can try to modify it back to 10:00 segment time and see how it work for longer encode?<br>
>><br>
>><br>
>> As I'm not sure if and how you applied your file above with regards to Cingg Record,<br>
>><br>
>> just put file where other video profiles live? (ffmpeg/video folder of your cingg installation)<br>
>><br>
>> Attaching test profile trying to utilize segmented muxer for mpeg<br>
>> system streams<br>
>><br>
>> Put them according to their content into<br>
>><br>
>> /usr/share/cin/ffmpeg/video and /usr/share/cin/ffmpeg/audio for<br>
>> standard rpm/deb cinelerra install<br>
>><br>
>> make sure they readable by your user (chown -R your_username:users<br>
>> /usr/share/cin/ffmpeg might fix weird issues like "bad file format")<br>
>><br>
>><br>
>> I upgraded to the latest rpm for Leap15.6<br>
>><br>
>> terje@localhost:/usr/share/cin/ffmpeg> ls -lt audio/*.seg audio/seg.* video/*.seg video/seg.*<br>
>> -rw-r--r-- 1 terje users 159 mai 31 17:49 video/mpeg2.seg<br>
>> -rw-r--r-- 1 terje users 14 mai 31 17:49 video/seg.dfl<br>
>> -rw-r--r-- 1 terje users 77 mai 31 17:47 audio/mpeg2_mp2.seg<br>
>> -rw-r--r-- 1 terje users 14 mai 31 17:47 audio/seg.dfl<br>
>><br>
>> In cingg shift-R, select seg from dropdown menu, select both audio and<br>
>> video encoding (there will be grand total of one choice in each<br>
>> category),<br>
>> then put filename like /dev/shm/file%02d.mpeg and try to render<br>
>><br>
>> It will give you files:<br>
>><br>
>><br>
>> Loaded a hdv 1080i50 file<br>
>> Very short segments, maybe just 10 sec each<br>
>><br>
>> root@slax:~# ls -la /dev/shm/seg*<br>
>> -rw-r--r-- 1 guest users 0 мая 31 06:19 /dev/shm/seg%02d.mpeg<br>
>> -rw-r--r-- 1 guest users 0 мая 31 05:57 /dev/shm/seg%02d.seg<br>
>> -rw-r--r-- 1 guest users 2375680 мая 31 06:19 /dev/shm/seg00.mpeg<br>
>> -rw-r--r-- 1 guest users 1980416 мая 31 06:19 /dev/shm/seg01.mpeg<br>
>> -rw-r--r-- 1 guest users 1947648 мая 31 06:19 /dev/shm/seg02.mpeg<br>
>> -rw-r--r-- 1 guest users 2009088 мая 31 06:19 /dev/shm/seg03.mpeg<br>
>> -rw-r--r-- 1 guest users 2170880 мая 31 06:19 /dev/shm/seg04.mpeg<br>
>> -rw-r--r-- 1 guest users 2205696 мая 31 06:19 /dev/shm/seg05.mpeg<br>
>> -rw-r--r-- 1 guest users 2535424 мая 31 06:19 /dev/shm/seg06.mpeg<br>
>> -rw-r--r-- 1 guest users 1966080 мая 31 06:19 /dev/shm/seg07.mpeg<br>
>> -rw-r--r-- 1 guest users 1945600 мая 31 06:19 /dev/shm/seg08.mpeg<br>
>> -rw-r--r-- 1 guest users 2023424 мая 31 06:19 /dev/shm/seg09.mpeg<br>
>> -rw-r--r-- 1 guest users 2101248 мая 31 06:19 /dev/shm/seg10.mpeg<br>
>> -rw-r--r-- 1 guest users 1026048 мая 31 06:19 /dev/shm/seg11.mpeg<br>
>><br>
>> Now you can play all fo them gapless with mpv:<br>
>><br>
>><br>
>> mpv worked best for audio, though blocking pixels in the video<br>
>> vlc got dropouts in audio also within a segment<br>
>><br>
>> Tried similar with Shift-P: 1920x1080, 50fps, yuv422 and mpeg2_hq profile changed to 50Mbps bitrate, then r (record from v4l2 /dev/video0 (ms2130)<br>
>> Got short segments, yuv422 at low bitrate<br>
><br>
><br>
><br>
> You need to set bitrate explicitly for this profile, I think?<br>
><br>
> in GUI or just add b=16M or what you like.<br>
><br>
> 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<br>
><br>
> 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 )<br>
><br>
>><br>
>> root@slax:~# mpv /dev/shm/se*.mpeg<br>
>> Playing: /dev/shm/seg%02d.mpeg<br>
>> Failed to recognize file format.<br>
>> Playing: /dev/shm/seg00.mpeg<br>
>> (+) Video --vid=1 (mpeg2video 720x576 25.000fps)<br>
>> (+) Audio --aid=1 (mp2 2ch 48000Hz)<br>
>> AO: [pulse] 48000Hz stereo 2ch s16<br>
>> VO: [gpu] 720x576 => 768x576 yuv420p<br>
>> AV: 00:00:02 / 00:00:02 (97%) A-V: 0.000<br>
>> Playing: /dev/shm/seg01.mpeg<br>
>> (+) Video --vid=1 (mpeg2video 720x576 25.000fps)<br>
>> (+) Audio --aid=1 (mp2 2ch 48000Hz)<br>
>> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000<br>
>> Playing: /dev/shm/seg02.mpeg<br>
>> (+) Video --vid=1 (mpeg2video 720x576 25.000fps)<br>
>> (+) Audio --aid=1 (mp2 2ch 48000Hz)<br>
>> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000<br>
>> Playing: /dev/shm/seg03.mpeg<br>
>> (+) Video --vid=1 (mpeg2video 720x576 25.000fps)<br>
>> (+) Audio --aid=1 (mp2 2ch 48000Hz)<br>
>> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000<br>
>> Playing: /dev/shm/seg04.mpeg<br>
>> (+) Video --vid=1 (mpeg2video 720x576 25.000fps)<br>
>> (+) Audio --aid=1 (mp2 2ch 48000Hz)<br>
>> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000<br>
>> Playing: /dev/shm/seg05.mpeg<br>
>> (+) Video --vid=1 (mpeg2video 720x576 25.000fps)<br>
>> (+) Audio --aid=1 (mp2 2ch 48000Hz)<br>
>> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000<br>
>> Playing: /dev/shm/seg06.mpeg<br>
>> (+) Video --vid=1 (mpeg2video 720x576 25.000fps)<br>
>> (+) Audio --aid=1 (mp2 2ch 48000Hz)<br>
>> AV: 00:00:02 / 00:00:02 (98%) A-V: 0.000<br>
>> Playing: /dev/shm/seg07.mpeg<br>
>> (+) Video --vid=1 (mpeg2video 720x576 25.000fps)<br>
>> (+) Audio --aid=1 (mp2 2ch 48000Hz)<br>
>> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000<br>
>> Playing: /dev/shm/seg08.mpeg<br>
>> (+) Video --vid=1 (mpeg2video 720x576 25.000fps)<br>
>> (+) Audio --aid=1 (mp2 2ch 48000Hz)<br>
>> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000<br>
>> Playing: /dev/shm/seg09.mpeg<br>
>> (+) Video --vid=1 (mpeg2video 720x576 25.000fps)<br>
>> (+) Audio --aid=1 (mp2 2ch 48000Hz)<br>
>> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000<br>
>> Playing: /dev/shm/seg10.mpeg<br>
>> (+) Video --vid=1 (mpeg2video 720x576 25.000fps)<br>
>> (+) Audio --aid=1 (mp2 2ch 48000Hz)<br>
>> AV: 00:00:01 / 00:00:01 (98%) A-V: 0.000<br>
>> Playing: /dev/shm/seg11.mpeg<br>
>> (+) Video --vid=1 (mpeg2video 720x576 25.000fps)<br>
>> (+) Audio --aid=1 (mp2 2ch 48000Hz)<br>
>> AV: 00:00:00 / 00:00:01 (91%) A-V: 0.000<br>
>> Exiting... (Some errors happened)<br>
>><br>
>><br>
>> I've verified that at least audio track exist, but you better to run<br>
>> your own liestening test to hear if audio get desynchronized over<br>
>> longer runs<br>
>><br>
>> What worries me is audio. If segmented audio muxer cut it differently from video we will get desync.<br>
>><br>
>> May be setting labels at specific intervals and then using "write new file at label" checkbox is better idea?<br>
>><br>
>><br>
>> I simply did a test with my system's ffmpeg segment muxer:<br>
>> <a href="https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-ssegment" rel="noreferrer noreferrer" target="_blank">https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-ssegment</a><br>
>><br>
>> Input file: hdv09_04_h264.mp4<br>
>> Duration: 00:03:58.88, start: 0.000000, bitrate: 8963 kb/s<br>
>><br>
>> Tried 1 minute segment time:<br>
>><br>
>> ffmpeg -hide_banner -i hdv09_04_h264.mp4 -threads 3 \<br>
>> -vcodec copy -f segment -segment_time 01:00 \<br>
>> -reset_timestamps 1 \<br>
>> cam_out_h264_%02d.mp4<br>
>><br>
>> [segment @ 0x563c2874fa80] Opening 'cam_out_h264_01.mp4' for writingeed=52.1x<br>
>> [segment @ 0x563c2874fa80] Opening 'cam_out_h264_02.mp4' for writingeed=55.5x<br>
>> [segment @ 0x563c2874fa80] Opening 'cam_out_h264_03.mp4' for writingeed= 57x<br>
>> [out#0/segment @ 0x563c28727680] video:257421KiB audio:3749KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown<br>
>> frame= 5972 fps=1445 q=-1.0 Lsize=N/A time=00:03:58.80 bitrate=N/A speed=57.8x<br>
>> [aac @ 0x563c28721a40] Qavg: 454.522<br>
>><br>
>> 68M cam_out_h264_00.mp4<br>
>> 63M cam_out_h264_01.mp4<br>
>> 59M cam_out_h264_02.mp4<br>
>> 68M cam_out_h264_03.mp4<br>
>> --------<br>
>><br>
>> Duration: 00:01:00.38, start: 0.058000, bitrate: 9394 kb/s<br>
>> Duration: 00:01:00.00, start: 0.000000, bitrate: 8672 kb/s<br>
>> Duration: 00:01:00.60, start: 0.000000, bitrate: 8104 kb/s<br>
>> Duration: 00:00:57.93, start: 0.000000, bitrate: 9705 kb/s<br>
>><br>
>> In total: 00:03:58.93 which is 00:00:00.03 (=3/100 sek) more than the input file<br>
>> which I think is good enough for practical purposes (editing and backup/preservation/archival)<br>
>><br>
>> I wonder if it is within or out of our reach to make some targeted profiles for backup/preservation?<br>
>> I.e would it be of interest and possible to utilize/integrate/use oss tools and scripts as found here:<br>
>> <a href="https://avpres.net/Bash_AVpres/" rel="noreferrer noreferrer" target="_blank">https://avpres.net/Bash_AVpres/</a><br>
>> <a href="https://avpres.net/FFmpeg/im_FFV1.html" rel="noreferrer noreferrer" target="_blank">https://avpres.net/FFmpeg/im_FFV1.html</a><br>
>><br>
>> Up to interested party, I guess.<br>
>><br>
>><br>
>> The programs dvgrab and possibly the newer vrecord can also autosplit by scenes<br>
>> <a href="https://linux.die.net/man/1/dvgrab" rel="noreferrer noreferrer" target="_blank">https://linux.die.net/man/1/dvgrab</a><br>
>> <a href="https://github.com/amiaopensource/vrecord" rel="noreferrer noreferrer" target="_blank">https://github.com/amiaopensource/vrecord</a><br>
>> <a href="https://github.com/mipops/dvrescue" rel="noreferrer noreferrer" target="_blank">https://github.com/mipops/dvrescue</a><br>
>><br>
>> Yes, I was thinking about this, but unfortunately without any testable idea. Sorry.<br>
>><br>
>><br>
-- <br>
Cin mailing list<br>
<a href="mailto:Cin@lists.cinelerra-gg.org" rel="noreferrer" target="_blank">Cin@lists.cinelerra-gg.org</a><br>
<a href="https://lists.cinelerra-gg.org/mailman/listinfo/cin" rel="noreferrer noreferrer" target="_blank">https://lists.cinelerra-gg.org/mailman/listinfo/cin</a><br>
</blockquote></div>
</blockquote></div></div></div>
</blockquote></div>