Streaming.py not working

Hi I’m using streaming.py example to modify and apply object detection, Drone takes off and follow the move commands but there is no live stream here is the code, i’m on Olympe 7.1.0 and using python3.8 and ubuntu 20 is the machine i’m testing this on. What am i missing ?

Class OlympeStreaming(threading.Thread):
    def __init__(self,drone,**kwargs):
        kwargs['group']=None
        self.drone = drone
        self.frame_queue = queue.Queue()
        self.flush_queue_lock = threading.Lock()
        self.frame_num = 0
        self.renderer = None
        super().__init__()
        super().start()


    def start(self):
        self.drone.streaming.server_addr = "192.168.42.1:554"

        # Setup your callback functions to do some live video processing
        self.drone.streaming.set_callbacks(
            raw_cb=self.yuv_frame_cb,
            h264_cb=self.h264_frame_cb,
            start_cb=self.start_cb,
            end_cb=self.end_cb,
            flush_raw_cb=self.flush_cb,
        )
        # Start video streaming
        self.drone.streaming.start()
        self.renderer = PdrawRenderer(pdraw=self.drone.streaming)
        self.running=True

    def stop(self):
        if self.renderer is not None:
            self.renderer.stop()
        # Properly stop the video stream and disconnect
        self.drone.streaming.stop()
 def run(self):
        main_thread = next(
            filter(lambda t: t.name == "MainThread", threading.enumerate())
        )
        while main_thread.is_alive():
            with self.flush_queue_lock:
                try:
                    print("in try to get frame from queue")
                    yuv_frame = self.frame_queue.get(timeout=0.1)
                except queue.Empty:
                    print("empty")
                    continue
                try:
                    print("trying to dispplay frame")
                    self.display_frame(yuv_frame)
                except Exception as e:
                    print(e)
                finally:
                    # Don't forget to unref the yuv frame. We don't want to
                    # starve the video buffer pool
                    yuv_frame.unref()

I put in print statements in run to see if frame is empty and turns out it is.

n try to get frame from queue
2022-06-15 20:27:56,371 [ERROR] 	ulog - vdec_ffmpeg - av: cu->cuInit(0) failed
2022-06-15 20:27:56,372 [ERROR] 	ulog - vdec_ffmpeg - av:  -> CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
2022-06-15 20:27:56,372 [ERROR] 	ulog - vdec_ffmpeg - av: 
2022-06-15 20:27:56,373 [ERROR] 	ulog - vdec_ffmpeg - create:1216: av_hwdevice_ctx_create err=1313558101(Unknown error 1313558101)
2022-06-15 20:27:56,373 [ERROR] 	ulog - pdraw_vdec - start:176: VideoDecoder#5: vdec_new err=1313558101(Unknown error 1313558101)
2022-06-15 20:27:56,373 [ERROR] 	ulog - pdraw_session - addDecoderForMedia:2001: decoder->start err=1313558101(Unknown error 1313558101)
2022-06-15 20:27:56,373 [ERROR] 	ulog - pdraw_session - onOutputMediaAdded:1742: addDecoderForMedia err=1313558101(Unknown error 1313558101)
2022-06-15 20:27:56,373 [INFO] 	olympe.pdraw.ANAFI-G055619 - _media_added - _media_added id : 2
empty
in try to get frame from queue
empty
in try to get frame from queue
empty
in try to get frame from queue
empty
in try to get frame from queue
empty
in try to get frame from queue
empty
in try to get frame from queue

This topic was automatically closed after 30 days. New replies are no longer allowed.