This post is how meta engineers just recently submitted a patch with the ability to avoid starting a new process for every output encoding and so they can share the decoding step. Maybe that also includes sharing the motion estimation step, but I would be careful making such assumptions, FFMPEG has a lot of low hanging optimization work that hasn't been done just because someone hasn't done it yet.