现在我正在通过以下方式访问运动矢量:
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')
在我看来,这确实解码了 video_frame。有没有办法在不必解码整个帧的情况下获得运动矢量?我的目标是降低 CPU 利用率。