Made some chanages and now Can't remmebr what I did

This commit is contained in:
2026-07-23 04:55:36 +00:00
parent c8d645e9bd
commit 83303b3548
12 changed files with 518 additions and 415 deletions
+2 -8
View File
@@ -2,6 +2,7 @@
import os
import subprocess
import whisper
import linux
from moviepy import VideoFileClip
from whisper.utils import get_writer
@@ -15,15 +16,8 @@ def extract_audio(video_path: str, audio_temp_path: str):
# -map_chapters -1 removes chapter layouts that break the parser.
# -sn strips text/subtitle streams that crash MoviePy.
# -c copy copies video and audio instantly without quality loss.
cleanup_cmd = [
"ffmpeg", "-y", "-i", video_path,
"-map_chapters", "-1", "-sn",
"-c", "copy", sanitized_video_path
]
linux.run_command(f"ffmpeg -y -i {video_path} -map_chapters -1 -sn -c copy {sanitized_video_path}")
# Run the sanitization process silently
subprocess.run(cleanup_cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
print("Extracting uncompressed WAV audio...")
try:
# Load the sanitized file instead of the raw Twitch clip