I guessed that the issue was caused by FFmpeg's inability to infer the video container format from the encoding format and file path, so appending a suffix like ".mp4" to the path resolved it.