Adding "capture device gadget" for FPV in GCS
« on: October 23, 2016, 03:40:53 am »
Hi, i hope it's okay to request a feature!

In the flight data view, why don't we have a gadget which shows video from a chosen capture device?
In that way users can get their FPV livefeed directly in their GCS via a USB capture dongle. You could even do a video gadget with the PFD as an overlay!

Best Regards
Morten

hwh

  • *
  • 1018
Re: Adding "capture device gadget" for FPV in GCS
« Reply #1 on: October 23, 2016, 05:59:13 am »
One of the developers is already working on captured video behind the PFD.  It won't make it into the release that's in progress (16.09) but probably will in a later release.

benm

  • *
  • 3
Re: Adding "capture device gadget" for FPV in GCS
« Reply #2 on: December 28, 2016, 11:34:34 am »
Recently, I had study PDF code and try to add this FPV function.
Although I am new in qt/qml, how can I join to develop? 

f5soh

  • *****
  • 4007
    • LibrePilot
Re: Adding "capture device gadget" for FPV in GCS
« Reply #3 on: December 28, 2016, 11:58:39 am »
Hi,

If you want to take a look, the work in progress is here:
https://bitbucket.org/filnet/librepilot/branch/video_wip

Uses gstreamer and a video capture device can be used as PFD background.
Not rebased with current next for now, should be updated soon.

See also this page from Wiki:
https://librepilot.atlassian.net/wiki/display/LPDOC/Git+Workflow

You will find other information about build environment in the same place.
« Last Edit: December 28, 2016, 12:28:42 pm by f5soh »

filnet

  • *****
  • 93
Re: Adding "capture device gadget" for FPV in GCS
« Reply #4 on: December 28, 2016, 05:32:00 pm »
I am working on adding video background to PFD and on a independent video gadget.
Both are based on gstreamer and are sort of working.

The big chunk of work that remains to be done is related to distribution (i.e. packaging all the needed dependencies) for all OSes.
There are some issues with Linux where Qt also uses gstreamer and conflicts with the one I am using.

My hope is to have something in the next major release (sometimes next year...).

benm

  • *
  • 3
Re: Adding "capture device gadget" for FPV in GCS
« Reply #5 on: January 04, 2017, 08:50:15 am »
Hi filnet

I tried your code on my mac and  fixed some gstreamer dependency.
But video widget is black(sometimes flash test video in the beginning), no error in logs
Any suggestion?

