Skip to content

Commit 69fcad7

Browse files
committed
fix sync bug in ffmpeg command
1 parent e275df7 commit 69fcad7

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/cheese3d/cheese3d/synchronize/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def synchronize_videos(pipeline_cfg: SyncConfig,
237237
threshold=pipeline_cfg.led_threshold,
238238
peak_algorithm=pipeline_cfg.led_peak_algorithm,
239239
crop=ref_crop)
240-
align_params = {"ref": (ref_video, 0, fps)}
240+
align_params = {}
241241
for view, (video, crop) in videos.items():
242242
target_reader = VideoSyncReader(source=video,
243243
sample_rate=fps,

packages/cheese3d/cheese3d/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ def dlc_folder_to_components(folder: str | Path):
139139
def synchronize_video_ffmpeg(videos, start_offset = 0, fps = None):
140140
for video in videos:
141141
if start_offset > 0:
142-
filter_args = f"[0:v]select='gt(n\,{start_offset})'[trim];[trim]"
142+
filter_args = f"[0:v]select='gt(n\,{start_offset})'[out]"
143143
else:
144-
filter_args = "[0:v]"
144+
filter_args = "[0:v]null[out]"
145145
if fps is not None:
146146
input_fps = ["-r", f"{100 * fps/100}/1"]
147147
output_fps = ["-r", "100/1"]
@@ -165,7 +165,7 @@ def synchronize_video_ffmpeg(videos, start_offset = 0, fps = None):
165165
video
166166
])
167167
if cmd.returncode:
168-
raise RuntimeError("Failed to get video resolution "
168+
raise RuntimeError("Failed to run ffmpeg sync "
169169
f"(return code = {cmd.returncode}, "
170170
f"args = {cmd.args})")
171171

0 commit comments

Comments
 (0)