Spaces:
Running on Zero
Running on Zero
Commit ·
065a652
1
Parent(s): ae7de9b
Fix: map 0:v:0 explicitly in transcode and mux to skip data/timecode streams
Browse files
app.py
CHANGED
|
@@ -177,7 +177,8 @@ def _transcode_for_browser(video_path: str) -> str:
|
|
| 177 |
kwargs["audio_bitrate"] = "128k"
|
| 178 |
else:
|
| 179 |
kwargs["an"] = None
|
| 180 |
-
|
|
|
|
| 181 |
overwrite_output=True, quiet=True
|
| 182 |
)
|
| 183 |
return out_path
|
|
@@ -315,6 +316,7 @@ def mux_video_audio(silent_video: str, audio_path: str, output_path: str,
|
|
| 315 |
ffmpeg.input(silent_video),
|
| 316 |
ffmpeg.input(audio_path),
|
| 317 |
output_path,
|
|
|
|
| 318 |
vcodec="libx264", preset="fast", crf=18,
|
| 319 |
pix_fmt="yuv420p",
|
| 320 |
acodec="aac", audio_bitrate="128k",
|
|
|
|
| 177 |
kwargs["audio_bitrate"] = "128k"
|
| 178 |
else:
|
| 179 |
kwargs["an"] = None
|
| 180 |
+
# map 0:v:0 explicitly to skip non-video streams (e.g. data/timecode tracks)
|
| 181 |
+
ffmpeg.input(video_path).output(out_path, map="0:v:0", **kwargs).run(
|
| 182 |
overwrite_output=True, quiet=True
|
| 183 |
)
|
| 184 |
return out_path
|
|
|
|
| 316 |
ffmpeg.input(silent_video),
|
| 317 |
ffmpeg.input(audio_path),
|
| 318 |
output_path,
|
| 319 |
+
map=["0:v:0", "1:a:0"],
|
| 320 |
vcodec="libx264", preset="fast", crf=18,
|
| 321 |
pix_fmt="yuv420p",
|
| 322 |
acodec="aac", audio_bitrate="128k",
|