File size: 428 Bytes
d2b7e94
627d3d7
d2b7e94
627d3d7
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import logging
import os

from modules.utils.constants import ROOT_DIR

logger = logging.getLogger(__name__)


def setup_ffmpeg_path():
    ffmpeg_path = os.path.join(ROOT_DIR, "ffmpeg")
    os.environ["PATH"] = ffmpeg_path + os.pathsep + os.environ["PATH"]

    import pydub.utils

    if pydub.utils.which("ffmpeg") is None:
        logger.error("ffmpeg not found in PATH")
        raise Exception("ffmpeg not found in PATH")