mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
set oiio and ffmpeg environments in the start
This commit is contained in:
parent
95a9dc228f
commit
3fe692e8fa
1 changed files with 26 additions and 0 deletions
26
start.py
26
start.py
|
|
@ -95,6 +95,7 @@ Attributes:
|
|||
import os
|
||||
import re
|
||||
import sys
|
||||
import platform
|
||||
import traceback
|
||||
import subprocess
|
||||
import site
|
||||
|
|
@ -144,6 +145,31 @@ def set_openpype_global_environments() -> None:
|
|||
if "QT_AUTO_SCREEN_SCALE_FACTOR" not in os.environ:
|
||||
os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1"
|
||||
|
||||
# --- Set environment variables to vendorized binaries(FFmpeg and OIIO) ---
|
||||
# TODO add validations of existing binaries
|
||||
# Prepare path to bin vendor directory
|
||||
bin_vendor_dir = os.path.join(
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
"vendor",
|
||||
"bin"
|
||||
)
|
||||
# Prepare platform name
|
||||
platform_name = platform.system().lower()
|
||||
|
||||
# FFmpeg path
|
||||
ffmpeg_path_parts = [bin_vendor_dir, "ffmpeg", platform_name]
|
||||
# Windows version has executables in `bin` directory
|
||||
if platform_name == "windows":
|
||||
ffmpeg_path_parts.append("bin")
|
||||
|
||||
ffmpeg_path = os.path.join(ffmpeg_path_parts)
|
||||
|
||||
os.environ["OPENPYPE_FFMPEG_PATH"] = ffmpeg_path
|
||||
|
||||
# OIIO path
|
||||
oiio_path = os.path.join(bin_vendor_dir, "oiio", platform_name)
|
||||
os.environ["OPENPYPE_OIIO_PATH"] = oiio_path
|
||||
|
||||
|
||||
def run(arguments: list, env: dict = None) -> int:
|
||||
"""Use correct executable to run stuff.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue