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: 450

Filed under:
|
|

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

Related posts about ffmpeg

  • how to install ffmpeg in cpanel

    as seen on Super User - Search for 'Super User'
    i'm using dedicated server(linux) so i need to install ffmpeg in cpanel so here ffmpeg i found in Main Software Install a Perl Module but i writing script in php so how can i install ffmpeg phpperl when i'am trying to install ffmpeg in perl module i get this response Checking C compiler… >>> More

  • FFMpeg-PHP Installation Error

    as seen on Server Fault - Search for 'Server Fault'
    While installing FFmpeg-PHP, I got this interesting error: /usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function 'zim_ffmpeg_movie_getAudioStreamId': /usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1051: error: 'CODEC_TYPE_AUDIO' undeclared (first use in this function) /usr/downloads/ffmpeg-php-0… >>> More

  • git problems installing stuff [closed]

    as seen on Super User - Search for 'Super User'
    root@Frenzen:~# cd root@Frenzen:~# git clone --depth 1 git://source.ffmpeg.org/ffmpeg Initialized empty Git repository in /root/ffmpeg/.git/ root@Frenzen:~# cd root@Frenzen:~# git clone --depth 1 git://source.ffmpeg.org/ffmpeg Initialized empty Git repository in /root/ffmpeg/.git/ root@Frenzen:~#… >>> More

  • Unable to install ffmpeg-php

    as seen on Server Fault - Search for 'Server Fault'
    I followed the instructions on http://www.mysql-apache-php.com/ffmpeg-install.htm but ffmpeg-php does not show up in my phpinfo() The commands I ran (in order) #yum install ffmpeg ffmpeg-devel ... Public key for faac-1.26-1.el5.rf.x86_64.rpm is not installed #rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0… >>> More

  • Unable to install ffmpeg-php

    as seen on Server Fault - Search for 'Server Fault'
    Hi, I followed the instructions on http://www.mysql-apache-php.com/ffmpeg-install.htm but ffmpeg-php does not show up in my phpinfo() The commands I ran (in order) #yum install ffmpeg ffmpeg-devel ... Public key for faac-1.26-1.el5.rf.x86_64.rpm is not installed #rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0… >>> More

Related posts about png