alptangall commited on
Commit
29cca5b
1 Parent(s): 51b63f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -22
app.py CHANGED
@@ -16,28 +16,10 @@ import gradio as gr
16
 
17
  def greet(name):
18
  return "Hello " + name + "!!"
19
- def start_livestream(video_path):
20
- ffmpeg_command = [
21
- "ffmpeg",
22
- "-re",
23
- "-stream_loop", "-1",
24
- "-i", video_path,
25
- "-c:v", "libx264",
26
- "-preset", "veryfast",
27
- "-maxrate", "3000k",
28
- "-bufsize", "6000k",
29
- "-pix_fmt", "yuv420p", # Đảm bảo định dạng pixel được hỗ trợ
30
- "-vf", "format=yuv420p", # Chuyển đổi video đầu vào sang yuv420p
31
- "-g", "50",
32
- "-c:a", "aac",
33
- "-b:a", "128k",
34
- "-ar", "44100",
35
- "-f", "flv",
36
- f"rtmp://a.rtmp.youtube.com/live2/agmy-bsya-r9j1-up14-fcj0"
37
- ]
38
- print('beginning')
39
- subprocess.run(ffmpeg_command)
40
 
41
  if __name__ == "__main__":
42
- start_livestream('video1.mp4')
 
 
 
43
 
 
16
 
17
  def greet(name):
18
  return "Hello " + name + "!!"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  if __name__ == "__main__":
21
+ process = subprocess.run(['python','/home/user/app/main.py'], stdout=subprocess.PIPE)
22
+ demo = gr.Interface(fn=greet, inputs="text", outputs="text")
23
+ demo.launch(server_name="0.0.0.0", server_port=7860)
24
+ print('starting')
25