Blender Bits

I’ll just this post for all my Blender related notes. Hopefully you will also find them useful.

Animating .PNG files

The recommended approach to create an animation is to render each individual frame, and then use a utility like ffmpeg to make the animation.

To install ffmpeg you can use Homebrew—the awesome missing package manager for macOS. Open a Terminal window and type in:

brew install ffmpeg

After it has completed, you go to the folder with the rendered frames (often it will be in /tmp/ on your Mac):

cd /tmp/

And from within that folder you run the following command:

ffmpeg -r 60 -i %4d.png -qscale 1 -pix_fmt yuv422p -y name_of_movie.mp4

What does it do?

The options used for ffmpeg above are as follows (you can run man ffmpeg to get help on all available settings):

  • -y
    This option gives ffmpeg permission to overwrite the output file without asking. Useful when you want to quickly try different settings for ffmpeg, like changing framerate and video scale.
  • -r 60
    This is the constant frame rate of the generated video, in Hz (frames per second). This option must be set before the image/video input parameter to affect the framerate.
  • -i %4.png
    This is the input file url.
  • -qscale 1
    Specifies the compression amount, where 1 is best quality (largest file, lowest compression) and 31 is the worst quality (smallest file, highest compression).
  • -pix_fmt yuv422p
    Sets the pixel format of the output video. The above setting results in 8 bits per colour channel, where “y” is luma (brightness), and “u” and “v” are chroma (color). To reduce the output file size, you can increase the chroma compression by using 420p pixel format.

Launching from Terminal

To create a Python plug-in, it is helpful to launch Blender from the command line so you can easier see all the error messages:

cd /Applications/;./Blender

Leave a comment