FFmpeg is an open source command-line tool for manipulating audio and video files: converting formats, compressing, trimming, assembling, adding subtitles or streaming.
ffmpeg -i INPUT.ext \
-c:v libx264 \
-profile:v main \
-level 4.0 \
-pix_fmt yuv420p \
-movflags +faststart \
-c:a aac \
-b:a 128k \
OUTPUT.mp4