Issues about the metadata in image frame

Hi, there.

Recently, I noticed one issue about the metadata.

When I read the metadata with vmeta() in the YUV callback function, sometimes the metadata is empty.
It happens here:

   drone_info = yuv_frame.vmeta()
   if drone_info[1] is not None:
          self.frame_quat = Quaternion(drone_info[1]["frame_quat"]["w"],
                                 drone_info[1]["frame_quat"]["x"],
                                  drone_info[1]["frame_quat"]["y"],
                                  drone_info[1]["frame_quat"]["z"])

If I don’t use the if function here, sometimes it will give a warning with None object.

I’m curious about how it happens. Is it caused by the mismatched image frame? Or the connection with the wifi? Or something else?

How to solve this problem? When I increase the frame rate to 60Hz, it happens a lot.

W vstrm: vstrm_rtp_h264_rx_au_complete: mismatch in macroblock ordering: mb_start=3600 mb_end=3600

Does it mean CPU is not enough?

And again, hope to open access to angular velocity and linear acceleration in Anafi soon.

Hi,

If I understand correctly your video source is a live stream from the drone, right?
In that case metadata can be missing from a frame when there has been packets lost on the wifi.
So empty metadata is something that can happen and should be handled in your software.

The warning log you mention means the end of a frame has not been received (packet loss). This is probably not a CPU issue, but more likely the RF environment that is crowded.

Hi,

Thanks for the reply.

Yes, it’s a live video stream.

When the mismatch happened, the image will become very bad. This will cause very big error in visual odomètre. So I really want to kick out the bad frame.

Is there any way to check the completeness of the image or read the warning by using the SDK?

Hi,

the yuv_frame.info() function will return a dictionary of generic information about the frame. This dictionary has two interesting fields (has_error and is_silent) for what you want to do. If any of those field is set to a non-zero value, you should not use the frame for any image processing.

In details, the is_silent flag is set during initialization of the decoder (such frames might have a lot of grey zones), while the has_error flag is set on frames which are impacted (directly or not) by a transmission error.

Regards,
Nicolas.