You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
I see https://libav.org/documentation/doxygen/master/group__lavc__packet.html that libavAVPacket seems to have a function av_packet_get_side_data. Is this somehow available in Python? I have a good Python knowledge but I am quite rusty in C. Would think it would be difficult for me to add it?
Activity
mfoglio commentedon Jun 3, 2021
I see https://libav.org/documentation/doxygen/master/group__lavc__packet.html that
libavAVPacketseems to have a functionav_packet_get_side_data. Is this somehow available in Python? I have a good Python knowledge but I am quite rusty in C. Would think it would be difficult for me to add it?