something wrong in caling ffmpeg to extract frames

#4
by menglan - opened

hi i visualize the frame extracted from processing_videollama3.py in load_video func,

        out, _ = ffmpeg.run(stream, capture_stdout=True, quiet=not verbose)

        frames_xxx = np.frombuffer(out, np.uint8).reshape([-1, new_h, new_w, 3])
        for ixx, xframe in enumerate(frames_xxx, 1):
            cv2.imwrite("rgb_{}.jpg".format(str(ixx).zfill(3)), xframe)
            cv2.imwrite("bgr_{}.jpg".format(str(ixx).zfill(3)), cv2.cvtColor(xframe, cv2.COLOR_RGB2BGR))
        import pdb; pdb.set_trace()

        frames = np.frombuffer(out, np.uint8).reshape([-1, new_h, new_w, 3]).transpose([0, 3, 1, 2])

the saved image is abnormal, like this

image.png

is it a bug?

Sign up or log in to comment