Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ else:
|
|
18 |
globalopt = ["-y", "-hide_banner", "-hwaccel cuda", "-threads 64", "-filter_threads 64", "-filter_complex_threads 64"]
|
19 |
|
20 |
# Function to process data
|
21 |
-
def convert(file, options: str):
|
22 |
output_file=""
|
23 |
video=""
|
24 |
stdout=""
|
@@ -105,6 +105,7 @@ with gr.Blocks(title="FFmo - FFmpeg Online", theme=gr.themes.Soft()) as main:
|
|
105 |
input_preset = gr.Dropdown(["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow"], value=["veryslow"], label="Preset (Required)", info="Semakin lama (slow), semakin bagus hasilnya.")
|
106 |
input_tune = gr.Radio(["film β use for high quality movie content; lowers deblocking", "animation β good for cartoons; uses higher deblocking and more reference frames", "grain β preserves the grain structure in old, grainy film material", "stillimage β good for slideshow-like content", "fastdecode β allows faster decoding by disabling certain filters", "zerolatency β good for fast encoding and low-latency streaming", "psnr β ignore this as it is only used for codec development", "ssim β ignore this as it is only used for codec development"], value=["film β use for high quality movie content; lowers deblocking"], label="Tune (Required)", info="Tuning Setting")
|
107 |
input_video = gr.Video(label="Input Video")
|
|
|
108 |
input_textbox = gr.Textbox(label="FFMPEG Command")
|
109 |
buildcmd = gr.Button("Build FFMPEG Command", variant="primary").click(fn=cmdb_si, inputs=[input_fps,input_preset,input_tune,input_video], outputs=[input_textbox])
|
110 |
# input_video.change()
|
@@ -112,7 +113,7 @@ with gr.Blocks(title="FFmo - FFmpeg Online", theme=gr.themes.Soft()) as main:
|
|
112 |
with gr.Column() as out_si:
|
113 |
output_textbox = gr.Textbox(label="Output Logs", interactive=False)
|
114 |
output_video = gr.Video(label="Output Video", interactive=False)
|
115 |
-
startconv = gr.Button("Start", variant="primary").click(fn=convert, inputs=[
|
116 |
clear_button = gr.ClearButton([input_fps, input_preset, input_tune, input_video, input_textbox, output_textbox, output_video])
|
117 |
|
118 |
with gr.TabItem("Frame Blending"):
|
@@ -122,6 +123,7 @@ with gr.Blocks(title="FFmo - FFmpeg Online", theme=gr.themes.Soft()) as main:
|
|
122 |
input_preset2 = gr.Dropdown(["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow"], value=["veryslow"], label="Preset (Required)", info="Semakin lama (slow), semakin bagus hasilnya.")
|
123 |
input_tune2 = gr.Radio(["film β use for high quality movie content; lowers deblocking", "animation β good for cartoons; uses higher deblocking and more reference frames", "grain β preserves the grain structure in old, grainy film material", "stillimage β good for slideshow-like content", "fastdecode β allows faster decoding by disabling certain filters", "zerolatency β good for fast encoding and low-latency streaming", "psnr β ignore this as it is only used for codec development", "ssim β ignore this as it is only used for codec development"], value=["film β use for high quality movie content; lowers deblocking"], label="Tune (Required)", info="Tuning Setting")
|
124 |
input_video2 = gr.Video(label="Input Video")
|
|
|
125 |
input_textbox2 = gr.Textbox(label="FFMPEG Command")
|
126 |
buildcmd2 = gr.Button("Build FFMPEG Command", variant="primary").click(fn=cmdb_fb, inputs=[input_fps2,input_preset2,input_tune2, input_video2], outputs=[input_textbox2])
|
127 |
|
@@ -138,6 +140,7 @@ with gr.Blocks(title="FFmo - FFmpeg Online", theme=gr.themes.Soft()) as main:
|
|
138 |
input_preset3 = gr.Dropdown(["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow"], value=["veryslow"], label="Preset (Required)", info="Semakin lama (slow), semakin bagus hasilnya.")
|
139 |
input_tune3 = gr.Radio(["film β use for high quality movie content; lowers deblocking", "animation β good for cartoons; uses higher deblocking and more reference frames", "grain β preserves the grain structure in old, grainy film material", "stillimage β good for slideshow-like content", "fastdecode β allows faster decoding by disabling certain filters", "zerolatency β good for fast encoding and low-latency streaming", "psnr β ignore this as it is only used for codec development", "ssim β ignore this as it is only used for codec development"], value=["film β use for high quality movie content; lowers deblocking"], label="Tune (Required)", info="Tuning Setting")
|
140 |
input_video3 = gr.Video(label="Input Video")
|
|
|
141 |
input_textbox3 = gr.Textbox(label="FFMPEG Command")
|
142 |
buildcmd3 = gr.Button("Build FFMPEG Command", variant="primary").click(fn=cmdb_adv, inputs=[input_preset3,input_tune3, input_video3], outputs=[input_textbox3])
|
143 |
|
|
|
18 |
globalopt = ["-y", "-hide_banner", "-hwaccel cuda", "-threads 64", "-filter_threads 64", "-filter_complex_threads 64"]
|
19 |
|
20 |
# Function to process data
|
21 |
+
def convert(file: _TemporaryFileWrapper, options: str):
|
22 |
output_file=""
|
23 |
video=""
|
24 |
stdout=""
|
|
|
105 |
input_preset = gr.Dropdown(["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow"], value=["veryslow"], label="Preset (Required)", info="Semakin lama (slow), semakin bagus hasilnya.")
|
106 |
input_tune = gr.Radio(["film β use for high quality movie content; lowers deblocking", "animation β good for cartoons; uses higher deblocking and more reference frames", "grain β preserves the grain structure in old, grainy film material", "stillimage β good for slideshow-like content", "fastdecode β allows faster decoding by disabling certain filters", "zerolatency β good for fast encoding and low-latency streaming", "psnr β ignore this as it is only used for codec development", "ssim β ignore this as it is only used for codec development"], value=["film β use for high quality movie content; lowers deblocking"], label="Tune (Required)", info="Tuning Setting")
|
107 |
input_video = gr.Video(label="Input Video")
|
108 |
+
print(input_video)
|
109 |
input_textbox = gr.Textbox(label="FFMPEG Command")
|
110 |
buildcmd = gr.Button("Build FFMPEG Command", variant="primary").click(fn=cmdb_si, inputs=[input_fps,input_preset,input_tune,input_video], outputs=[input_textbox])
|
111 |
# input_video.change()
|
|
|
113 |
with gr.Column() as out_si:
|
114 |
output_textbox = gr.Textbox(label="Output Logs", interactive=False)
|
115 |
output_video = gr.Video(label="Output Video", interactive=False)
|
116 |
+
startconv = gr.Button("Start", variant="primary").click(fn=convert, inputs=[input_video,input_textbox], outputs=[output_textbox, output_video])
|
117 |
clear_button = gr.ClearButton([input_fps, input_preset, input_tune, input_video, input_textbox, output_textbox, output_video])
|
118 |
|
119 |
with gr.TabItem("Frame Blending"):
|
|
|
123 |
input_preset2 = gr.Dropdown(["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow"], value=["veryslow"], label="Preset (Required)", info="Semakin lama (slow), semakin bagus hasilnya.")
|
124 |
input_tune2 = gr.Radio(["film β use for high quality movie content; lowers deblocking", "animation β good for cartoons; uses higher deblocking and more reference frames", "grain β preserves the grain structure in old, grainy film material", "stillimage β good for slideshow-like content", "fastdecode β allows faster decoding by disabling certain filters", "zerolatency β good for fast encoding and low-latency streaming", "psnr β ignore this as it is only used for codec development", "ssim β ignore this as it is only used for codec development"], value=["film β use for high quality movie content; lowers deblocking"], label="Tune (Required)", info="Tuning Setting")
|
125 |
input_video2 = gr.Video(label="Input Video")
|
126 |
+
print(input_video2)
|
127 |
input_textbox2 = gr.Textbox(label="FFMPEG Command")
|
128 |
buildcmd2 = gr.Button("Build FFMPEG Command", variant="primary").click(fn=cmdb_fb, inputs=[input_fps2,input_preset2,input_tune2, input_video2], outputs=[input_textbox2])
|
129 |
|
|
|
140 |
input_preset3 = gr.Dropdown(["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow"], value=["veryslow"], label="Preset (Required)", info="Semakin lama (slow), semakin bagus hasilnya.")
|
141 |
input_tune3 = gr.Radio(["film β use for high quality movie content; lowers deblocking", "animation β good for cartoons; uses higher deblocking and more reference frames", "grain β preserves the grain structure in old, grainy film material", "stillimage β good for slideshow-like content", "fastdecode β allows faster decoding by disabling certain filters", "zerolatency β good for fast encoding and low-latency streaming", "psnr β ignore this as it is only used for codec development", "ssim β ignore this as it is only used for codec development"], value=["film β use for high quality movie content; lowers deblocking"], label="Tune (Required)", info="Tuning Setting")
|
142 |
input_video3 = gr.Video(label="Input Video")
|
143 |
+
print(input_video3)
|
144 |
input_textbox3 = gr.Textbox(label="FFMPEG Command")
|
145 |
buildcmd3 = gr.Button("Build FFMPEG Command", variant="primary").click(fn=cmdb_adv, inputs=[input_preset3,input_tune3, input_video3], outputs=[input_textbox3])
|
146 |
|