You're correct, this is a post-processing operation, however I took care to do something that works in real time, so you can use this same algorithm for any FPV transmission, which is the next step that I'm planning to implement (but with more robust features).
#Edit. Scratch that, the code is opening a file "upabove.mp4"... i.e. not realtime, on the drone. Realtime on a PC/laptop.