DIY Filmmaking: Multiple Platforms From Single Source

Every so often I see something that does inspire me to delve back into the technical side of filmmaking and write something that is hopefully helpful to other struggling indie filmmakers out there. This video post from David Baker was one of those.  My thinking is this: as a filmmaker, I’m always starting from zero. That means if I can do something of high quality with little or no money, so much the better.

I’m stubborn. I believe there is always a way to make something better, more efficient, and do it all for less money. Waste is a common thing in many high-end productions. On smaller independent films that is simply not an option. It’s looking at filmmaking through the eyes of an engineer.

Indie filmmakers have no choice sometimes with the tools they have to make their films, let alone get them out there.

Enter FFMPEG. It’s free, versatile, and super powerful.

FFMPEG is a great tool that doesn’t get a lot of credit with filmmakers. I think it’s due to the fact that it’s a command line application, something that can scare a lot of us whose only familiarity with a modern computer is through the GUI. Those filmmakers who embrace the computer and become proficient in it will have a measure of success in the future, of this I have no doubt. Learning all of the ins and outs and tricks of your operating system of choice to squeeze as much performance out of it will give you an edge both technologically but also in knowledgeability for the future.

Let’s not get off-track here though and get back to the subject at hand. The real power behind FFMPEG lies in the fact that is used on the command line. It’s like a Swiss Army knife for digital video. As such, it can be a powerful addition to your toolbox as a filmmaker. You can write command-line scripts that perform seriously complex actions with multiple inputs and outputs all from a single call. For those of you scared of the command line, there are GUI front-ends available for it, but I’ve found that they can be limiting in terms of the sheer number of options available and the flexibility that using FFMPEG from the CLI offers.

One of the great things I have noticed, and I’m putting this here as much as a reference for me as for anyone else, is the ability to transcode between file formats and codecs with precise control over every aspect of the transcoding/conversion process. As most in the film business know, transcoding from one format to another can result in generational loss, but this can be mitigated with FFMPEG.

Now that you’ve heard about all of the wondrous things that FFMPEG can do, and I’m hoping that the fact that it’s a CLI tool doesn’t scare you, here’s something that I have considered for a long time: the ability for me, as an independent filmmaker with little or no resources, to have the ability to output my finished product in multiple formats optimized for those platforms without having to involve a lot of time or effort on the part of another human being or myself. Automation is the key, and FFMPEG affords that automation. With a little elbow grease of course.

For example, say you have your finished project and want to get it out for optimal viewing on the various generations of iPod, iPhone, and even the PSP. That is, those generations that allow video playback through iTunes or through the Memory Stick Pro.

Not too difficult for FFMPEG:

Note: You’ll need a version of FFMPEG with libfaac support for these to work. If you don’t have one, there are many places on the Internet to find it.

iPod:

ffmpeg -i INPUT_FILE -acodec libfaac -ac 2 -vcodec mpeg4 -s 480×320 -b 1000kb -ab 96kb -coder 1 -flags +aic+cbp+loop+mv4+naq -trellis 1 OUTPUT_FILE.mp4

Video iPod:

ffmpeg -i INPUT_FILE -acodec libfaac -ac 2 -vcodec mpeg4 -s 320×240 -b 1000kb -ab 96kb -coder 1 -flags +aic+cbp+loop+mv4+naq -trellis 1 OUTPUT_FILE.mp4

iPhone:

ffmpeg -i INPUT_FILE -acodec libfaac -ac 2 -vcodec mpeg4 -s 640×480 -b 1000kb -ab 96kb -coder 1 -flags +aic+cbp+loop+mv4+naq -trellis 1 OUTPUT_FILE.mp4
ffmpeg -i INPUT_FILE -acodec libfaac -ac 2 -vcodec mpeg4 -s 480×320 -b 1000kb -ab 96kb -coder 1 -flags +aic+cbp+loop+mv4+naq -trellis 1 OUTPUT_FILE.mp4

Apple TV:

ffmpeg -i INPUT_FILE -acodec libfaac -ac 2 -vcodec mpeg4 -s 640×480 -b 1000kb -ab 96kb -coder 1 -flags +aic+cbp+loop+mv4+naq -trellis 1 OUTPUT_FILE.mp4

Substitute the INPUT_FILE parameter with the name of the file you’d like to transcode.

You’ll notice with the Apple devices many similarities in the options. In this instance they all use the FAAC codec for sound, 2-channel audio at 96kb, and MPEG-4 video output set at 1000kb. The -flags parameter gives special commands to FFMPEG that optimize the video for that specific platform. Notice that they’re all the same in the case of Apple devices.

Also notice the -s parameter with varying screen sizes. The iPhone can work comfortably with both of those screen resolutions, but the others work best with just what is listed there.

For the PSP, there’s not much of a difference, except for a few extra parameters.

PSP:

Note: You’ll need libx264 as well as libfaac for this one to work. This will give you h.264-encoding capability.

ffmpeg -i INPUT_FILE -acodec libfaac -ab 128kb -ac 2 -ar 48000 -vcodec libx264 -level 21 -b 640kb -coder 1 -f psp -flags +loop -trellis 2 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -g 250 -s 480x272 OUTPUT_FILE.mp4

Notice the odd screen resolution here (480×272). This is a strangeness in the hardware itself that makes me shake my head wondering what Sony was thinking, but it works.

Putting it all together, even into a simple batch file on Windows and you can automate your conversion to multiple platforms easily.

ffmpeg -i %1 -acodec libfaac -ac 2 -vcodec mpeg4 -s 480×320 -b 1000kb -ab 96kb -coder 1 -flags +aic+cbp+loop+mv4+naq -trellis 1 -y %1_ipod.mp4
 
ffmpeg -i %1 -acodec libfaac -ac 2 -vcodec mpeg4 -s 320×240 -b 1000kb -ab 96kb -coder 1 -flags +aic+cbp+loop+mv4+naq -trellis 1 -y %1_vipod.mp4
 
ffmpeg -i %1 -acodec libfaac -ac 2 -vcodec mpeg4 -s 640×480 -b 1000kb -ab 96kb -coder 1 -flags +aic+cbp+loop+mv4+naq -trellis 1 -y %1_iphone.mp4
 
ffmpeg -i %1 -acodec libfaac -ab 128kb -ac 2 -ar 48000 -vcodec libx264 -level 21 -b 640kb -coder 1 -f psp -flags +loop -trellis 2 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -g 250 -s 480x272 -y %1_psp.mp4

Notice that the output files have a suffix added to the filename to denote which platform they are for. Of course this is an extremely simplistic batch file which can (and should) be extended. Linux users probably already have some of this written in Bash format for easy shell usage.

What does this all mean for you as a filmmaker? It means that you now have a powerful and flexible tool at your disposal to output your filmed work for multiple platforms much easier and quicker than before. The sky’s the limit with this tool. Get as dirty and technical as you want or just use what’s here to get started.

2 thoughts on “DIY Filmmaking: Multiple Platforms From Single Source

  1. I’ve only worked worked in FFMPEG a tiny bit (mostly my programmers do it for me) but it does seem a powerful tool! Thanks for this great article! Sharing on my twitter right now 🙂
    (@corrietweets)

Comments are closed.

%d bloggers like this: