Skip to content

confusion about usage #1875

@SoulProficiency

Description

@SoulProficiency

i try pyav with ascend device(HUAWEI altas NPU) and ascend provides us a example of pulling stream and hard decode.

#-----
video = av.open(self._stream_name)
stream = [s for s in video.streams if s.type == 'video']
for packet in video.demux([stream[0]]):
in_frame_np = np.frombuffer(packet.to_bytes(), np.byte)
size = in_frame_np.size
#-----

this demo will run success with av==11.0.0 but will fail with 12.3.0 and python tell me "AttributeError: 'av.packet.Packet' object has no attribute 'to_bytes'"

how we can do it with new version?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions