Handle metadata rotation in pyav code. (#13605)

This commit is contained in:
comfyanonymous 2026-04-28 13:27:42 -07:00 committed by GitHub
parent 24de8dc01b
commit 13519934ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -291,6 +291,9 @@ class VideoFromFile(VideoInput):
checked_alpha = True checked_alpha = True
img = frame.to_ndarray(format=image_format) # shape: (H, W, 4) img = frame.to_ndarray(format=image_format) # shape: (H, W, 4)
if frame.rotation != 0:
k = int(round(frame.rotation // 90))
img = np.rot90(img, k=k, axes=(0, 1)).copy()
if alphas is None: if alphas is None:
frames.append(torch.from_numpy(img)) frames.append(torch.from_numpy(img))
else: else: