Convert png sequence to x264 with ffmpeg
Posted
by
Thucydides411
on Super User
See other posts from Super User
or by Thucydides411
Published on 2012-12-03T04:39:36Z
Indexed on
2012/12/03
5:20 UTC
Read the original article
Hit count: 499
I am trying to convert a series of pngs into an mp4 video. I am using ffmpeg, and want to encode the video with the x264 codec. Using the command
ffmpeg -y -r 30 -b 1800k -i _tmp%04d.png -vcodec libx264 out.mp4
I get the following warning message
Incompatible pixel format 'bgra' for codec 'libx264', auto-selecting format 'yuv420p'
My understanding is that there is an alpha channel in the pngs, which the x264 encoder cannot handle. Is there a way to get around this problem? Is there, for example, a way to get the encoder to ignore the alpha channel (my pngs don't actually have any transparent elements)?
I'm aware that I could batch convert the pngs beforehand to strip the alpha channel, but the sequence of images is produced by another program, and having to preprocess the images each time I make a video would be less than optimal.
Edit: After stripping the alpha channel from each frame using the command
convert in.png -background white -flatten +matte out.png
ffmpeg gives the warning message
Incompatible pixel format 'pal8' for codec 'libx264', auto-selecting format 'yuv420p'
so still no dice.
© Super User or respective owner