TheChesireCat
commited on
Commit
·
4ca3799
1
Parent(s):
1c5da7d
Yes
Browse files
app.py
CHANGED
@@ -74,15 +74,15 @@ def streamlit_video_detect(uploaded_file, centerface, threshold, replacewith, ma
|
|
74 |
|
75 |
# Empty the progress bar after completion
|
76 |
my_bar.empty()
|
77 |
-
os.system(f"ffmpeg -y -i {processed_video_temp_path} -c:v libx264 {processed_video_temp_path}")
|
78 |
# If keep_audio is checked, use FFmpeg to overlay the original audio on the processed video
|
79 |
if keep_audio:
|
80 |
st.write("Overlaying audio. Please wait...")
|
81 |
-
command = f"ffmpeg -i {processed_video_temp_path} -i {temp_video_path} -c:v copy -c:a aac -strict experimental {output_with_audio_temp_path}"
|
82 |
os.system(command)
|
83 |
return output_with_audio_temp_path
|
84 |
else:
|
85 |
-
return processed_video_temp_path
|
86 |
|
87 |
|
88 |
def streamlit_image_detect(uploaded_file, centerface, threshold, replacewith, mask_scale, ellipse, draw_scores, enable_preview, keep_metadata, replaceimg=None, mosaicsize=20):
|
|
|
74 |
|
75 |
# Empty the progress bar after completion
|
76 |
my_bar.empty()
|
77 |
+
os.system(f"ffmpeg -y -i {processed_video_temp_path} -c:v libx264 {processed_video_temp_path.split('.')[0]}_processed_.mp4")
|
78 |
# If keep_audio is checked, use FFmpeg to overlay the original audio on the processed video
|
79 |
if keep_audio:
|
80 |
st.write("Overlaying audio. Please wait...")
|
81 |
+
command = f"ffmpeg -i {processed_video_temp_path.split('.')[0]}_processed_.mp4 -i {temp_video_path} -c:v copy -c:a aac -strict experimental {output_with_audio_temp_path}"
|
82 |
os.system(command)
|
83 |
return output_with_audio_temp_path
|
84 |
else:
|
85 |
+
return f"{processed_video_temp_path.split('.')[0]}_processed_.mp4"
|
86 |
|
87 |
|
88 |
def streamlit_image_detect(uploaded_file, centerface, threshold, replacewith, mask_scale, ellipse, draw_scores, enable_preview, keep_metadata, replaceimg=None, mosaicsize=20):
|