How to letterbox smaller video when generating larger output?

Is it possible to reencapsulate a non-standard video size (like 1200x700) in to a standard video size (like 1280x720) but as centered/letterboxed with a black frame?

The reason I’m asking is that I often do terminal/GUI recordings of windows, and they tend to be odd shaped but I’d like to upload to YT as standard video sizes so it doesn’t mangle the fonts too much with scaling.

Thanks in advance.