Issue on thermal video streaming through PDrAW

Hi there, we are working on PDrAW with anafi USA currently. our aim is using the PDrAW to provide the video streaming to our website. We are able to get the video from visible camera but failed on thermal camera. Does any can know how to using PDrAW to get the thermal video stream? thank you!

Hello,
There are 2 modes for thermal video: post-processing on or off. With post-processing on, the blending is done in the FreeFlight app. With post-processing off, the blending is done by the drone. Off is the mode you need. Also the drone must be switched from visible to thermal video mode.
Both these settings can be set through FreeFlight, of by using an app based on GroundSDK or Olympe. But PDrAW handles only the video and cannot send commands to the drone.

Hi Akaaba,

Thank you for your prompt reply. Could you help to provide the olympe SDK function which allow us to set the post-processing flag and switch from visible to thermal.

Thank you so much

You can find the thermal commands on this page: Thermal feature - 7.7
The set_mode function is what you are looking for: DISABLED is for visible mode, and post-processing ‘off’ is BLENDED.

Hi, I tried to change the video stream to thermal and I can see thermal video stream from RTSP. However, The PDrAW is thrown exception after the change. Do I need to add any other setting for the PDrAW? thanks!

Hello,

There should not be any other setting needed. Could you please share the logs from PDrAW including the crash? (here or by PM)

Hi, thanks for your reply. We are using the pdraw.py which provide by the github

and we create another script to change the video stream during the video is streaming. the scripit as below
import argparse
import olympe
import os
import sys
import time
from olympe.video.pdraw import Pdraw, PdrawState
from olympe.video.renderer import PdrawRenderer
from olympe.messages.thermal import set_mode,mode
from olympe.messages.ardrone3.PilotingState import AlertStateChanged

DRONE_IP = os.environ.get(“DRONE_IP”, “192.168.53.1”)
DRONE_RTSP_PORT = os.environ.get(“DRONE_RTSP_PORT”, “554”)

def main(argv):
drone = olympe.Drone(DRONE_IP)
drone.connect()
drone(set_mode(2)).wait()
drone.disconnect()
print(drone.get_state(mode))

def test_pdraw():
main([])

if name == “main”:
main(sys.argv[1:])

please find below steps.

  1. we run the pdraw.py
  2. video is show on the screen
  3. we run the script to change the mode to BLENDED
  4. the video stop and console show below error
2023-08-23 14:17:26,004 [INFO] olympe.pdraw - _create_pomp_loop - Creating pomp loop
2023-08-23 14:17:26,004 [INFO] olympe.pdraw - _create_pomp_loop - Creating pomp loop
2023-08-23 14:17:26,005 [INFO] olympe.pdraw - _pdraw_new - Pdraw interface has been created
2023-08-23 14:17:26,006 [INFO] olympe.pdraw - _open_url - Opening pdraw url OK: b’rtsp://192.168.53.1:554/live’
2023-08-23 14:17:26,008 [INFO] olympe.pdraw - _select_media - _select_media: idx=0 media_id=1 name=DefaultVideo default=True
2023-08-23 14:17:26,036 [INFO] olympe.pdraw - _ready_to_play - _ready_to_play(1) called
2023-08-23 14:17:26,056 [INFO] olympe.video.renderer - _create_pomp_loop - Creating pomp loop
2023-08-23 14:17:26,408 [ERROR] ulog - pdraw_sink - VideoDecoder#3: coded video media format H264/AVCC not supported
2023-08-23 14:17:26,408 [INFO] olympe.pdraw - _media_added - _media_added id : 1
2023-08-23 14:17:26,410 [INFO] olympe.pdraw - _media_added - _media_added id : 2
2023-08-23 14:17:27,225 [INFO] olympe.pdraw - _media_added - _media_added id : 3
2023-08-23 14:17:35,590 [ERROR] olympe.pdraw - _unrecoverable_error - _unrecoverable_error() → pdraw teardown…
2023-08-23 14:17:35,590 [INFO] olympe.pdraw - _video_sink_flush_impl - mbuf_coded/raw_video_frame_queue_flush(): Success
2023-08-23 14:17:35,590 [INFO] olympe.pdraw - _video_sink_flush_impl - mbuf_coded/raw_video_frame_queue_flush(): Success
2023-08-23 14:17:35,590 [INFO] olympe.pdraw - _video_sink_flush_impl - mbuf_coded/raw_video_frame_queue_flush(): Success
2023-08-23 14:17:35,590 [ERROR] ulog - rtsp_client - send_teardown:341: err=22(Invalid argument)
2023-08-23 14:17:35,590 [ERROR] ulog - pdraw_dmxstrm - stop:1177: StreamDemuxerNet#1: rtsp_client_teardown err=22(Invalid argument)
2023-08-23 14:17:35,591 [ERROR] olympe.pdraw - _unrecoverable_error - _unrecoverable_error() → pdraw teardown done
2023-08-23 14:17:35,591 [INFO] olympe.pdraw - _ready_to_play - _ready_to_play(0) called
2023-08-23 14:17:35,594 [INFO] olympe.pdraw - _media_removed - _media_removed called id : 3
2023-08-23 14:17:35,594 [ERROR] olympe.pdraw - _media_removed_impl - pdraw_video_sink for media_id 3 has already been stopped
2023-08-23 14:17:35,594 [INFO] olympe.pdraw - _media_removed - _media_removed called id : 1
2023-08-23 14:17:35,594 [ERROR] olympe.pdraw - _media_removed_impl - pdraw_video_sink for media_id 1 has already been stopped
2023-08-23 14:17:35,594 [INFO] olympe.pdraw - _media_removed - _media_removed called id : 2
2023-08-23 14:17:35,594 [ERROR] olympe.pdraw - _media_removed_impl - pdraw_video_sink for media_id 2 has already been stopped

Maybe I missed some setting or anything. please help to point out. thank you so much.

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

I would say that the initial stream stops following the camera switch to thermal (which is normal), but then is never restarted. A new pdraw stream should be restarted after the switch.

Thank you. You are saying " A new pdraw stream should be restarted after the switch." Would you be able to tell us the functions required for this?

Hi @m.arthur,

I think the best way to do set_mode() it’s to stop your pdraw instance before changing the mode and restart your pdraw instance. It’s easier to do that in the same python script. Take a look at our streaming example. You can simply add a simple function to change the mode:

    def change_camera_mode(self, mode):
        self.drone.streaming.stop()
        self.drone(set_mode(mode)).wait()
        self.drone.streaming.start()

Regards,
Axel

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.