[FFmpeg-user] generate blank/black frame sequence?

Lou lou at lrcd.com
Sun Oct 9 07:13:19 CEST 2011


On Sat, 8 Oct 2011 21:21:47 -0400 (EDT)
Video Work <vidwork at flight.us> wrote:

> How do you use ffmpeg to create blank/black background video and mux
> it with an audio track?
>  
> I guess it is possible to use ImageMagick or something like that to
> generate a bunch of black rectangle jpegs, and then assemble them
> into a video, as frames? 
> thanks in advance!

There are several ways to do this including ffmpeg-user random tip #11
from Stefano Sabatini:

ffmpeg -t 60 -s qcif -f rawvideo -pix_fmt rgb24 -r 25 -i /dev/zero \
silence.mpeg

Which can be modified to fit your needs:
ffmpeg -s 640x480 -f rawvideo -pix_fmt rgb24 -r 25 -i /dev/zero \
-i music.mp3 -vcodec libx264 -preset medium -tune stillimage \
-crf 24 -acodec copy -shortest output.mkv

Or you could use a single image with ImageMagick/GraphicsMagick:
convert -size 320x240 xc:black black.png

Then mux with ffmpeg:
ffmpeg -loop 1 -i black.png -i music.ogg -acodec copy -shortest output

There is also the "color" filter which might do this, but I've never
used it and didn't investigate.


More information about the ffmpeg-user mailing list