# Video Streaming

## Video Streaming

> Streaming media is multimedia that is constantly received by and presented to an end-user while being delivered by a provider. [Wikipedia](https://en.wikipedia.org/wiki/Streaming_media)

## Video Streaming :: Camera

> **Logitech HD PRO WEBCAM C920** *Full 1080p high definition, H.264 video compression.* [Homepage](https://www.logitech.com/en-us/product/hd-pro-webcam-c920)

## Video Streaming :: GStreamer

> *GStreamer is a library for constructing graphs of media-handling components. The applications it supports range from simple Ogg/Vorbis playback, audio/video streaming to complex audio (mixing) and video (non-linear editing) processing. Applications can take advantage of advances in codec and filter technology transparently. Developers can add new codecs and filters by writing a simple plugin with a clean, generic interface* [Homepage](https://www.slideshare.net/rodrigo_costa/gstreamer-an-overview)

* [Gstreamer: An Overview](https://www.slideshare.net/rodrigo_costa/gstreamer-an-overview)
* [UVC H264 Encoding Cameras Support in GStreamer](https://github.com/matthiasbock/gstreamer-phone/wiki/GStreamer-support-for-the-UVC-for-H.264-encoding-cameras)
* <https://stackoverflow.com/questions/46219454/how-to-open-a-gstreamer-pipeline-from-opencv-with-videowriter>

## Video Streaming :: GStreamer :: Localhost Video Test Source

**Video Receiver**

```bash
user@workstation:~$ gst-launch-1.0 udpsrc port=5600 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! avdec_h264 ! autovideosink fps-update-interval=1000 sync=false
```

Test with **Video Test Source**

```bash
user@workstation:~$ gst-launch-1.0 videotestsrc ! video/x-raw,width=640,height=480 ! videoconvert ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=5600
```

## Video Streaming :: GStreamer :: Localhost Video Test Source Ball

Test with **Video Test Source Ball**

```bash
user@workstation:~$ gst-launch-1.0 videotestsrc pattern=ball ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=5600
```

## Video Streaming :: GStreamer :: QGroundControl Video Test Source

1. QGroundControl Settings
2. QGroundControl Settings -> General
3. QGroundControl Settings -> General -> Video

```bash
Video Source: UDP Video Stream
UDP Port: 5600
Aspect Ratio: 1.77777
Grid Lines: Hide
```

Stream **Video Test Source**

```bash
user@workstation:~$ gst-launch-1.0 videotestsrc ! video/x-raw,width=640,height=480 ! videoconvert ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=5600
```

## Video Streaming :: GStreamer :: QGroundControl Video Test Source Ball

Stream **Video Test Source Ball**

```bash
user@workstation:~$ gst-launch-1.0 videotestsrc pattern=ball ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=5600
```

## Video Streaming :: GStreamer :: QGroundControl V4L2 Source

> **Video4Linux** *V4L for short, is a collection of device drivers and an API for supporting realtime video capture on Linux systems.\[1] It supports many USB webcams, TV tuners, and related devices, standardizing their output, so programmers can easily add video support to their applications. MythTV, tvtime and TVHeadend are typical applications that use the V4L framework.* [Wikipedia](https://en.wikipedia.org/wiki/Video4Linux)

QGroundControl Setup

1. QGroundControl Settings
2. QGroundControl Settings -> General
3. QGroundControl Settings -> General -> Video

```bash
Video Source: UDP Video Stream
UDP Port: 5600
Aspect Ratio: 1.77777
Grid Lines: Hide
```

Stream **Camera V4L2 Driver Input**&#x20;

```bash
user@workstation:~$ gst-launch-1.0 v4l2src ! video/x-raw,width=640,height=480 ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=5600
```
