APM Planner 2.0 with Video support

Quite awhile ago i added video to APM Planner 2.0. I just updated the branch to master 2.0.24 release.

It can be download and built from this branch. https://github.com/ArduPilot/apm_planner/tree/video-beta

Specific Video instructions are here https://github.com/ArduPilot/apm_planner/tree/video-beta/src/VideoStreaming

Enjoy :slight_smile:

1 Like

Thanks Bill! I’ll post my experiences soon.

On OSX I had to alter Makefile INCPATH from -I/Library/Frameworks/GStreamer.framework/Headers to -I/Library/Frameworks/GStreamer.framework/Versions/1.0/Headers to get past missing gst.h errors.

Now, I get:

In file included from src/VideoStreaming/VideoSurface.cc:31:
In file included from src/VideoStreaming/VideoSurface_p.h:33:
In file included from src/VideoStreaming/VideoSurface.h:33:
In file included from /Users/fnoop/Qt/5.5/clang_64/lib/QtCore.framework/Headers/QObject:1:
In file included from ../../../Qt/5.5/clang_64/lib/QtCore.framework/Headers/qobject.h:41:
/Users/fnoop/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:739:55: error: no type named 'u16string' in namespace 'std'
In file included from src/VideoStreaming/VideoReceiver.cc:30:
In file included from src/VideoStreaming/VideoReceiver.h:33:
In file included from ../../../Qt/5.5/clang_64/lib/QtCore.framework/Headers/QObject:1:
In file included from ../../../Qt/5.5/clang_64/lib/QtCore.framework/Headers/qobject.h:41:
/Users/fnoop/Qt/5.5/clang_64/lib/QtCore.framework/Headers/qstring.h:739:55: error: no type named 'u16string' in namespace 'std'
    static inline QString fromStdU16String(const std::u16string &s);
    static inline QString fromStdU16String(const std::u16string &s);

Changing the default compiler from gcc to clang in QT Creator prefs and then running the compile from QT Creator seems to go better, I had no luck from the command line.
I’m using macOS Sierra, QT 5.5.1, xCode 8.

@fnoop I’m using the Qt.5.6.2 snapshot 436 for macOS 10.12 builds (it beta not release). I’d suggest trying this snapshot first. http://download.qt.io/snapshots/qt/5.6/5.6.2/442/

You need to make sure you clean your build, if you are getting anywhere it would indicate you have prebuilt on OSX 10.11 before updating to macOS 10.12 (sierra)

If using pre-built install of Qt made with clang, you need to use clang. If you download and install gcc you’ll need to rebuild Qt from source (I don’t recommend that unless you up for a challenge!)

I did a fresh pull since I upgraded to 10.12. I think the problem is the instructions in the main README say:

2) Run qmake -spec macx-g++ apm_planner.pro

But most people on OSX will just install xcode so I think this is the correct command for that situation:

qmake -spec macx-clang CONFIG+=x86_64 apm_planner.pro

Oh. Yeah that should just be qmake apm_planner.pro

It doesn’t require the options specified. They are the default. I’ll change that.

Hi, developer !
I already compile & run your project. (supported video with APM Planner 2.0)
I’m using the Qt. 5.7.0.

But, I don’t know that using video mode …
How to use the video mode into APM Planner ?!

If possible, please attach the snap-shot file(image) during run APM Planner with Video mode?!

best regard

I’m using the following command on the RPi3 raspivid -n -t 0 -w 640 -h 360 -fps 24 -b 6000000 -o - | gst-launch-1.0 -e -vvvv fdsrc ! h264parse ! rtph264pay pt=96 config-interval=5 ! udpsink host= port=5000

right click in the PFD and select video (see attached image)

1 Like

I am involved in the GCS development project.
So I tried running the program you uploaded but I could not see the video image.
My RPi3 uses RTSP to provide images at the address of rtsp: //xxx.xxx.xxx.xxx:8554/test.

When you run the program, you can see the following message in the application output that appears: (into QT-Creator)

[20170207 21:38:27.742 DEBUG] - QUrl(“file:///root/dmkimGCS/build-apm_planner-APM_Planner-Debug/debug/qml/PrimaryFlightDisplayQML.qml”)
[20170207 21:38:27.808 WARN ] - file:///root/dmkimGCS/build-apm_planner-APM_Planner-Debug/debug/qml/components/RollPitchIndicator.qml:59:22: Unable to assign [undefined] to VideoSurface*
[20170207 21:38:27.808 WARN ] - file:///root/dmkimGCS/build-apm_planner-APM_Planner-Debug/debug/qml/PrimaryFlightDisplayQML.qml:80: ReferenceError: videoReceiver is not defined
[20170207 21:38:27.808 WARN ] - file:///root/dmkimGCS/build-apm_planner-APM_Planner-Debug/debug/qml/PrimaryFlightDisplayQML.qml:79: ReferenceError: videoDisplay is not defined
[20170207 21:38:27.809 DEBUG] - QML Status: QQuickView::Status(Ready)
[20170207 21:38:27.809 WARN ] - file:///root/dmkimGCS/build-apm_planner-APM_Planner-Debug/debug/qml/PrimaryFlightDisplayQML.qml:80: ReferenceError: videoReceiver is not defined
[20170207 21:38:27.809 ERROR] - Failed to create qtquick2videosink. Make sure it is installed correctly

Could you answer the solution to this problem?

Also, when you run the program, can you show me the Application output message? (To compare with my message …)

I have been working with the help of some previous answers, but I am very sorry to bother you with questions again.

Waiting for an answer … ^^