You can do that already without jailbreaking with a-Shell[1]. It includes a wasm compiled ffmpeg binary and you can install (Python only) pip packages.

[1]: https://holzschu.github.io/a-Shell_iOS/