ffmpeg-cli-wrapper icon indicating copy to clipboard operation
ffmpeg-cli-wrapper copied to clipboard

How to know whether this execution is successful?

Open userlang opened this issue 3 years ago • 1 comments
trafficstars

I saw the state enumeration value provided by ffmpegjob, but I didn't see it in the source code, such as echo $? Is it my negligence to ask again whether the command was executed successfully?

userlang avatar Jul 28 '22 09:07 userlang

echo $1 is just a "workaround" used in bash, which reads the exit code of the last process and prints it. When spawning processes in another language, you usually don't (and can't) do this, as there is no shell running in between. But we can keep track of the process and ask the operating system. This is done in FFcommon, which tests if the exit code has been 0 and otherwise throws an IOException.

Therefore, you know that the execution succeeded (as far as the library is capable of detecting) if no Exception has been thrown.

Euklios avatar Oct 09 '22 11:10 Euklios

I'll close this for now because the question seems answered. If necessary, feel free to reopen or create a new issue.

Euklios avatar Mar 11 '24 19:03 Euklios