Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -65,11 +65,19 @@ def create_loop(
|
|
| 65 |
offset = duration - fade_duration
|
| 66 |
|
| 67 |
filter_complex = f"""
|
| 68 |
-
[0:v]
|
| 69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
transition={transition}:
|
| 71 |
duration={fade_duration}:
|
| 72 |
offset={offset},
|
|
|
|
| 73 |
format=yuv420p[v]
|
| 74 |
"""
|
| 75 |
|
|
@@ -81,8 +89,6 @@ def create_loop(
|
|
| 81 |
"-map", "[v]",
|
| 82 |
"-t", str(duration),
|
| 83 |
"-an",
|
| 84 |
-
"-r", str(fps),
|
| 85 |
-
"-vsync", "cfr",
|
| 86 |
"-c:v", "libx264",
|
| 87 |
"-preset", "ultrafast",
|
| 88 |
"-crf", str(crf),
|
|
|
|
| 65 |
offset = duration - fade_duration
|
| 66 |
|
| 67 |
filter_complex = f"""
|
| 68 |
+
[0:v]
|
| 69 |
+
fps={fps},
|
| 70 |
+
format=yuv420p,
|
| 71 |
+
settb=1/{fps},
|
| 72 |
+
setpts=N/({fps}*TB),
|
| 73 |
+
split[v1][v2];
|
| 74 |
+
|
| 75 |
+
[v1][v2]
|
| 76 |
+
xfade=
|
| 77 |
transition={transition}:
|
| 78 |
duration={fade_duration}:
|
| 79 |
offset={offset},
|
| 80 |
+
|
| 81 |
format=yuv420p[v]
|
| 82 |
"""
|
| 83 |
|
|
|
|
| 89 |
"-map", "[v]",
|
| 90 |
"-t", str(duration),
|
| 91 |
"-an",
|
|
|
|
|
|
|
| 92 |
"-c:v", "libx264",
|
| 93 |
"-preset", "ultrafast",
|
| 94 |
"-crf", str(crf),
|