Encode a sequence of images into video

Hi! A key feature in my current game is recording videos of the screen. I’ve already manage to build a pretty decent library that is able to save screenshots at certain fps without affecting the game performance at all. Now I need to encode those stills into a video.
What do you consider the best way to follow? I need a cross platform solution that can do all the job inside the app, not depending on external apps or program.
I’ve consider ffmpeg but it’s not Java and I think it wouldn’t be so trivial to wrap it in Java and port it to Android and iOS.
There is a (not so good) Java library called JCodec that runs on desktop and Android, too. But I don’t know how well it will behave on iOS and it’s pretty limited.
And I’ve even consider using gdx-video because I think it wraps some of ffmpeg functionality, but if i’m not wrong it’s only able to decode and I don’t know if it runs on iOS (and there isn’t so much documentation)
Do you know any almost native solutions for each platform? What path would you take?

Thank you in advance! Any idea (even vague) will be appreciate!