[FFmpeg-user] shuffleplanes

Michael Koch astroelectronic at t-online.de
Mon Oct 11 13:05:10 EEST 2021


Am 11.10.2021 um 11:26 schrieb Paul B Mahol:
> On Mon, Oct 11, 2021 at 11:15 AM Michael Koch <astroelectronic at t-online.de>
> wrote:
>
>> Hello,
>>
>> I have a question about the shuffleplanes filter. In this example the
>> pixel format is RGB24. So the first plane is red and the second plane is
>> green. I want to swap the red and green planes.
>>
>> ffmpeg -f lavfi -i testsrc2 -lavfi
>> format=rgb24,split[a][b];[b]shuffleplanes=1:0:2[b];[a][b]vstack -frames
>> 1 -y out.png
>>
>> But in the output green is swapped with blue. I don't understand why.
>> I'm using the latest Windows build, just a few days old.
>>
> As usual you add additional premise that does not makes sense and is
> incorrect.
>
> rgb24 is not planar but packed.
>
> gbrp is used internally and works as expected, as filter does not care
> about R/G/B/A order.
> It just shuffles planes.

thanks, that explains the unexpected result. It would be helpful to add 
a note to the documentation:
"The input pixel format must be planar, for example gbrp. If a 
non-planar pixel format is used (for example rgb24), a format conversion 
is inserted automatically and you might get unexpected results."

Michael



More information about the ffmpeg-user mailing list