williamfzc / stagesepx

detect stages in video automatically
MIT License
432 stars 125 forks source link

video preload size error #132

Closed williamfzc closed 4 years ago

williamfzc commented 4 years ago
from stagesepx import toolbox

with toolbox.video_capture("./demo.mp4") as cap:
    size = toolbox.get_frame_size(cap)
    print(size)

    _, frame = cap.read()
    print(frame.shape)

output:

(720, 1440)
(1440, 720, 3)

reversed.

williamfzc commented 4 years ago
video_path = "../demo.mp4"
video = VideoObject(video_path)
hook = CompressHook(target_size=(600, 800))
save_hook = FrameSaveHook(target_dir="okokk")
video.add_preload_hook(hook)
video.add_preload_hook(save_hook)
video.load_frames()

actual size is correct. log is incorrect.

williamfzc commented 4 years ago

0.14.2