Shell command line length

Is there a limit to a command line string?

I am working on a desktop application that uses FFmpeg in the background to do some processing. But combining many FFmpeg filters can really make a resulting command line string very lengthy…

On a side note:
You are aware you may not distribute an app with a compiled FFmpeg? Even if it is marked as non-free.
MPEG LA is pretty vigilant to sue you.

I am currently working on a project that is also doing background processing on files with an async shell class.
In my testing I have passed up to 220 file paths at once into this shell’s execute method resulting in a command with a length of 24420 characters and haven’t run into any issues.

I don’t know what the limit is if it exists, but I haven’t reached it yet.

The limit is dependent on your platform and the shell being used.

For Linux, it’s 32,768, for OS X, it appears to be 2048 or 1024 depending on the version of OS X, for Windows the limit is 8192 characters.

But, there are methods for getting around these values. superuser.com is your friend here.

FWIW, my application is running on macOS 10.12.5
Perhaps that is the limit for the macOS terminal, but not a Xojo shell.

I tried up to 100K of string echoed in the shell. No problem. The limit is probably much higher.

Do you think 32 or 64 bit makes a difference? I was first thinking of the size limit of a string variable.

[quote=335837:@Christoph De Vocht]On a side note:
Are you aware you may not distribute an app with a compiled FFmpeg? Even if it is marked as non-free.
MPEG LA is pretty vigilant to sue you.[/quote]

Well… I would not embed FFmpeg in my app. I will include instructions to download and install the package.
One technique I used before is just scanning some folders. Like the SpecialFolder.Applications. If not found, start at the App.ExecutableFile and go back in the folder’s structure.
If still not found, ask the user to point to the FFmpeg’s application file. That is how I have seen it done and works for me.