0

I am wondering if anybody knows if it's possible to use the DJI Windows SDK to decode a video in real-time (render video frames as the video is being retrieved frame-by-frame)? I don't see anything relevant in the documentation or API reference sections from DJI Windows SDK. At this point i'll have to dig into the Samples and see if there is anything useful there. Otherwise the online documentation seems rather useless.

Here is the DJI Windows SDK documention.

AlvinfromDiaspar
  • 6,611
  • 13
  • 75
  • 140

1 Answers1

1

I agree with you that DJI documentation sucks. But again what you are asking is unclear.

  1. use the DJI Windows SDK to decode a video. So u got an-online video and you want to decoded it. Why not use ffmepg and ffplay???? We use that for DJI tello and IP camera all the time.

  2. If you want to grab the feed from the drone, there are DJI github sample that shows you how. https://github.com/DJI-Windows-SDK-Tutorials/Windows-FPVDemo/tree/master/DJIWSDKFPVDemo

So not 100% sure whats your use case.

Dr Yuan Shenghai
  • 1,849
  • 1
  • 6
  • 19
  • I tried using ffmpeg for Tello video stream. But didnt have much success. I would like to draw the incoming video in real-time in a window. Wondering how you achieved this? What specific command did you use for ffmpeg? – AlvinfromDiaspar Mar 20 '20 at 23:03
  • 1
    Send "command" and "streamon" to udp port of the tello 8889. I use the Python Script provided by Ryze to do this https://terra-1-g.djicdn.com/2d4dce68897a46b19fc717f3576b7c6a/Tello%20%E7%BC%96%E7%A8%8B%E7%9B%B8%E5%85%B3/Both/Tello3(1).py , but feel free to use a different program. The tello will now be sending an h264 stream over udp on port 11111. Use the following command to display the stream: ffplay -probesize 32 -i udp://@:11111 -framerate 30 – Dr Yuan Shenghai Mar 22 '20 at 03:21
  • Thank you doc. ffplay will display the stream in a popup window? I was wondering if there is a way to display a single frame of the h264 stream bytes using ffmpeg? This is because i would like to display the stream within an application that i am making. – AlvinfromDiaspar Mar 23 '20 at 15:01
  • 1
    yes. it is pop up window. if you need to code it for AI detection. I would recommend you to use the same argument but in OpenCV. But this need a lot more test. I haven`t done the real time link to OpenCV on tello. only online UDP/rtsp video. but this time you have to use ffmepg for udp handling. you might want to follow this for some idea https://lembergsolutions.com/blog/how-process-live-video-stream-using-ffmpeg-and-opencv. – Dr Yuan Shenghai Mar 23 '20 at 16:37
  • oh another simple walk around is to use ffplayto show the thing in video. And in python, grab the desktop feed as camera feed. Then pass the current frame to any CNN. this method is most easy. https://stackoverflow.com/questions/35097837/capture-video-data-from-screen-in-python – Dr Yuan Shenghai Mar 23 '20 at 16:39
  • Actually, AI detection may come later in the future. Right now I am just trying to render tello video stream to a windows client app frame-by-frame. I am collecting each frame bytes, but i just dont know how to convert the encoded bytes to an image. – AlvinfromDiaspar Mar 24 '20 at 16:35