Spaces:
Sleeping
Sleeping
Update utils/video_processing.py
Browse files
utils/video_processing.py
CHANGED
@@ -26,14 +26,14 @@ def trim_video(video_path, max_duration=120):
|
|
26 |
]
|
27 |
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
28 |
if result.returncode != 0:
|
29 |
-
st.error("
|
30 |
os.remove(audio_path) # Clean up failed temp file
|
31 |
st.code(result.stderr.decode())
|
32 |
return None
|
33 |
|
34 |
return audio_path
|
35 |
except Exception as e:
|
36 |
-
st.error(f"
|
37 |
os.remove(audio_path)
|
38 |
st.code(traceback.format_exc())
|
39 |
return None
|
|
|
26 |
]
|
27 |
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
28 |
if result.returncode != 0:
|
29 |
+
st.error("ffmpeg audio extraction failed.")
|
30 |
os.remove(audio_path) # Clean up failed temp file
|
31 |
st.code(result.stderr.decode())
|
32 |
return None
|
33 |
|
34 |
return audio_path
|
35 |
except Exception as e:
|
36 |
+
st.error(f"Error trimming video: {e}")
|
37 |
os.remove(audio_path)
|
38 |
st.code(traceback.format_exc())
|
39 |
return None
|