AFAIK, ffmpeg does not have a APE encoder.
http://www.monkeysaudio.com/links.html lists all the softwares that have encoding and playback capability.
If you are programmer then you can also download the SDK from the same website and use it in your program to create your own encoder.