I'm trying to record a video from the OAK-D camera. I found the example code at https://github.com/luxonis/depthai-python/blob/main/examples/VideoEncoder/rgb_encoding.py but when I run it the script will just hang on line 35. The comment on that line mentions that it is blocking waiting for data. The camera is connected and seems to be running and recording. What exactly is it waiting for? How is this program suppose to be run? Thank you.

  • erik replied to this.

    Hello mjwhite2529 ,
    Are you running it in the debug mode, so you can view the progress? I would assume the app wouldn't work the same way in debug mode, so could you also try running without debug? If you already are running the app, could you copy the console log and check if there is a .h265 (which got recorded)?
    Thanks, Erik

      erik I'm running this script on a Raspberry Pi and it gets stuck on the following line:
      h265Packet.getData().tofile(videoFile)
      The .h265 file gets created but has zero bytes.

      I tried it on a Macbook and the script runs without problems and creates the .h265 file.

      • erik replied to this.

        mjwhite2529 What happens when you do ctrl+c, is there any error, does the script even finish? Could you copy the full console log?
        Thanks, Erik

          erik When I do ctrl+c the script doesn't end since it never gets to the "except KeyboardInterrupt:" clause. I have to issue a kill -TERM on the process. The console log just has:

          $ python3 rgb_encoding.py
          C C

          After doing the kill -TERM I end up with a zero byte video.h265 file since nothing ever gets written to it. This only happens on the Raspberry Pi. Everything works properly on my Macbook.