Spaces:
Running
on
Zero
Running
on
Zero
Update app/utils.py
#4
by
ElenaRyumina
- opened
- app/utils.py +3 -7
app/utils.py
CHANGED
|
@@ -294,15 +294,11 @@ class ASRModel:
|
|
| 294 |
|
| 295 |
return texts, total_text
|
| 296 |
|
| 297 |
-
|
| 298 |
def convert_webm_to_mp4(input_file):
|
|
|
|
| 299 |
|
| 300 |
-
|
| 301 |
|
| 302 |
-
|
| 303 |
-
ff_video = "ffmpeg -i {} -c:v copy -c:a aac -strict experimental {}".format(
|
| 304 |
-
input_file, path_save
|
| 305 |
-
)
|
| 306 |
-
subprocess.call(ff_video, shell=True)
|
| 307 |
|
| 308 |
return path_save
|
|
|
|
| 294 |
|
| 295 |
return texts, total_text
|
| 296 |
|
|
|
|
| 297 |
def convert_webm_to_mp4(input_file):
|
| 298 |
+
path_save = os.path.splitext(input_file)[0] + ".mp4"
|
| 299 |
|
| 300 |
+
ff_video = "ffmpeg -i {} -c:v libx264 -c:a aac -strict experimental {}".format(input_file, path_save)
|
| 301 |
|
| 302 |
+
subprocess.run(ff_video, shell=True, check=True, capture_output=True, text=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 303 |
|
| 304 |
return path_save
|