Skip to content

Instantly share code, notes, and snippets.

@shelling
Created August 9, 2010 06:28
Show Gist options
  • Select an option

  • Save shelling/515038 to your computer and use it in GitHub Desktop.

Select an option

Save shelling/515038 to your computer and use it in GitHub Desktop.
Makefile for encoding multiple png image files into a short animation
files = *.png
fps = 30
.PHONY: all avi mp4 h264 help
all: avi mp4 h264
avi:
mencoder 'mf://$(files)' -mf type=png:fps=$(fps) -ovc lavc -lavcopts vcodec=wmv2 -o animation.avi
mp4:
mencoder 'mf://$(files)' -mf type=png:fps=$(fps) -ovc lavc -lavcopts vcodec=mpeg4 -o tmp.avi
x264 -o mpeg4-version.mp4 tmp.avi
rm tmp.avi
h264:
mencoder 'mf://$(files)' -mf type=png:fps=$(fps) -ovc x264 -x264encopts subq=5:8x8dct:frameref=2:bframes=1 -o tmp.avi
x264 -o h264-version.mp4 tmp.avi
rm tmp.avi
clean:
rm -rf *.png *.avi *.mp4
help:
@echo 'default parameters:'
@echo ' files: $(files)'
@echo ' fps: $(fps)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment