filnet

  • *****
  • 96
New video gadget
« on: July 15, 2017, 01:23:04 pm »
I submitted a PR that adds video to the PFD and a new video gadget to the GCS.

The PR can be found here https://bitbucket.org/librepilot/librepilot/pull-requests/454

There is a readme file in ./ground/gcs/src/libs/gstreamer/ that gives some pointers to building this branch.

A demo video can seen here:


GStreamer is used to view, process, record and eventually stream video from a variety of sources (usb or ip camera, file, network...).
For those who know GStreamer, the new video gadget is more or less a glorified gst-launch.

The GCS video gadget comes with a number of sample GStreamer pipelines. Most of them work on Windows only but can easily be adapted to Linux or Mac.

A few Windows' specific GStreamer elements are used but most pipelines will work if those elements are switched with the corresponding element for the specific platform.

Type  Windows  Linux  Mac
Video capture  ksvideosrc  v4l2src  avfvideosrc
Video display  d3dvideosink  ximagesink  osxvideosink
Screen capture  dx9screencapsrc  ximagesrc  avfvideosrc

You can get information about GStreamer elements with gst-launch-1.0 <element name>

The branch is known to compile and work on Windows, Linux and Mac.
It will work best with the latest GStreamer (1.12.2). Your results may vary if you use an older version of GStreamer (but it should work...).


« Last Edit: September 13, 2017, 09:18:50 pm by filnet »

filnet

  • *****
  • 96
Re: New video gadget
« Reply #1 on: July 15, 2017, 04:37:45 pm »
[reserved]

f5soh

  • *****
  • 4063
    • LibrePilot
Re: New video gadget
« Reply #2 on: September 25, 2017, 11:49:53 pm »
Video gadget is now merged to the development 'next' branch.

LibrePilot-16.09+r522-gd9cce5e_i686.exe  https://drive.google.com/open?id=0B5d_9OcqQj8BOGZmaFF5RnVUck0

Brunosanta

  • **
  • 54
  • I understand it all but know nothing
Re: New video gadget
« Reply #3 on: October 17, 2017, 06:28:50 pm »
could anyone tell what would be the use of it, so I kind of follow?
thank you
Everybody is only optimistic on the social networks.. being real is hard nowadays

filnet

  • *****
  • 96
Re: New video gadget
« Reply #4 on: October 17, 2017, 07:14:21 pm »
could anyone tell what would be the use of it, so I kind of follow?

A simple use case is to display video from the UAV in the PFD. Sexier than the default background.

Another one is to record the video from the UAV to a file.

A more mundane use case is to record a video screen capture of your activity in GCS (for showing a bug, making a tutorial or demo-ing a new feature).

More advanced use cases include:
- receive video from UAV, overlay some information (OSD...) and transmit video to FPV goggles
- receive video from UAV, do some processing (detect faces) and send instructions back to UAV (say "hello")

GStreamer is a very powerful video/audio processing framework.

Your imagination is the limit...

Brunosanta

  • **
  • 54
  • I understand it all but know nothing
Re: New video gadget
« Reply #5 on: October 17, 2017, 07:58:26 pm »
thanks for the answers, its clear now.
Everybody is only optimistic on the social networks.. being real is hard nowadays

karla

  • ****
  • 278
Re: New video gadget
« Reply #6 on: October 18, 2017, 05:38:37 am »
A simple use case is to display video from the UAV in the PFD. Sexier than the default background.
Hi, filnet, do you have a demo of this?
Its not in your first post right?
Thanks

f5soh

  • *****
  • 4063
    • LibrePilot
Re: New video gadget
« Reply #7 on: October 18, 2017, 07:25:57 am »
Here is the video plugin and PFD working with a local USB camera.
The same can be achieved receiving a remote Wifi camera and composite video from FPV receiver using a EasyCap or similar.


karla

  • ****
  • 278
Re: New video gadget
« Reply #8 on: October 23, 2017, 04:58:45 am »
Ah, got to try that :) thanks.

karla

  • ****
  • 278
Re: New video gadget
« Reply #9 on: October 29, 2017, 07:22:43 am »
Hi, not sure this is the right place for this post, but to try this new video capability out I setup the build environment and built the complete LibrePilot Next software on my PC MS windows 10 home edition and installed it. It worked amazingly well the whole process just following the instructions here :)
https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/14876735/Windows+Building+and+Packaging

Now, I also got a small 5.8 gHz usb receiver and plugged it in to the PC usb port and windows installed the drivers for a USB2.0 PC CAMERA and I got a clear image immediately from my quad transmitter camera when I started the Camera app that ships with windows. Amazing.
https://www.banggood.com/Eachine-ROTG01-UVC-OTG-5_8G-150CH-Full-Channel-FPV-Receiver-For-Android-Mobile-Phone-Smartphone-p-1147692.html?rmmds=search
So I know the transmitter and camera and the PC is capable of receiving the video live feed.



But what else do I need to do in LibrePilot GCS to get the video to display in the Video gadget?
I have tried Video|default and Video|USB camera play settings in the Scopes page but just getting the scrambled screen.
Maybe there is a file to ready about this somewhere I missed?

Thanks!


filnet

  • *****
  • 96
Re: New video gadget
« Reply #10 on: October 29, 2017, 12:14:45 pm »
Hi karla,

First thing is that it is not possible to display USB video in more than one PFD/gadget at once (at least not out of the box...).

So please close the PFD or make it display something other than video and make sure you have only one gadget using USB Video.
The gadget has better error reporting than PFD so I suggest to get that working first and then switch to PFD.

So once you got USB video in only one Video gadget please report what you get (screen shot included please).

PS : The USB video restriction (i.e. only one widget can access the usb video) is system wide.
It also applies to other applications accessing the usb video. So make sure you are not visualizing the video from some other app.
« Last Edit: October 29, 2017, 12:40:21 pm by filnet »

karla

  • ****
  • 278
Re: New video gadget
« Reply #11 on: October 29, 2017, 12:41:10 pm »
Hi  :)
okay Now I only have one gadget active,
that is the Scope|Video.
sub command is either | default or | USB camera -Play, does not matter, same result,
no picture.





some other setting I need to attend to?
« Last Edit: October 29, 2017, 12:50:56 pm by karla »

filnet

  • *****
  • 96
Re: New video gadget
« Reply #12 on: October 29, 2017, 12:57:09 pm »
Can you show the content of the video "console" ?

filnet

  • *****
  • 96
Re: New video gadget
« Reply #13 on: October 29, 2017, 01:08:26 pm »
And try this:

Open the "USB Camera - Play" gadget configuration by going to Tools/Options/Video.

There, change the video "pipeline" to "ksvideosrc device-index=0 ! videoconvert ! autovideosink" (without the double quotes).

It will add an extra videoconvert element to the pipeline.

karla

  • ****
  • 278
Re: New video gadget
« Reply #14 on: October 29, 2017, 01:37:03 pm »
Not sure I understand what you need :-\
but here are some screen dumps...
and I changed what you suggested, but no change...