Whenever I shoot a video with my cell phone in portrait mode, the listed resolution on the file information ends up as 1920x1080, even though when you play the video on a media player, it displays as 1080x1920. When I read the video into moviepy with: clip = VideoFileClip('filename.mp4')
, it thinks it is a video with a width of 1920, a height of 1080, and a rotation of 90. clip.w == 1920 clip.h == 1080 clip.rotation == 90
.
If I don't do anything at all to the clip, but try to write the clip to a new file, for example with the command clip.write_videofile("newfilename.mp4", codec="libx264", audiocodec='libmp3lame', bitrate='6000k', fps=50)
, it produces the same video only stretched horizontally and squashed vertically. Is there a way to prevent this from happening?