Closed sugizo closed 4 months ago
code
from PIL import Image from imageio_ffmpeg import read_frames, write_frames def rotate_90(image): img = Image.frombytes("RGB", (meta['size'][0], meta['size'][1] ), image) im = img.transpose(Image.ROTATE_90) return np.ascontiguousarray(im) video_file = 'merge_audio_ffmpeg.mp4' fps_v = '10' # 60 for production output_file = 'rotate_90.mp4' reader = read_frames(video_file) meta = reader.__next__() writer = write_frames(output_file, audio_path = video_file, size = meta['size'], fps = meta['fps'], input_params = ['-y', ], output_params = ['-r', fps_v, ] ) writer.send(None) for frame in reader: filter = rotate_90(frame) writer.send(filter) writer.close() IPython.display.Video(output_file, embed = True)
result not expected
https://github.com/imageio/imageio-ffmpeg/assets/2418295/e50f9046-092e-45d2-aabd-59c7b4c0271d
expected result output video rotated 90 degree
how to achieve it using imageio-ffmpeg ?
best regards
I suspect there's something off with the shapes of the frames. I'd recommend reading one frame and checking its shape and appearance at each step, to see where it goes wrong.
code
result not expected
https://github.com/imageio/imageio-ffmpeg/assets/2418295/e50f9046-092e-45d2-aabd-59c7b4c0271d
expected result output video rotated 90 degree
how to achieve it using imageio-ffmpeg ?
best regards