Oddly enough, I've done something pretty similar, but using Python + PIL instead: https://github.com/notpushkin/glitzz
Two improvements you can borrow:
1. FFmpeg can read frames from HTTP URL, which you can (ab)use to generate frames on the fly without hitting the disk
2. If you do that, you can also switch from PNG to BMP, since CPU is now your bottleneck