def METHOD_NAME(self, img: dai.ImgFrame) -> Optional[Tuple[int, int]]:
    enc_packets = self._codec.parse(img.getData())
    if len(enc_packets) == 0:
        return None
    frames = self._codec.decode(enc_packets[-1])
    if not frames:
        return None
    return frames[0].width, frames[0].height