Making ffmpeg work

Your browser does not support the video tag.

To learn how to make this video, read on! (Except I scaled this down for web; full resolution)

When you have proteins in space evolving over time, you have to make a movie. VMD is a love-hate program that is very capable of nice renders of biophysical systems. I like to have more control over the transformation of each rendered frame into a movie file.

ffmpeg is a command-line program that can do this. If you try with the default options, your movie will have lots of compression scarring and may not play in most contexts.

Getting ffmpeg

There are some confusing politics with ffmpeg being forked into avconv and that getting picked up by debian-based distros, but then they were meanies so you shouldn’t use it (???). The safest thing is to get the latest version of ffmpeg and build from source.

The general form of this language is inputs command output. Here, our inputs are the 0th and 1st video streams. The command is hstack, which stacks two streams horizontally. The implicit output is the final movie.

Stack and overlay

Using your favorite plotting software, you can make an animated plot by saving a bunch of frames with zero-padded indices in the filename. Add it as another -i option. Now you can hstack and overlay your plot.