Olympe.video.renderer black screen

when I run any code (for example streaming.py) olympe video renderer is just a black screen. It applies to both - simulated and a real drone. how can i fix it? currently i am trying to run this code

import argparse
import olympe
import os
import re
import sys
import time
from olympe.video.pdraw import Pdraw, PdrawState
from olympe.video.renderer import PdrawRenderer
from olympe.messages.onboard_tracker import start_tracking_engine
from olympe.video import HudType


DRONE_IP = os.environ.get("DRONE_IP", "192.168.42.1")
DRONE_RTSP_PORT = os.environ.get("DRONE_RTSP_PORT", "554")


def main(argv):
    parser = argparse.ArgumentParser(description="Olympe Pdraw Example")
    parser.add_argument(
        "-u",
        "--url",
        default=f"rtsp://{DRONE_IP}:{DRONE_RTSP_PORT}/live",
        help=(
            "Media resource (rtsp:// or file://) URL.\n"
            "See olympe.Pdraw.play documentation"
        ),
    )
    parser.add_argument("-m", "--media-name", default="DefaultVideo")
    args = parser.parse_args(argv)

    drone_ip = re.search(r"\d+\.\d+\.\d+\.\d+", args.url)

    drone = olympe.Drone(drone_ip.group())
    drone.connect()
    drone(start_tracking_engine(box_proposals=True)).wait()

    pdraw = Pdraw()
    pdraw.play(url=args.url, media_name=args.media_name)
    renderer = PdrawRenderer(pdraw=pdraw, hud_type=HudType.TRACKING)
    assert pdraw.wait(PdrawState.Playing, timeout=5)
    if args.url.endswith("/live"):
        # Let's see the live video streaming for 10 seconds
        time.sleep(10)
        pdraw.close()
        timeout = 5
    else:
        # When replaying a video, the pdraw stream will be closed automatically
        # at the end of the video
        # For this is example, this is the replayed video maximal duration:
        timeout = 90

    drone.disconnect()
    assert pdraw.wait(PdrawState.Closed, timeout=timeout)
    renderer.stop()
    pdraw.destroy()


def test_pdraw():
    main([])


if __name__ == "__main__":
    main(sys.argv[1:])   

Thats what i get:

2025-04-01 15:06:10,811 [INFO]  olympe.drone.ANAFI Ai 003426 - _disconnection_impl - disconnected from device: b'192.168.42.1'
2025-04-01 15:06:10,812 [INFO]  olympe.drone.ANAFI Ai 003426 - disconnect - Disconnection with the device OK. IP: b'192.168.42.1'
2025-04-01 15:06:10,814 [INFO]  olympe.pdraw.ANAFI Ai 003426 - _destroy_pomp_loop - Pomp loop has been destroyed: Thread-4
2025-04-01 15:06:10,818 [INFO]  olympe.drone.ANAFI Ai 003426 - _on_device_removed - <olympe.arsdkng.cmd_itf.DisconnectedEvent object at 0x7ceb689ef4c0>
2025-04-01 15:06:10,820 [INFO]  olympe.media - _websocket_event_reader - websocket closed
2025-04-01 15:06:11,376 [ERROR]         olympe.video.renderer - _cleanup - Deferred cleanup action are still pending after 3.0s
2025-04-01 15:06:11,376 [WARNING]       olympe.video.renderer - _cleanup - Futures still running: 1
2025-04-01 15:06:11,377 [INFO]  olympe.video.renderer - _destroy_pomp_loop - Pomp loop has been destroyed: Thread-7
2025-04-01 15:06:11,379 [INFO]  olympe.pdraw - _destroy_pomp_loop - Pomp loop has been destroyed: Thread-6
2025-04-01 15:06:11,382 [INFO]  olympe.pdraw - _astop_resp - _stop_resp called 0
2025-04-01 15:06:11,384 [INFO]  olympe.pdraw - _astop_resp - _stop_resp called 0
2025-04-01 15:06:11,800 [INFO]  olympe.pdraw - _destroy_pomp_loop - Pomp loop has been destroyed: Thread-5
2025-04-01 15:06:11,928 [INFO]  olympe.drone.ANAFI Ai 003426 - _on_device_removed - <olympe.arsdkng.cmd_itf.DisconnectedEvent object at 0x7ceb68d4a520>
2025-04-01 15:06:11,931 [INFO]  olympe.media - _destroy_pomp_loop - Pomp loop has been destroyed: Thread-3
2025-04-01 15:06:11,931 [INFO]  olympe.scheduler - _destroy_pomp_loop - Pomp loop has been destroyed: subscribers_thread
2025-04-01 15:06:12,133 [INFO]  olympe.backend - _destroy_pomp_loop - Pomp loop has been destroyed: Thread-2

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

If the camera of your drone is working through:

  • FreeFlight7
  • or a media player such as VLC or MPV

[try :point_down:

mpv --no-cache --profile=low-latency -v --rtsp-transport=udp rtsp://192.168.42.1:554/live

or

vlc rtsp://192.168.42.1:554/live

]

and the media requested are well selected (the associated “_select_media” are seen in logs),
but not media are added (no “_media_added” in logs), this means that the ports creation is blocked in the setup the user is testing.

In that case, it can either be because of the configuration of your non- or- virtual environment, which prevents port creation that Olympe and its deps need to work.
Or it can be caused by your firewall, if you use one. In that case, deactivate it so that the frames sent by the drone can be well received

1 Like

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