Skip to content

Commit 9dd7330

Browse files
committed
Printing more statistics on console to help understanding which video(s) are not perfectly synchronized.
1 parent f39fe52 commit 9dd7330

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

PythonTools/PostProcessVideos.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,22 @@ def post_process(input_dir: Path, output_dir: Path, threshold_ns: int = DEFAULT_
5555

5656
assert len(clientIDs) == len(trimmed_dataframes), f"Expected {len(clientIDs)} trimmed dataframes. Found f{len(trimmed_dataframes)}"
5757

58+
#
59+
# Check if the number of frames in the dataframe matches with the timestamps between last and first entry
60+
for cID, df in zip(clientIDs, trimmed_dataframes):
61+
diff_info = df['timestamp'].diff().dropna().value_counts()
62+
# print(diff_info)
63+
estimated_step = diff_info.index[0]
64+
first_ts = df['timestamp'].iloc[0]
65+
last_ts = df['timestamp'].iloc[-1]
66+
time_diff = last_ts - first_ts
67+
# print(f"first/last timestamps: {first_ts}/{last_ts}. Diff={time_diff}")
68+
estimated_frames = (time_diff / estimated_step) + 1
69+
print(f"cID {cID}. Size={len(df)}. Diff={time_diff}. Estimated frames={estimated_frames}.")
70+
71+
#
5872
# Check that all the resulting dataframes have the same number of rows
59-
print("Checking if all clients we have the same number of frames in the repaired amd trimmed tables...")
73+
print("Checking if all clients we have the same number of frames in the repaired-and-trimmed tables...")
6074
client0ID = clientIDs[0]
6175
client0size = len(trimmed_dataframes[0])
6276
print(f"Client {client0ID} has {client0size} frames.")

0 commit comments

Comments
 (0)