Skip to content

Access side data without decoding the video #793

@mfoglio

Description

@mfoglio

Right now I am accessing the motion vectors in the following way:

container = av.open(
    rtsp_url, 'r',
    options={
        'rtsp_transport': 'tcp',
        'stimeout': '5000000', 
        'max_delay': '5000000', 
    }
)
stream = container.streams.video[0]
codec_context = stream.codec_context
codec_context.export_mvs = True


for packet in container.demux(video=0):
    for video_frame in packet.decode():
        motion_vectors_raw = video_frame.side_data.get('MOTION_VECTORS')

It seems to me that this does decode the video_frame. Is there a way to obtain the motion vectors without having to decode the entire frame? My goal is to reduce the CPU utilization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions