Use a tool like mediainfo and check what the metadata of the video file are. Either the video is actually side ways and some metadata flag is supposed to flip it to the correct orientation or the video is correct but metadata is causing the video to flip.
If the video is sideways then you need to re-encode the video in the correct orientation using something like handbrake, if its metadata you need to remux the video and remove the metadata something like mkvtoolnix can do that.