logs:
VideoWidget::createPipelineFromDesc - creating pipeline : videotestsrc  ! videoconvert ! video/x-raw,width=640,height=480  ! osxvideosink"
"VideoWidget::handleMessage - element osxvideosink2 prepare window with id #4521595376"
VideoWidget::event - "pipeline6 changed state from Null to Ready"
VideoWidget::event - "element osxvideosink2 prepare window id"
VideoWidget::event - "src stream status Create videotestsrc5"
VideoWidget::event - "src stream status Enter videotestsrc5"
VideoWidget::event - "pipeline6 changed state from Ready to Paused"
VideoWidget::event - "pipeline6 has new clock GstSystemClock"
VideoWidget::event - "pipeline6 changed state from Paused to Playing"
"VideoWidget::pause - videotestsrc  ! videoconvert ! video/x-raw,width=640,height=480  ! osxvideosink"
"VideoWidget::init - reseting pipeline state : videotestsrc  ! videoconvert ! video/x-raw,width=640,height=480  ! osxvideosink"
VideoWidget::event - "pipeline6 changed state from Playing to Paused"
"VideoWidget::start - videotestsrc  ! videoconvert ! video/x-raw,width=640,height=480  ! osxvideosink"
"VideoWidget::init - reseting pipeline state : videotestsrc  ! videoconvert ! video/x-raw,width=640,height=480  ! osxvideosink"
VideoWidget::event - "pipeline6 changed state from Paused to Playing"
"VideoWidget::stop - videotestsrc  ! videoconvert ! video/x-raw,width=640,height=480  ! osxvideosink"
"VideoWidget::dispose - videotestsrc  ! videoconvert ! video/x-raw,width=640,height=480  ! osxvideosink"
VideoWidget::event - "pipeline6 changed state from Playing to Paused"
VideoWidget::event - "src stream status Leave videotestsrc5"
VideoWidget::event - "pipeline6 changed state from Paused to Ready"
"VideoWidget::dispose - videotestsrc  ! videoconvert ! video/x-raw,width=640,height=480  ! osxvideosink"
VideoWidget::VideoWidget
"VideoWidget::VideoWidget - video winId : 4696952128"
"VideoWidget::setPipelineDesc - videotestsrc  ! videoconvert ! video/x-raw,width=640,height=480  ! osxvideosink"
"VideoWidget::stop - "
"VideoWidget::dispose - "
"VideoWidget::start - videotestsrc  ! videoconvert ! video/x-raw,width=640,height=480  ! osxvideosink"
"VideoWidget::init - initializing pipeline : videotestsrc  ! videoconvert ! video/x-raw,width=640,height=480  ! osxvideosink"
"VideoWidget::createPipelineFromDesc - creating pipeline : videotestsrc  ! videoconvert ! video/x-raw,width=640,height=480  ! osxvideosink"
"VideoWidget::handleMessage - element osxvideosink3 prepare window with id #4696952128"
VideoWidget::event - "pipeline7 changed state from Null to Ready"
VideoWidget::event - "element osxvideosink3 prepare window id"
VideoWidget::event - "src stream status Create videotestsrc6"
VideoWidget::event - "src stream status Enter videotestsrc6"
VideoWidget::event - "pipeline7 changed state from Ready to Paused"
VideoWidget::event - "pipeline7 has new clock GstSystemClock"
VideoWidget::event - "pipeline7 changed state from Paused to Playing"
VideoWidget::event - "element osxvideosink3 sent warning event: A lot of buffers are being dropped. (gstbasesink.c(2834): gboolean gst_base_sink_is_too_late(GstBaseSink *, GstMiniObject *, GstClockTime, GstClockTime, GstClockReturn, GstClockTimeDiff, gboolean) (): /GstPipeline:pipeline7/GstOSXVideoSink:osxvideosink3:\nThere may be a timestamping problem, or this computer is too slow.)"
VideoWidget::event - "element osxvideosink3 sent warning event: A lot of buffers are being dropped. (gstbasesink.c(2834): gboolean gst_base_sink_is_too_late(GstBaseSink *, GstMiniObject *, GstClockTime, GstClockTime, GstClockReturn, GstClockTimeDiff, gboolean) (): /GstPipeline:pipeline7/GstOSXVideoSink:osxvideosink3:\nThere may be a timestamping problem, or this computer is too slow.)"
VideoWidget::event - "element osxvideosink3 sent warning event: A lot of buffers are being dropped. (gstbasesink.c(2834): gboolean gst_base_sink_is_too_late(GstBaseSink *, GstMiniObject *, GstC

filnet

  • *****
  • 93
Re: Adding "capture device gadget" for FPV in GCS
« Reply #6 on: January 04, 2017, 09:26:44 am »
Hi benm,

As far as I know the gstreamer stuff has never been tested on osx.
My dev platform is windows and linux (sometimes...).
Nice to know someone is looking at osx  :)

Can you tell which version of gstreamer you are using ?
Can you run a command line test with gst-launch-1.0 videotestsrc ! autovideosink and report how it works.
You can also try this simpler pipeline in GCS.


karla

  • ****
  • 261
Re: Adding "capture device gadget" for FPV in GCS
« Reply #7 on: January 04, 2017, 10:12:05 am »
Filnet and Benm, just keep on going, this feature is sooooo much wanted!

filnet

  • *****
  • 93
Re: Adding "capture device gadget" for FPV in GCS
« Reply #8 on: January 04, 2017, 06:17:17 pm »
The video_wip branch is quite old and lags quite a bit w/r to next...
It also has unpushed stuff that I will push tonight.

Not sure it will help with the osx issue though... so please try out the things I suggested.

Benm, if you wish so, please PM me your email and I'll invite you to LP slack.