ffmpeg says that "'.mkv' is not a suitable output format"

-f .mkv should be -f matroska.

See ffmpeg -formats (or ffmpeg -muxers for muxers only) for a list of supported names.

ffmpeg can automatically determine the appropriate format from the output file name, so most users can omit the -f option. Outputting to /dev/null or NUL is an exception.