Suppose I have a seamless looping 4-second 24 fps video (starting at frame 0 and ending at frame 95). Suppose I want to offset it in time so that it starts at frame 20, reaches frame 95 at frame 75, then wraps around to frame 0 (at frame 76) and ends at frame 19. Essentially, I'm just wanting to adjust the starting point of the loop of the video, but I still want it to have the same duration and play back at the same speed. How would I do this with ffmpeg?
1 Answer
Use the trim and concat filters.
ffmpeg -i in -vf "split=2[a][b];[a]trim=start_frame=20,setpts=N/FR/TB[a];[b]trim=end_frame=20,setpts=N/FR/TB[b];[a][b]concat" out
-
This is close, but doesn't seem quite right. The output is missing two frames. Take a look at the following. The source is on the left, and the output from your command is on the right. youtube.com/watch?v=H5UPLaKEwMw&feature=youtu.be Commented Feb 28, 2020 at 2:01
-
I doubt that. If you're using Premiere to check, see this: superuser.com/q/1119072– GyanCommented Feb 28, 2020 at 5:47