Reputation: 60
I'd like to achieve two things without re-encoding the whole video stream:
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?
Upvotes: 3
Views: 3055
Reputation: 93028
To 'extend' the the last frame, extend the audio stream by padding it.
ffmpeg -i in.mp4 -c:v copy -af apad -t 5 out.mp4
If there's no existing audio stream, add one
ffmpeg -i in.mp4 -f lavfi -i anullsrc -c:v copy -af apad -t 5 out.mp4
For pausing a frame in the middle with minimal re-encoding , segmenting + concat is indeed the way to go
Upvotes: 3