4

I want to create with ffmpeg a pure white video to use it as background. I mean a video that, played in a computer, you see as white. (In the examples I will pipe the output to ffplay so you don't need to delete the video later.)

To create a 3s 640x480 video (25 fps by default):

ffmpeg -f lavfi -i color=white:640x480:d=3 -f matroska - | ffplay -autoexit -

This is a small rectangle of the output against superuser page (which in my browser shows as white).

The first output against superuser page

Looking for an answer, I came to this question. The explanation is provided by Mulvya:

The padding is RGB 235, which is the upper limit in conventional video. So, a video player will expand 235 to show white. – Mulvya Oct 23 '15 at 17:44

But I found no player that show it as white. I tried with ffplay, MPC-HC and VLC both piping and creating an intermediate file.

With images as in the question, the solution seems to be adding the -format rgb32 option. But I get the same result with

ffmpeg -f lavfi -i color=white:640x480:d=3 -format rgb32 -f matroska - | ffplay -autoexit -

The -pixel_formatoption doesn't work either.

So... how do you create a pure white background video with ffmpeg?

cdlvcdlv
  • 1,739

2 Answers2

5

As detailed in the comments, converting to a RGB format provides a full-range output.

-f lavfi -i color=white:640x480:d=3,format=rgb24

For other readers, I should note that I get a pure white display when running the OP's original command. I can't diagnose what's happening on OP's setup but there should be no special steps needed to generate a pure white output from ffmpeg other than color=white.

Gyan
  • 38,955
1

This isn't answering the OP's question, but for anyone else finding this question when looking for how to use ffmpeg to generate a solid color image, using @Gyan's answer, the full command is as follows:

ffmpeg -f lavfi -i color=white:1920x1080:d=3,format=rgb24 -frames:v 1 white-1920x1080.png

To overwrite the output previous file, if any, add -y to the options.

Andrew E
  • 113