I am writing a Java Swing application in Java that serves as a frontend for the ffmpeg command. It inputs the folder and the file name from the user and adds many more parameters that are constantly displayed in JTextField. User can edit the final command in the text field that it about to be called.
This works in both Windows and Linux:
Process ffmpeg = Runtime.getRuntime().exec(command, null, new File(current_working_folder));
command is a string. It is formatted depending from the OS, so that the path is always given in full (absolute path) and the slashes are appropriate for the given OS.
In Windows and Linux, it is possible to execute ffmpeg command by enclosing the folder and file names in "....". In Windows, this formatting ultimately works through Runtime.getRunTime.exec().
However, in Linux, this does not work through Runtime.getRunTime.exec(). The quotation marks are perhaps misunderstood "....".
Any advice on this?