If you rotate the iPhone's video with ffmpeg,

2019-09-16 03:13发布

The following implementation is a command to rotate the movie by 90 degrees.

ffmpeg -i video.mp4 -vf transpose=1 -metadata:s:v:0 rotate=0 videoo.mp4
-vf transpose=1

The iPhone's video contains rotation information and actually

ffprobe -show_streams -print_format json videoo.mp4 2>/dev/null

To output motion picture information or rotation information as described below.

 "tags": {
                "rotate": "90",
                "creation_time": "2017-08-24T01:49:38.000000Z",
                "language": "und",
                "handler_name": "Core Media Data Handler",
                "encoder": "'avc1'"
            },
            "side_data_list": [
                {
                    "side_data_type": "Display Matrix",
                    "displaymatrix": "\n00000000:            0       65536           0\n00000001:       -65536           0           0\n00000002:            0           0  1073741824\n",
                    "rotation": -90
                }
            ]



"rotate": "90",

and

"side_data_list":

and

"rotation": -90

Is it possible to hide this? Or is it possible to erase only this rotation information?

1条回答
ゆ 、 Hurt°
2楼-- · 2019-09-16 04:01

Your ffmpeg is probably old. If you just want to physically rotate the video encode it using ffmpeg and it will do that automatically according to the rotation information:

ffmpeg -i input.mp4 -c:a copy output.mp4

It will automatically strip the rotation side data. If you want to avoid that behavior add the -noautorotate option.

If you just want to strip the rotation side data:

ffmpeg -i input.mp4 -c copy -metadata:s:v rotate="" output.mp4
查看更多
登录 后发表回答