<p>I am trying to find the best way to automatically concatenate a large number of files that have been recorded with an overlap within them.
In the process of 'glueing' the video files together, to get a smooth playback, I need to strip 5 frames from the end (or from the beginning) of each clip.</p>
<p><a href="https://stackoverflow.com/questions/7333232/how-to-concatenate-two-mp4-files-using-ffmpeg">This post</a> suggests a few ways of concatenating the files, and <a href="https://video.stackexchange.com/questions/20881/how-do-i-remove-night-footage-from-300-days-of-time-lapse-video">this post</a> on processing a timelapse video has an excellent advise on using filters for truncating media. But I am wondering
whether I could avoid re-encoding at all? All files are in the same format.</p>
<p>The ideal answer would include an ffmpeg command.</p>
<p>Thank you in advance!</p>

CC BY-SA 4.0
2020-11-17T06:54:04.623Z
See https://video.stackexchange.com/q/25096/
Gyan
CC BY-SA 4.0
2020-11-18T14:28:42.543Z
Thank you, @Gyan, that is very close. I looked through the manual and couldn't find a way to specify a relative ("from beginning to 3 frames from the last frame") way of defining the outpoint. Is that possible if you don't know the duration of the clip?
Tony Sepia
CC BY-SA 4.0
2020-11-18T14:47:44.750Z
No, outpoint has to be measured in seconds from start.
Gyan
CC BY-SA 4.0
2020-11-18T14:49:30.497Z
OK, thank you! Will use workarounds and assumptions ;)
Tony Sepia
<ffmpeg><concatenation>
ffmpeg - concatenate files, BUT strip the last few frames from the end of each one
Tony Sepia
# ffmpeg - concatenate files, BUT strip the last few frames from the end of each one

(Asked by: username_0 on 2020-11-16)

I am trying to find the best way to automatically concatenate a large number of files that have been recorded with an overlap within them.
In the process of 'glueing' the video files together, to get a smooth playback, I need to strip 5 frames from the end (or from the beginning) of each clip.

[This post](https://stackoverflow.com/questions/7333232/how-to-concatenate-two-mp4-files-using-ffmpeg) suggests a few ways of concatenating the files, and [this post](https://video.stackexchange.com/questions/20881/how-do-i-remove-night-footage-from-300-days-of-time-lapse-video) on processing a timelapse video has an excellent advise on using filters for truncating media. But I am wondering
whether I could avoid re-encoding at all? All files are in the same format.

The ideal answer would include an ffmpeg command.

Thank you in advance!

**Tags:** ffmpeg, concatenation

> **Comments:**
> **username_1**: See https://video.stackexchange.com/q/25096/  
> **username_0**: Thank you, @username_1, that is very close. I looked through the manual and couldn't find a way to specify a relative ("from beginning to 3 frames from the last frame") way of defining the outpoint. Is that possible if you don't know the duration of the clip?  
> **username_1**: No, outpoint has to be measured in seconds from start.  
> **username_0**: OK, thank you! Will use workarounds and assumptions ;)  

---

## 0 answers

