A phone video that plays sideways on the TV is annoying. The transpose filter turns the actual pixels, so it looks right in every player.
ffmpeg -i sideways.mp4 -vf transpose=1 -c:a copy upright.mp4
transpose=1 rotates 90 degrees clockwise and transpose=2 90 degrees counterclockwise. For 180 degrees, chain two of them: -vf transpose=1,transpose=1. A 1280×720 file comes out as 720×1280, so width and height swap as you’d expect.
Before you re-encode anything, check whether the file just has a rotation flag. Phones often store the picture as it was shot and add a note saying “show this rotated”. ffprobe shows it as a display matrix or rotation in the side data. Players that ignore that note show the video sideways. In that case, recent ffmpeg versions apply the rotation by themselves when they re-encode, so a plain re-encode may already fix it, and adding transpose on top turns it too far.
So I’d look first with ffprobe -v error -show_streams sideways.mp4 | grep -i rotat. If that prints nothing, transpose it is. The audio is copied, but the picture always gets re-encoded with a filter.
Further reading: FFmpeg filters documentation, ffprobe documentation