-
Notifications
You must be signed in to change notification settings - Fork 413
Closed
Description
Hi!
I'm reading frames from a mp4 HEVC video in yuv422p10le format, i.e. 10bit color depth, to numpy.
I get a ndarray with dtype uint16 which I expected but I thought there would only be at most 2^10=1024 different unique values in the frame, but I get about 60000 different values. Is this expected? What am I missing?
This is my code:
import av
import numpy as np
# Read hevc video in yuv422p10le format
with av.open("video.mp4") as container:
frame = next(container.decode(video=0))
np_frame = frame.to_ndarray(format="rgb48")
print(container.streams.video[0].pix_fmt) # >>> yuv422p10le
print(np_frame.dtype) # >>> uint16
print(np.unique(np_frame)) # >>> [ 0 1 2 ... 65498 65527 65535]
print(len(np.unique(np_frame))) # >>> 58702 (expected <= 1024 differnte values for yuv422p10le)Thanks!
Metadata
Metadata
Assignees
Labels
No labels