Things like x264, aac, MPEG etc are not just free of licensing. However..
I think... (<- My disclaimer.)
The FFmpeg project maintains several libraries like libavcodec, libavformat, libavfilter, libswscale and some more. Depending on how you compiled it, they fall under LGPL or GPL.
If you want to embed/link into these libraries, these LGPL/GPL licenses apply.
FFmpeg also offers a cli tool/wrapper called ffmpeg (lowercase 'ff'). If you use this CLI externally (you call it via the Shell), those rules do not apply.
There are quite a bunch of posts about this on ffmpeg.org/pipermail . Here is an example: https://ffmpeg.org/pipermail/ffmpeg-user/2011-August/001854.html
So you should be fine if you Shell to ffmpeg. Just as you are allowed to Shell out to any other program that is already on the customer's computer. (Excel, Photoshop, Final Cut Pro, whatever)
The thing is, if the user doesn't have this specific program installed already, you can't just simply include it (like you cannot simply include Excel, Photoshop, FCP etc. with your App)
However, you *are* allowed to distribute an ffmpeg build. As long as you supply the source and compile instructions with it that you used for the build.
What you also can do is check if the user already has the correct version installed and if not, tell them how to install it.
Now the ffmpeg cli tool is pretty complete but less powerful than using the libraries directly.
If you want *that* and you need parts that require licensing (x264, aac etc.), then just license them.
For example; You can contact CoreCodec (.com) for x264 licensing. I understand that the pricing ranges from ~5-10% (of your commercial App price) per copy or less when it's volume. I don't know what rules they have but I guess it also depends on your App.
Their website mentions a minimum of xx units but I've heard that you can negotiate that away/down depending on your App and volume.
I'm not sure about aac licensing pricing but I assume it's a lot less. See here: http://www.vialicensing.com/licensing/aac-faq.aspx
I think the MPEG LA fees are not even considered below 1M units and when above, it's a few cents I believe.
But for everything above, please do your own research.