nifty-coder commited on
Commit
6fb5dda
·
1 Parent(s): 9db4736
Files changed (2) hide show
  1. build.sh +13 -1
  2. main.py +6 -0
build.sh CHANGED
@@ -9,6 +9,18 @@ pip install -r requirements.txt
9
 
10
  # 3. Install demucs dependencies separately to manage version conflicts
11
  echo "Installing demucs dependencies..."
12
- pip install dora-search einops "julius>=0.2.3" openunmix tqdm pyyaml "lameenc>=1.2"
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  echo "Build complete (Pure Python)!"
 
9
 
10
  # 3. Install demucs dependencies separately to manage version conflicts
11
  echo "Installing demucs dependencies..."
12
+ pip install dora-search einops "julius>=0.2.3" openunmix tqdm pyyaml "lameenc>=1.2" demucs
13
+
14
+ # 4. Download static ffmpeg (for Render/Linux)
15
+ if [ ! -f "ffmpeg" ] && [ "$(uname)" == "Linux" ]; then
16
+ echo "Downloading static ffmpeg..."
17
+ wget -q https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz
18
+ tar -xf ffmpeg-release-amd64-static.tar.xz
19
+ # Move binaries to root
20
+ find . -name "ffmpeg" -type f -exec mv {} . \;
21
+ find . -name "ffprobe" -type f -exec mv {} . \;
22
+ chmod +x ffmpeg ffprobe
23
+ rm -rf ffmpeg-*-amd64-static*
24
+ fi
25
 
26
  echo "Build complete (Pure Python)!"
main.py CHANGED
@@ -98,6 +98,12 @@ def find_ffmpeg() -> str:
98
  for path in common_paths:
99
  if os.path.exists(path) and os.access(path, os.X_OK):
100
  return path
 
 
 
 
 
 
101
  return shutil.which("ffmpeg") or "ffmpeg"
102
 
103
  FFMPEG_PATH = find_ffmpeg()
 
98
  for path in common_paths:
99
  if os.path.exists(path) and os.access(path, os.X_OK):
100
  return path
101
+
102
+ # Check current directory (e.g. for Render)
103
+ local_binary = os.path.join(os.getcwd(), "ffmpeg")
104
+ if os.path.exists(local_binary):
105
+ return local_binary
106
+
107
  return shutil.which("ffmpeg") or "ffmpeg"
108
 
109
  FFMPEG_PATH = find_ffmpeg()