OpenPype icon indicating copy to clipboard operation
OpenPype copied to clipboard

General: Custom paths to ffmpeg and OpenImageIO tools

Open iLLiCiTiT opened this issue 3 years ago • 1 comments

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:

  1. Set OPENPYPE_CUSTOM_FFMPEG_PATHS and OPENPYPE_CUSTOM_OIIO_PATHS in system settings to different paths
  2. Call get_oiio_tools_path and get_ffmpeg_tool_path which should return paths from your paths, or not if the tool is not there, or can't be executed
  3. You can run publishing and check logging output e.g. from ExtractReview where your paths should be used

iLLiCiTiT avatar Oct 13 '22 17:10 iLLiCiTiT