[FFmpeg-user] Recording joins in concatenated files

Francois Visagie francois.visagie at gmail.com
Tue May 27 18:27:24 CEST 2014

Hi All,


I'm trying to record the joins in concatenated files, i.e. where one input
file ends and the next begins. The reason is that my camera produces one
file per scene, but my editing environment cannot handle the number of files
it typically produces for large projects in one go. In order to access all
media at once I therefore need to concatenate some files, but I also want to
retain markers for scene changes within the concatenated files. I'm
concatenating M2TS files into M2TS output files.


I couldn't find any option for recording joins directly and investigated
artificially inducing PTS discontinuities (the concat muxer and protocol
both adjust PTSs, as one would expect) for manual or hopefully automatic
analysis afterwards. I tried the '-copyts', '-mpegts_copyts 1', '-vsync 0',
'-vf setpts=PTS' and '-avoid_negative_ts disabled' options.


The only one that had any noticeable effect was '-copyts', with the concat
protocol. However, instead of the hoped-for monotonically rising PTS from
the start to end of each scene in the output file, the output PTSs kind of
jump around. I used the command


ffmpeg -report -y -i "concat:20140510154111.mts|20140510154135.mts" -c copy
-copyts -mpegts_m2ts_mode 1 protocol.mts


to concatenate the files, and


ffplay protocol.mts -vf showinfo 2>&1 | find "pts:" 2>&1 >protocol.txt


to examine the concatenated PTSs afterwards.


For completeness I attach the respective logs. In this example, I hoped for
PTSs in protocol.mts to rise monotonically until around frame 648, the last
one in the first input file, and then to start again from some low number,
rising monotonically again afterwards. However, that's clearly not the case.


What is the correct way of recording joins in concatenated files? If no
mechanism is available for doing that directly, what else could I try? In
case shell scripting is called for, I'm working on Windows 7 but I'm sure if
needed I'd be able to port any sh-type scripts you might suggest J.


Many thanks,



Francois Visagie



T: +27 (83) 326-4358

F: +27 (86) 511-3490

E:  <mailto:francois.visagie at gmail.com> francois.visagie at gmail.com



-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-20140527-153326.log
Type: application/octet-stream
Size: 144050 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-user/attachments/20140527/11756268/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: protocol.txt
URL: <https://ffmpeg.org/pipermail/ffmpeg-user/attachments/20140527/11756268/attachment.txt>

More information about the ffmpeg-user mailing list