Instructional Material: Video Feed

Printer-friendly version

The Tello drone supports sending a video feed from it's forward facing camera over the network connection back to your program. Receiving the video feed and processing it is a complex programming task and requires familiarity with the OpenCV image and video processing library. Fortunately, the Tello-SDK packages video feed processing into easy to use methods that allow you to display the feed on your PC (for a drone's eye view), take still pictures and record the feed to a video file.

These video features are controlled by methods on the TelloCamera class. To use the feed you must first call the TelloControl.streamOn() method. This commands the drone to turn on it's video feed. The feed is off at drone power on. Next you call the TelloCamera.startVideoCapture() method. This starts the Tello-SDK background thread that monitors the video feed on the network and makes the images sent by the drone available for use by your program. The startVideoCapture() method has a boolean parameter. If this parameter is true, the SDK will open a window on your PC and display the live feed from the drone. Note that starting video capture with live display window can take several seconds.

With the feed being captured, you can call TelloCamera.takePicture() method to capture the current feed image to a file on your PC. You can call startRecording() to capture the stream into a video file on your PC. These files are stored in the Photos folder inside the Tello-SDK project folder.

You can call setStatusBar() to display a limited amout of text at the bottom of the live video window. See the documentation for more details.

The Demo5 example program demonstrates all of this. Modify the Main class by commenting out the code that runs Demo4 and uncommenting the lines that run Demo5. Take a look at the Demo5 code and then run it with the green arrow button. 

One final note: In the console logging, you will see some amount of debugging information logged by the OpenCV library looking something like this:

[h264 @ 1559efc0] non-existing PPS 0 referenced
[h264 @ 1559efc0] non-existing PPS 0 referenced
[h264 @ 1559efc0] decode_slice_header error
[h264 @ 1559efc0] no frame!
[h264 @ 1559efc0] non-existing PPS 0 referenced
[h264 @ 1559efc0] non-existing PPS 0 referenced
[h264 @ 1559efc0] decode_slice_header error
[h264 @ 1559efc0] no frame!
[h264 @ 1559efc0] non-existing PPS 0 referenced
[h264 @ 1559efc0] non-existing PPS 0 referenced
[h264 @ 1559efc0] decode_slice_header error
[h264 @ 1559efc0] no frame!

This is due to an issue in the OpenCV library conversion to the Windows OS that was done for this project. This output can be ignored. We hope to eliminate this output in the future.

 

Material Type: 
Lab Activity
Education Level: 
HW Platform: 
SW Platform: 
Interactivity Style: 
Audience: