ayush77uh commited on
Commit
37cffdd
·
verified ·
1 Parent(s): 102069a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -110,11 +110,13 @@ def stream_video(video_path):
110
 
111
  # Using ffmpeg-static or system ffmpeg
112
  # -re read input at native frame rate (crucial for streaming)
 
113
  cmd = [
114
  "ffmpeg",
115
  "-re",
116
  "-i", video_path,
117
- "-c:v", "libx264", "-preset", "veryfast", "-b:v", "4000k", "-maxrate", "4000k", "-bufsize", "8000k",
 
118
  "-pix_fmt", "yuv420p", "-g", "60",
119
  "-c:a", "aac", "-b:a", "128k", "-ar", "44100",
120
  "-f", "flv",
 
110
 
111
  # Using ffmpeg-static or system ffmpeg
112
  # -re read input at native frame rate (crucial for streaming)
113
+ # Reduced to 720p @ 2500k for stability
114
  cmd = [
115
  "ffmpeg",
116
  "-re",
117
  "-i", video_path,
118
+ "-vf", "scale=1280:720",
119
+ "-c:v", "libx264", "-preset", "veryfast", "-b:v", "2500k", "-maxrate", "2500k", "-bufsize", "5000k",
120
  "-pix_fmt", "yuv420p", "-g", "60",
121
  "-c:a", "aac", "-b:a", "128k", "-ar", "44100",
122
  "-f", "flv",