I have many h265 clips, all six seconds long. Now I want to string these together with ffmpeg (preferably without reencoding), but only use the parts from second 2 to 4 of each clip. I do this with the concat demuxer, but as soon as i specify inpoint and duration, my results get pretty random. It does not throw any errors and produces new clips, but lengths and inpoints are totally off.
As my clips are h265 and rather short, my first suspicion was, that there are simply no keyframes it can edit to, so I tried the same with Quicktime Prores clips (intraframe encoded) – which gave me similarly weired results though. So I'm wondering wether the problem might be somewhere else?
This is my code (calling from Python):
subprocess.call(['ffmpeg', '-f', 'concat', '-safe', '0', '-i', 'concatlist.txt', '-c', 'copy', '-hide_banner', '-loglevel', 'error', output])
This is a sample of my (auto-generated) text file:
file videos_squares/vt_5Hn8lze0G8A.mp4
inpoint 2.0
duration 2.0
file videos_squares/vt_J8DuC93hLq0.mp4
inpoint 2.0
duration 2.0
file videos_squares/vt_u8twUOpagZs_seg3.mp4
inpoint 2.0
duration 2.0