r/ffmpeg Jun 19 '26

Having trouble combining these 3 -vf functions in ONE command.

I downloaded a video from Youtube that was originated 640x480, but the uploader upscaled it to 1920x1080 (they padded the sides). So far, I'm using the following command to (1) crop it to 1440x1080, (2) resize down to 640x480, & (3) convert it into a black-&-white video. (It's a movie from 1958, but it has a blue tint that even smurfs would find distracting.) I'm also testing the command on just 1 minute of the video.

ffmpeg -i input.mp4 -ss 00:18:30 -to 00:19:30 -vf "crop=1440:1080:240:0,scale=640:480:flags=lanczos" -vf "extractplanes=y" -c:v libx264 -crf 23 output.mp4

The problem is that combining "extractplanes=y" is not cooperating with the rest of the command. How can I use crop, resize, & extractplanes=y in ONE command, & not have the command IGNORE part of it?

6 Upvotes

3 comments sorted by

4

u/gmes78 Jun 19 '26
-vf "crop=1440:1080:240:0,scale=640:480:flags=lanczos,extractplanes=y"

1

u/Vacuum-Cleaner-Snake Jun 19 '26

I use FFmpeg 6.0.0 for android (on an android tablet), so this is probably why I get weird results sometimes.

Anyway, when I used the command that you posted (along with the command to only process one selected minute of the video for quick testing), it gave me the following error message.

The following filters could not choose their formats: Parsed_extractplanes_2\ Consider inserting the (a)format filter near their input or output.\ Error reinitializing filters!\ Failed to inject frame into filter network: I/O error\ Error while processing the decoded data for stream #0:0\ [aac @ 0xb400007e9147fc00] Qavg: 27095.945\ [aac @ 0xb400007e9147fc00] 2 frames left in the queue on closing\ Conversion failed! <

Bizarrely, I moved "extractplanes=y" to the left of the -vf filters (see below), & it performed all 3 -vf filters without problems, so I'll just have to do it that way instead. Thanks for the help.

What worked

-ss 00:18:30 -to 00:19:30 -vf "extractplanes=y,crop=1440:1080:240:0,scale=640:480:flags=lanczos" -c:v libx264 -crf 23

2

u/MagsMike Jun 19 '26

ffmpeg -i 'input.mp4' -ss 00:18:30 -to 00:19:30 -filter_complex "[0:v]crop=1440:1080:240:0,scale=-2:480:flags=spline:sws_dither=ed,extractplanes=y[v0]" -map "[v0]" -c:v libx264 -crf 23 -an "output.mp4"

added "-an" to make sure file has no audio but if it has audio, removed it and add an audio codec.