I'd like to achieve two things without re-encoding the whole video stream:
- Extend a video by freezing the last frame for a given duration.
- Extend a video by freezing a frame at a given timestamp for a given duration.
Currently I'm using ffmpeg -i in.mp4 -vf tpad=stop_mode=clone:stop_duration=5 out.mp4
but it requires encoding the whole video stream and only allows freezing the last frame of the stream. To get my desired result I need to split the video into segments, extract the last second of a segment to a separate file (so I re-encode just that part), run the above command on it and then merge all the segments back with concat demuxer.
Is there any better and simpler way to achieve the above?