Population Xplosive
Population Xplosive

Reputation: 617

ffmpeg - converting pngs with white background to movie give black background

I have a list of files with their names in the form [1-1000].00.png. All these are flattened images (graphs) with white background color. I am trying to make a movie out of these files using ffmpeg. However, when I use ffmpeg, everything white in the images become black in the movie. And everything black remains the same. The command I used is:

The command I use is:

ffmpeg -pix_fmt yuv420p -r 8 -f image2 -pattern_type glob -i '*.00.png' movie.mp4

Upvotes: 3

Views: 5217

Answers (1)

halanson
halanson

Reputation: 480

are you sure the images have a white background? maybe they have a transparent background. normally transparent backgrounds will converted to black in a file format without transparency supported.

but you can also try this:

you can add a white background to your video file with the -filter_complex parameter and a second -i input of a white colored image file in the same pixel size as your graphs.

-filter_complex "[0:v] setpts=PTS-STARTPTS [graphs]; [1:v][graphs] overlay=shortest=1 [out]" -map "[out]" 

[0:v] is your first video source, your graphs. [1:v] is your second video source, your white colored image. [name] this is always a placeholder name to tell the filter_complex what you want to use in the next step. ; delimters an action.

Upvotes: 3

Related Questions