How do I merge a folder of PNG images to a mp4 movie using avconv?

5

I have a folder containing many time stamped PNG images which I'd like to merge to a short movie. The contents of that directory looks like this:

└── images
    ├── img_20130421_115547.png
    ├── img_20130421_115617.png
    ├── img_20130421_115926.png
    ├── img_20130421_120034.png
    ├── img_20130421_120129.png
    ├── img_20130421_120245.png
    ├── img_20130421_120354.png
    ├── ...

I tried running the following commands inside the images directory, to no avail:

$ ffmpeg -y -f image2 -pattern_type glob -i 'img*.png' -r 24 out.mp4
ffmpeg version 0.8.6-6:0.8.6-0ubuntu0.12.10.1, Copyright (c) 2000-2013 the Libav developers
  built on Apr  2 2013 17:02:16 with gcc 4.7.2
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
Unrecognized option 'pattern_type'
Failed to set value 'glob' for option 'pattern_type'

$ avconv -y -f image2 -r 24 -i 'img_%08d_%06d.png' out.mp4
avconv version 0.8.6-6:0.8.6-0ubuntu0.12.10.1, Copyright (c) 2000-2013 the Libav developers
  built on Apr  2 2013 17:02:16 with gcc 4.7.2
img_%08d_%06d.png: No such file or directory

$ avconv -y -f image2 -r 24 -i 'img_%*.png' out.mp4     
avconv version 0.8.6-6:0.8.6-0ubuntu0.12.10.1, Copyright (c) 2000-2013 the Libav developers
  built on Apr  2 2013 17:02:16 with gcc 4.7.2
img_%*.png: No such file or directory

$ avconv -y -f image2 -r 24 -i 'img_%.png' out.mp4 
avconv version 0.8.6-6:0.8.6-0ubuntu0.12.10.1, Copyright (c) 2000-2013 the Libav developers
  built on Apr  2 2013 17:02:16 with gcc 4.7.2
img_%.png: No such file or directory

I'm using Ubuntu 12.10. How do I get this to work? thanks.

sa125

Posted 2013-05-07T09:12:04.143

Reputation: 916

2

Get a more recent version of ffmpeg from the actual FFmpeg project, not the ill-named and outdated ffmpeg that comes with Ubuntu, which is from Libav, the FFmpeg fork.

– slhck – 2013-05-11T09:37:00.507

Answers

3

Use ffmpeg, not avconv

avconv does not support the "glob pattern" (among many other things). Use ffmpeg from FFmpeg instead (not the old, fake "ffmpeg" from the Libav fork).

See the FFmpeg Download page for links to already compiled binaries for Linux, OS X, and Windows. Or follow a compile guide.

Example

ffmpeg -framerate 10 -pattern_type glob -i "*.png" output.mkv
  • Consider adding the output option -vf format=yuv420p (or the alias -pix_fmt yuv420p) when outputting H.264 video from images so the output is compatible with QuickTime, WMP, and other dumb players.

  • See the FFmpeg image file demuxer documentation for more info.

llogan

Posted 2013-05-07T09:12:04.143

Reputation: 31 929

Read the question. He asks specifically for avconv – rebellion – 2017-08-15T13:06:49.750

2@Ronny-AndréBendiksen Read the answer. It is not possible with avconv alone. The OP's command was using ffmpeg options that are not supported by avconv. Secondly, this question was asked more than 4 years ago–was your comment necessary? – llogan – 2017-08-15T19:14:11.297

0

Use the image2pipe demuxer. cat *png | avconv -f image2pipe -i - ....

Anton Khirnov

Posted 2013-05-07T09:12:04.143

Reputation: 196