The problem with calling ffmpeg multiple times in a script is you often waste compute time.
If you can manage to cobble together a single command (as illegible as that may be), you might be able to do what you're looking to do in far less time
If you can manage to cobble together a single command (as illegible as that may be), you might be able to do what you're looking to do in far less time