video captured from iphone gets rotated when converted to .mp4 using ffmpeg

后端 未结 10 1818
名媛妹妹
名媛妹妹 2020-12-01 02:31

When I try to upload videos captured from my iPhone in my app, the server performs a conversion from .mov to .mp4 so that it can be played in other platforms. However the pr

10条回答
  •  盖世英雄少女心
    2020-12-01 02:47

    Although the topic is old. Hope this will help some one:

    Get ffmpeg latest version : https://www.ffmpeg.org/download.html

    The command that worked for me (to flip 180 degrees):

    ffmpeg -noautorotate -i input.mp4 -filter:v "rotate=PI" output.mp4
    

    When the degrees are determined by -filter:v "PI/180*degrees"

    for example -filter:v "45*PI/180" for 45 degrees

    A nice explanation is here https://superuser.com/questions/578321/how-to-rotate-a-video-180-with-ffmpeg

提交回复
热议问题