Update app.py
Browse files
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 |
-
"-
|
|
|
|
| 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",
|