I am trying to do live video streaming using DJI Tello drone, initially i was able to run same code on windows machine but when i tried on Ubuntu 22 i am not able to get any opencv popup for live streaming.
Here is the output of code :
base) nirbhay@nirbhay:~/Desktop/Tello_code$ python LiveStream.py
[INFO] tello.py - 129 - Tello instance was initialized. Host: '192.168.10.1'. Port: '8889'.
[INFO] tello.py - 438 - Send command: 'command'
[INFO] tello.py - 462 - Response command: 'ok'
Drone Battery Percentage:
100
Live Stream Address:
udp://@0.0.0.0:11111
[INFO] tello.py - 438 - Send command: 'streamon'
[INFO] tello.py - 462 - Response streamon: 'ok'
non-existing PPS 0 referenced
non-existing PPS 0 referenced
decode_slice_header error
no frame!
non-existing PPS 0 referenced
non-existing PPS 0 referenced
decode_slice_header error
no frame!
non-existing PPS 0 referenced
non-existing PPS 0 referenced
decode_slice_header error
no frame!
non-existing PPS 0 referenced
non-existing PPS 0 referenced
decode_slice_header error
no frame!
non-existing PPS 0 referenced
non-existing PPS 0 referenced
decode_slice_header error
no frame!
non-existing PPS 0 referenced
non-existing PPS 0 referenced
decode_slice_header error
no frame!
error while decoding MB 22 30, bytestream 127
error while decoding MB 58 37, bytestream -6
Here is the code:
from djitellopy import tello
import cv2
import time
#import libh264decoder
drone = tello.Tello()
drone.connect()
print("Drone Battery Percentage:")
print(drone.get_battery())
print("Live Stream Address:")
print(drone.get_udp_video_address())
drone.streamon()
while True:
img=drone.get_frame_read().frame
#print("image:",img)
img=cv2.resize(img,(660,420))
cv2.imshow("Image",img)
#time.sleep(3)
cv2.waitKey(1)
#time.sleep(1)
python packages list and version:
djitellopy 2.5.0
opencv-python 4.9.0.80
OS
Ubuntu 22.04.3 LTS