Yaroslav
Update app.py
efa0609 verified
raw
history blame
1.21 kB
import ffmpeg
import gradio as gr
def increase_fps(input_video_path, target_fps=60):
output_path = "output.mp4"
# Использование FFmpeg для продвинутой интерполяции движения
(
ffmpeg
.input(input_video_path)
.output(output_path, vf=f"fps={target_fps},minterpolate='mi_mode=mci:mc_mode=aobmc:vsbmc=1:fps={target_fps}'", an=None)
.run(overwrite_output=True)
)
return output_path
def process_video(video_path):
return increase_fps(video_path)
interface = gr.Interface(
fn=process_video,
inputs=gr.Video(label="Загрузите видео для обработки"),
outputs=gr.Video(label="Видео с увеличенным FPS"),
title="Увеличение FPS до 60",
description="Этот инструмент увеличивает частоту кадров видео до 60 FPS с использованием продвинутой интерполяции движения. Загрузите видео с низким FPS, чтобы получить плавный результат.",
examples=[]
)
if __name__ == "__main__":
interface.launch()