def iterate_frames(self, *, frame_filter: Iterable[int]) -> Iterable[av.VideoFrame]:
        "frame_ids must be an ordered sequence in the ascending order"

        frame_filter_iter = iter(frame_filter)
        next_frame_filter_frame = next(frame_filter_iter, None)
        if next_frame_filter_frame is None:
            return

        start_decode_frame_number, start_decode_timestamp = self._get_nearest_left_key_frame(
            next_frame_filter_frame
        )

        with self._read_av_container() as container:
            video_stream = container.streams.video[0]
            if self.allow_threading:
                video_stream.thread_type = 'AUTO'
            else:
                video_stream.thread_type = 'NONE'

            container.seek(offset=start_decode_timestamp, stream=video_stream)

            frame_counter = itertools.count(start_decode_frame_number)
            with closing(self._decode_stream(container, video_stream)) as stream_decoder:
                for frame, frame_number in zip(stream_decoder, frame_counter):
                    if frame_number == next_frame_filter_frame:
                        if video_stream.metadata.get('rotate'):
                            frame = av.VideoFrame().from_ndarray(
                                rotate_image(
                                    frame.to_ndarray(format='bgr24'),
                                    360 - int(video_stream.metadata.get('rotate'))
                                ),
                                format ='bgr24'
                            )

                        yield frame

                        next_frame_filter_frame = next(frame_filter_iter, None)

                    if next_frame_filter_frame is None:
                        return
frame_ids must be an ordered sequence in the ascending order
cvat/apps/engine/media_extractors.py