ffmpeg: adding blankspace to end of video
Method 1: concat demuxer


Pros: Avoids re-encoding the main video and therefore preserves quality since it is stream copied. Fast.
Cons: Requires several steps. Harder to get right, because the blank video needs to have the same attributes as the main video.


Make the black video using same attributes and same number and type of streams as the main input. This example makes a 15 second black video, frame rate of 24, size is 1280x720:

 ffmpeg -f lavfi -i color=c=black:s=1280x720:r=24:d=15 black.mkv


Make input.txt. The order in this text file determines the order that they will appear when concatenating.

file 'main.mkv'
file 'black.mkv'


Concatenate:

ffmpeg -f concat -i input.txt -c copy output.mkv




Method 2: concat filter


Pro: Can all be done in one command.
Con: Filtering requires encoding, so no stream copying of the main video as in the concat demuxer. Some attributes must still be matched.


Use the color source filter to make the 15 second, 24 fps, 1280x720 black video and append it to the end of the main video with the concat filter:

ffmpeg -i main.mkv -filter_complex "color=c=black:s=1280x720:r=24:d=15[black];[0:v][black]concat=n=2:v=1:a=0[v]" -map "[v]" output.mkv


If you prefer the black to be at the beginning instead then switch the order for the concat filter inputs, such as [black][0:v]concat….



Method 3: tpad and apad filters


Pro: Easy. No need to match any attributes.
Cons: Filtering requires encoding, so no stream copying of the main video as in the concat demuxer. Relatively new filters: use FFmpeg 4.2 or newer, or even better use a build from the current git master branch.


Append 15 seconds of black video to the end of the main video:

ffmpeg -i main.mkv -filter_complex "tpad=stop_duration=15" output.mkv


If you want it at the beginning instead use start_duration instead of stop_duration. If you want to clone the frames instead, or want a different color than black then refer to the tpad filter documentation.