Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix-end-of-stream' into fix-end-…
Browse files Browse the repository at this point in the history
…of-stream
  • Loading branch information
hardiesoft committed Oct 2, 2024
2 parents 537db8c + 3462703 commit d2362ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions python-bindings/examples/python-cptv-decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

start = time.time()
cptv_reader = cptv_rs_python_bindings.CptvReader(
"../../cptv-codec-rs/tests/fixtures/20201221-748923.cptv")
"../../cptv-codec-rs/tests/fixtures/20201221-748923.cptv"
)

reader = cptv_reader.get_header()

print("version:", reader.version)
Expand All @@ -26,18 +28,23 @@

t0 = None
frame_num = 0

frame_none = False
while True:
frame = cptv_reader.next_frame()
if frame is not None:
if t0 is None:
t0 = frame.time_on
frame_num += 1
if not frame.background_frame:
frame_num += 1
print(
f"{frame.time_on - t0} ({frame.time_on}) - ffc: {frame.time_on - frame.last_ffc_time}, min: {frame.pix.min()}, max: {frame.pix.max()}, temp_c: {frame.temp_c}, last_ffc_temp_c: {frame.last_ffc_temp_c}"
)
else:
break
if frame_none:
break
frame_none = True
print("None")


end = time.time()
print(f"{frame_num}, elapsed {end - start}")
2 changes: 1 addition & 1 deletion python-bindings/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ features = ["pyo3/extension-module"]

[project]
name = "python-cptv"
version = "0.0.4"
version = "0.0.6"
authors = [
{ name="Jon Hardie", email="[email protected]" },
{ name = "Giampaolo Feraro", email = "[email protected]"}
Expand Down

0 comments on commit d2362ed

Please sign in to comment.