Made some chanages and now Can't remmebr what I did
This commit is contained in:
+2
-8
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user