If you want to do this via command line, you can use the FFmpeg library :
Popular free apps specifically designed for adding stylish text, captions, and effects to MP4 files. 💻 On Your Computer IMG_2516.MP4
Use iMovie . Drag your video in, click the Titles tab at the top, and choose a text style to overlay. If you want to do this via command
Use the built-in Clipchamp editor. Import your MP4, drag it to the timeline, and select the Text tab on the left sidebar. drag it to the timeline