try to get fps from gif if possible
@@ -127,6 +127,7 @@ cdef class Tiler:
cdef bint success
cdef np.ndarray[NPUINT8_t, ndim=3] frame
cdef int frame_counter = 0
+ cdef int fps = int(video_capture.get(cv2.CAP_PROP_FPS) or 15)
try:
with open(video_fp, "wb+") as video_file:
@@ -156,7 +157,7 @@ cdef class Tiler:
pass
cdef object out_bytes_io = io.BytesIO()
- imageio.mimwrite(out_bytes_io, out_frames, format="gif")
+ imageio.mimwrite(out_bytes_io, out_frames, format="gif", fps=fps)
out_bytes_io.seek(0)
with open("heh.gif", "wb+") as f:
