General: Custom paths to ffmpeg and OpenImageIO tools
Brief description
Added mechanism to define custom paths to ffmpeg and oiio tools and more detailed validation of them.
Description
Right now we're missing vendorized oiio tool for MacOs and don't have mechanism to be able allow different paths for them. Laso we have issues on some linux distributions that executables we support are compatible with them. It is possible to define OPENPYPE_CUSTOM_FFMPEG_PATHS and OPENPYPE_CUSTOM_OIIO_PATHS which lead to custom paths where tool can be found. These tools are checked as before using executables from OpenPype build. Added one more layer of executable validation to check if they can be executed by executing them. FFmpeg tools are validated with executing {tool} -version arguments and oiio tools are validated executing {tool} --help. In both cases the return code should be 0 (they don't validate if the tool is really the tool).
It should be possible to set just tool name in then env values (they must be without extensions). In that case is used tool from PATH environment.
Executable paths are cached on first get. That's because the validation is time consuming and may cause huge slowdown.
Additional info
Environment keys can be changed and we can also add direct ability of define them in settings. Not sure if we should support direct ability to set them in settings -> opinions?
Note: We would have to set the environments anyway on startup because lib functions should not use settings directly (or move the functions out of lib?).
Testing notes:
- Set
OPENPYPE_CUSTOM_FFMPEG_PATHSandOPENPYPE_CUSTOM_OIIO_PATHSin system settings to different paths - Call
get_oiio_tools_pathandget_ffmpeg_tool_pathwhich should return paths from your paths, or not if the tool is not there, or can't be executed - You can run publishing and check logging output e.g. from
ExtractReviewwhere your paths should be used