eikarna
commited on
Commit
Β·
d2b9e4e
1
Parent(s):
f4a8588
fix(app): refactor code
Browse files
app.py
CHANGED
|
@@ -59,8 +59,8 @@ with gr.Blocks(title="FFmo - FFmpeg Online", theme=gr.themes.Soft()) as main:
|
|
| 59 |
with gr.Row():
|
| 60 |
with gr.Column() as inp_si:
|
| 61 |
input_fps = gr.Slider(1, 144, value=60, label="Frame Per Second (FPS)", info="Choose between 1 and 144 Fps")
|
| 62 |
-
input_preset = gr.Dropdown(["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow"], value=
|
| 63 |
-
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=
|
| 64 |
input_video = gr.Video(label="Input Video")
|
| 65 |
input_textbox = gr.Textbox(label="FFMPEG Command")
|
| 66 |
buildcmd = gr.Button("Build FFMPEG Command", variant="primary").click(fn=cmdb_si, inputs=[input_fps,input_preset,input_tune], outputs=[input_textbox])
|
|
@@ -76,8 +76,8 @@ with gr.Blocks(title="FFmo - FFmpeg Online", theme=gr.themes.Soft()) as main:
|
|
| 76 |
with gr.Row():
|
| 77 |
with gr.Column() as inp_fb:
|
| 78 |
input_fps2 = gr.Slider(1, 144, value=60, label="Frame Per Second (FPS)", info="Choose between 1 and 144 Fps")
|
| 79 |
-
input_preset2 = gr.Dropdown(["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow"], value=
|
| 80 |
-
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=
|
| 81 |
input_video2 = gr.Video(label="Input Video")
|
| 82 |
input_textbox2 = gr.Textbox(label="FFMPEG Command")
|
| 83 |
buildcmd2 = gr.Button("Build FFMPEG Command", variant="primary").click(fn=cmdb_fb, inputs=[input_fps2,input_preset2,input_tune2], outputs=[input_textbox2])
|
|
@@ -92,8 +92,8 @@ with gr.Blocks(title="FFmo - FFmpeg Online", theme=gr.themes.Soft()) as main:
|
|
| 92 |
with gr.TabItem("Advanced"):
|
| 93 |
with gr.Row():
|
| 94 |
with gr.Column() as inp_main:
|
| 95 |
-
input_preset3 = gr.Dropdown(["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow"], value=
|
| 96 |
-
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=
|
| 97 |
input_video3 = gr.Video(label="Input Video")
|
| 98 |
input_textbox3 = gr.Textbox(label="FFMPEG Command")
|
| 99 |
buildcmd3 = gr.Button("Build FFMPEG Command", variant="primary").click(fn=cmdb_adv, inputs=[input_preset3,input_tune3], outputs=[input_textbox3])
|
|
|
|
| 59 |
with gr.Row():
|
| 60 |
with gr.Column() as inp_si:
|
| 61 |
input_fps = gr.Slider(1, 144, value=60, label="Frame Per Second (FPS)", info="Choose between 1 and 144 Fps")
|
| 62 |
+
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.")
|
| 63 |
+
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")
|
| 64 |
input_video = gr.Video(label="Input Video")
|
| 65 |
input_textbox = gr.Textbox(label="FFMPEG Command")
|
| 66 |
buildcmd = gr.Button("Build FFMPEG Command", variant="primary").click(fn=cmdb_si, inputs=[input_fps,input_preset,input_tune], outputs=[input_textbox])
|
|
|
|
| 76 |
with gr.Row():
|
| 77 |
with gr.Column() as inp_fb:
|
| 78 |
input_fps2 = gr.Slider(1, 144, value=60, label="Frame Per Second (FPS)", info="Choose between 1 and 144 Fps")
|
| 79 |
+
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.")
|
| 80 |
+
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")
|
| 81 |
input_video2 = gr.Video(label="Input Video")
|
| 82 |
input_textbox2 = gr.Textbox(label="FFMPEG Command")
|
| 83 |
buildcmd2 = gr.Button("Build FFMPEG Command", variant="primary").click(fn=cmdb_fb, inputs=[input_fps2,input_preset2,input_tune2], outputs=[input_textbox2])
|
|
|
|
| 92 |
with gr.TabItem("Advanced"):
|
| 93 |
with gr.Row():
|
| 94 |
with gr.Column() as inp_main:
|
| 95 |
+
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.")
|
| 96 |
+
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")
|
| 97 |
input_video3 = gr.Video(label="Input Video")
|
| 98 |
input_textbox3 = gr.Textbox(label="FFMPEG Command")
|
| 99 |
buildcmd3 = gr.Button("Build FFMPEG Command", variant="primary").click(fn=cmdb_adv, inputs=[input_preset3,input_tune3], outputs=[input_textbox3])
|