Yaroslav
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,20 +1,16 @@
|
|
1 |
-
import
|
2 |
import gradio as gr
|
3 |
-
import subprocess
|
4 |
|
5 |
def increase_fps(input_video_path, target_fps=60):
|
6 |
output_path = "output.mp4"
|
7 |
|
8 |
-
#
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
# Выполнение команды
|
17 |
-
subprocess.run(command, check=True)
|
18 |
|
19 |
return output_path
|
20 |
|
@@ -26,7 +22,7 @@ interface = gr.Interface(
|
|
26 |
inputs=gr.Video(label="Загрузите видео для обработки"),
|
27 |
outputs=gr.Video(label="Видео с увеличенным FPS"),
|
28 |
title="Увеличение FPS до 60",
|
29 |
-
description="Этот инструмент увеличивает частоту кадров видео до 60 FPS с использованием
|
30 |
examples=[]
|
31 |
)
|
32 |
|
|
|
1 |
+
import ffmpeg
|
2 |
import gradio as gr
|
|
|
3 |
|
4 |
def increase_fps(input_video_path, target_fps=60):
|
5 |
output_path = "output.mp4"
|
6 |
|
7 |
+
# Использование FFmpeg для продвинутой интерполяции движения
|
8 |
+
(
|
9 |
+
ffmpeg
|
10 |
+
.input(input_video_path)
|
11 |
+
.output(output_path, vf=f"fps={target_fps},minterpolate='mi_mode=mci:mc_mode=aobmc:vsbmc=1:fps={target_fps}'", an=None)
|
12 |
+
.run(overwrite_output=True)
|
13 |
+
)
|
|
|
|
|
|
|
14 |
|
15 |
return output_path
|
16 |
|
|
|
22 |
inputs=gr.Video(label="Загрузите видео для обработки"),
|
23 |
outputs=gr.Video(label="Видео с увеличенным FPS"),
|
24 |
title="Увеличение FPS до 60",
|
25 |
+
description="Этот инструмент увеличивает частоту кадров видео до 60 FPS с использованием продвинутой интерполяции движения. Загрузите видео с низким FPS, чтобы получить плавный результат.",
|
26 |
examples=[]
|
27 |
)
|
28 |
|