patocolher commited on
Commit
02c981a
Β·
verified Β·
1 Parent(s): 6e588e5

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -194,7 +194,8 @@ def reencode_video(
194
  yield None, "❌ Nenhum vΓ­deo enviado!"
195
  return
196
 
197
- input_path = "input.mp4"
 
198
  output_path = "output_reencoded.mp4"
199
  shutil.copy(video_file, input_path)
200
 
@@ -490,7 +491,16 @@ with gr.Blocks(title="Super Re-Encoder", theme=gr.themes.Soft(),
490
  # ══════════════ 1) UPLOAD ═════════════════════════════════════
491
  with gr.Group():
492
  gr.Markdown("### 1 Β· Envie o vΓ­deo")
493
- video = gr.Video(label="Arquivo de vΓ­deo", sources=["upload"], height=280)
 
 
 
 
 
 
 
 
 
494
 
495
  # ══════════════ 2) VÍDEO ═════════════════════════════════════
496
  with gr.Accordion("2 Β· ConfiguraΓ§Γ΅es de vΓ­deo", open=True):
 
194
  yield None, "❌ Nenhum vΓ­deo enviado!"
195
  return
196
 
197
+ ext = os.path.splitext(video_file)[1].lower() or ".mp4"
198
+ input_path = f"input{ext}"
199
  output_path = "output_reencoded.mp4"
200
  shutil.copy(video_file, input_path)
201
 
 
491
  # ══════════════ 1) UPLOAD ═════════════════════════════════════
492
  with gr.Group():
493
  gr.Markdown("### 1 Β· Envie o vΓ­deo")
494
+ video = gr.Video(
495
+ label="Arquivo de vΓ­deo",
496
+ sources=["upload"],
497
+ height=280,
498
+ file_types=[
499
+ ".mp4", ".mkv", ".avi", ".mov", ".wmv",
500
+ ".flv", ".webm", ".vob", ".ts", ".m2ts",
501
+ ".mpg", ".mpeg", ".m4v", ".3gp",
502
+ ],
503
+ )
504
 
505
  # ══════════════ 2) VÍDEO ═════════════════════════════════════
506
  with gr.Accordion("2 Β· ConfiguraΓ§Γ΅es de vΓ­deo", open=True):