Handle metadata rotation in pyav code. (#13605)
This commit is contained in:
parent
24de8dc01b
commit
13519934ba
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue