2

I'm trying to convert a video with black bars, to one without and if the source is 4k, I want the video to be converted to 1080p

Now to do this, I'm using the following command:*

ffmpeg -i input ... -filter:v "crop=..." -filter:V "scale=1920:-1" ouput

But running this, I found that the end product still has said black bars and is 1920x1080 as opposed to the 1920x800 I'd expect.

What gives, why does this not work?

*: Other settings have been left out for convenience.

Mitchell Faas
  • 430
  • 6
  • 19
  • 1
    https://stackoverflow.com/a/39188250/5726027 --> same answer applies here – Gyan Mar 29 '18 at 13:40
  • @Mulvya I tried to do the same thing with 1280:- as scale. But by doing this, the crop moves to 1280x533. But this is not accepted since it says "height not divisible by 2" and fails. Do you know how to force the second to be divisible by 2 (or ideally 16). – Mitchell Faas Mar 29 '18 at 18:45
  • 1
    `scale=1280:-16` – Gyan Mar 29 '18 at 19:11
  • 2
    If you specify `filter:v` twice, the second one overrides the first. So you have to combine both into one and separate the directives using a comma. – caw Nov 20 '21 at 18:42

1 Answers1

7

I got it to work by putting both the crop and the scale in the same -vf tag. I was cropping and then increasing the size of an old video game, and I just did this:

-vf crop=256:192:2:16,scale=-2:1080:flags=neighbor

I knew it worked as soon as I saw it display the output file size as 1440x1080 (4:3 ratio at 1080p).

Krendall
  • 86
  • 1
  • 2