3

I am trying to crop a portrait video of 1280x720 to 568x320 so that the video will be displayed in landscape view (16:9). I am using the following command

ffmpeg -i VID_1438833296.mp4 -vf crop=568:320:0:0 -c:a copy out.mp4

The video gets cropped properly but when I view it in quick time or Android device it still displays in the portrait mode instead of landscape mode.

The quicktime inspector shows Format size as 568x320 (Landscape) but current size is 350x621 (Portrait):

enter image description here

1
  • 1
    Please include the complete console output from your command and properly format the command and console output.
    – llogan
    Aug 6, 2015 at 17:55

2 Answers 2

1

What's happening here is two things:

1)your video is portrait but stored as a landscape matrix and ffmpeg is applying autorotate so that all players natively display it in what ffmpeg thinks is the correct orientation.

2) the video has a PAL DV aspect ratio of ~1.09, so after the autorotation and aspect ratio correction, 568 x 320 is autorotated to 320 x 568 with 1.09 scaler being applied to both W and H.

Try this, instead:

ffmpeg -i VID_1438833296.mp4 -noautorotate -vf setsar=1,crop=568:320:0:0 -metadata:s:v:0 rotate=0 -c:a copy out.mp4
0

Crop filter is not designed to change orientation, use another filter to change orientation of cropped video.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.