So ffmpeg is one of the best open source tool that is used to create video / change codec , change pixel-format , change crf factor etc

and this is written in cpp so its already one of the most fastest software that we have here

FFMPEG commands