Spaces:
Configuration error
Configuration error
test-rtechs
commited on
Commit
•
16fd6bc
1
Parent(s):
62c1993
Update app_rvc.py
Browse files- app_rvc.py +11 -1
app_rvc.py
CHANGED
@@ -7,6 +7,7 @@ os.system("pip install -q -r requirements_xtts.txt")
|
|
7 |
os.system("pip install -q TTS==0.21.1 --no-deps")
|
8 |
os.system("pip install -q yt-dlp")
|
9 |
os.system("pip install -q moviepy")
|
|
|
10 |
import spaces
|
11 |
import torch
|
12 |
if os.environ.get("ZERO_GPU") != "TRUE" and torch.cuda.is_available():
|
@@ -284,6 +285,13 @@ def check_openai_api_key():
|
|
284 |
"translation process in Advanced settings."
|
285 |
)
|
286 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
def download_and_adjust_youtube_video(url, speed_factor, start_time=None, end_time=None):
|
288 |
# Create the 'downloaded' folder if it doesn't exist
|
289 |
os.makedirs("downloaded", exist_ok=True)
|
@@ -321,11 +329,13 @@ def download_and_adjust_youtube_video(url, speed_factor, start_time=None, end_ti
|
|
321 |
# Run FFmpeg command
|
322 |
try:
|
323 |
logger.info(f"Running FFmpeg command: {' '.join(ffmpeg_cmd)}")
|
324 |
-
subprocess.run(ffmpeg_cmd, check=True, capture_output=True, text=True)
|
|
|
325 |
logger.info(f"Video processing completed: {output_filename}")
|
326 |
except subprocess.CalledProcessError as e:
|
327 |
logger.error(f"Error processing video: {e}")
|
328 |
logger.error(f"FFmpeg stderr: {e.stderr}")
|
|
|
329 |
raise
|
330 |
|
331 |
return output_filename
|
|
|
7 |
os.system("pip install -q TTS==0.21.1 --no-deps")
|
8 |
os.system("pip install -q yt-dlp")
|
9 |
os.system("pip install -q moviepy")
|
10 |
+
os.system("pip install -q ffmpeg-python")
|
11 |
import spaces
|
12 |
import torch
|
13 |
if os.environ.get("ZERO_GPU") != "TRUE" and torch.cuda.is_available():
|
|
|
285 |
"translation process in Advanced settings."
|
286 |
)
|
287 |
|
288 |
+
import os
|
289 |
+
import subprocess
|
290 |
+
import yt_dlp
|
291 |
+
import logging
|
292 |
+
|
293 |
+
logger = logging.getLogger(__name__)
|
294 |
+
|
295 |
def download_and_adjust_youtube_video(url, speed_factor, start_time=None, end_time=None):
|
296 |
# Create the 'downloaded' folder if it doesn't exist
|
297 |
os.makedirs("downloaded", exist_ok=True)
|
|
|
329 |
# Run FFmpeg command
|
330 |
try:
|
331 |
logger.info(f"Running FFmpeg command: {' '.join(ffmpeg_cmd)}")
|
332 |
+
result = subprocess.run(ffmpeg_cmd, check=True, capture_output=True, text=True)
|
333 |
+
logger.info(f"FFmpeg stdout: {result.stdout}")
|
334 |
logger.info(f"Video processing completed: {output_filename}")
|
335 |
except subprocess.CalledProcessError as e:
|
336 |
logger.error(f"Error processing video: {e}")
|
337 |
logger.error(f"FFmpeg stderr: {e.stderr}")
|
338 |
+
logger.error(f"FFmpeg stdout: {e.stdout}")
|
339 |
raise
|
340 |
|
341 |
return output_filename
|