Install ffmpeg on iPhone
If your device is jailbroken, you can install the ffmpeg package:


 ffmpeg

This package is open source on GitHub nin9tyfour/FFmpeg-iOS-build-script which you can use to build a more recent version and manually install it yourself if the version of ffmpeg provided by this package is insufficient for your needs.


You can use the package from the command line using a Terminal.


 NewTerm 2

A terminal emulator package, installable with Cydia.


  NewTerm is a continuation of the Mobile Terminal project, a versatile terminal emulator for iOS.



You can also use an SSH app from the App Store, however this requires you to change your SSH port from 22 since iOS prevents localhost access to port 22, so suggestions for apps and instructions are out of scope for this question.