Locked History Actions


How to update relevant software

ffmpeg needs libx264 which needs yasm.

On 9-Nov-12, Updated to:

  • yasm 1.2.0
  • x264 0.129 (git fetch; git checkout stable; ./configure --enable-static --enable-shared)
  • ffmpeg N-46557-ga93c7ca (git checkout n1.1; ./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libx264)

Remember to sudo ldconfig after installing these.

How to create the individual movie frames

Mathematica is easy to use but does not anti-alias some lines (FrameBox, for example) and cannot be run in batch on the server, as explained here.

How to create a movie from a sequence of images

Image filenames should be numbered sequentially in a single directory. Updated instructions after updating ffmpeg on 11-Nov-12:

ffmpeg -r 30 -i darkenergy/frame%d.png -c:v libx264 -preset placebo -tune animation -vprofile baseline -crf 23 -pix_fmt yuv420p -threads 0 -metadata title="Expanding Dark Energy" -metadata artist="David Kirkby <dkirkby@uci.edu>" -metadata organization="University of California, Irvine" darkenergy.mp4

More details on x264 specific options are here. Help is available using x264 --help from the command line. One parameter to play with is --preset which should be "as slow as you can tolerate". Note that the default 4:4:4 mode of libx264 is not supported on most decoders yet (the -pix_fmt yuv420p disables this feature).

Title Overlay

To overlay a fixed title image over each frame before encoding, use the imagemagick compose command, e.g. with a bash script like this:

mkdir titled
for filename in frames/*.png; do
    base=`basename "$filename"`
    composite overlay.png "frames/$base" "titled/$base"

Embed Video in HTML Page

This is a good starting point.

We need a Theora encoding for Firefox and Chrome:

ffmpeg2theora titled/dr9survey%d.png --optimize --speedlevel 0 --title "BOSS DR9 Lyman-alpha Forest" --artist "David Kirkby <dkirkby@uci.edu>" --organization "University of California, Irvine" -o titled.ogv

iPad, etc Version

See conversion matrix here.

ffmpeg -f image2 -i titled/dr9survey%d.png -vcodec libx264 -preset slow -vpre ipod640 -tune animation -b 1200k -threads 0 -metadata title="BOSS DR9 Lyman-alpha Forest" -metadata artist="David Kirkby <dkirkby@uci.edu>" -metadata organization="University of California, Irvine" apple.mp4

Note that changing preset from slow to placebo will not work (not sure why).