Spaces:
Running
on
T4
Running
on
T4
Fix MP4 overwrite
Browse files- modules/user_history.py +1 -1
modules/user_history.py
CHANGED
@@ -478,7 +478,7 @@ def _add_metadata(file_location: Path, metadata: Dict[str, Any]) -> Path:
|
|
478 |
# Use ffmpeg to add metadata to the video file
|
479 |
metadata_args = [f"{key}={value}" for key, value in metadata.items()]
|
480 |
ffmpeg_metadata = ":".join(metadata_args)
|
481 |
-
ffmpeg_cmd = f'ffmpeg -i "{file_location}" -i "{wav_file_location}" -map 0:v:0 -map 1:a:0 -c:v copy -c:a aac -metadata "{ffmpeg_metadata}" "{file_location}"'
|
482 |
subprocess.run(ffmpeg_cmd, shell=True, check=True)
|
483 |
|
484 |
# Remove temporary WAV file
|
|
|
478 |
# Use ffmpeg to add metadata to the video file
|
479 |
metadata_args = [f"{key}={value}" for key, value in metadata.items()]
|
480 |
ffmpeg_metadata = ":".join(metadata_args)
|
481 |
+
ffmpeg_cmd = f'ffmpeg -y -i "{file_location}" -i "{wav_file_location}" -map 0:v:0 -map 1:a:0 -c:v copy -c:a aac -metadata "{ffmpeg_metadata}" "{file_location}"'
|
482 |
subprocess.run(ffmpeg_cmd, shell=True, check=True)
|
483 |
|
484 |
# Remove temporary WAV file
|