Giter Site home page Giter Site logo

devconf-2019-forks / cloud-native-video-processing Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nickolaev/cloud-native-video-processing

0.0 2.0 0.0 48.9 MB

A sample application to demonstrate video processing in a cloud native way.

License: Other

Makefile 9.34% Go 80.98% Shell 9.67%

cloud-native-video-processing's Introduction

Descritpion

This project implements a Cloud Native Video Processing application named Streamer.

Its core is a thin shim written in Go leveraging the ffmpeg binary for the real video manipulation.

Quick start

Using it is pretty straighforward, just use one of the following guidelines that matches best with your deployment environment.

Local Streamer pipeline

To start a static Streamer pipeline locally, run the following:

./scripts/local.sh

This will expose a set of video processing functions on the following ports:

http://localhost:2000 - the video source
http://localhost:2001 - the video source + the logo
http://localhost:2002 - the video source + the logo + the timestamp
http://localhost:2003 - the video source + the logo + the timestamp + resized to 1366x768

Kubernetes Streamer pipeline

If you are running a local Kubernetes cluster, you can simply build and deploy the images using the following:

make build
make k8s-deploy

Please consult the Docker documentation if you need to export the images and upload them to your Kubernetes cluster image rository.

Istio Streamer pipeline

Similarly to Kubernetes, for Istio a basic local installation is done by executing:

make build
make istio-deploy

More complex setups will require advanced knowledge that is beyond the scope of this Quick Start.

Configuration

Streamer generates the relevant ffmpeg command line options based on its arguments. Currently it supports the following:

  -font string
    	Specify the overlay font to use
  -height int
    	Output video height (default -1)
  -listen
    	Make ffmpeg serve the http connections
  -logo string
    	Overlay the logo file in the top left corner of the video
  -port int
    	The listen port (default 10100)
  -preset string
    	WxH preset. Possible values are:
    	 144p, 240p, 360p, 480p, 720p, HD, WXGA+, HD+, FHD
  -source string
    	The video source
  -text string
    	Specify text to show
  -textfile string
    	Specify the textfile to show
  -timestamp
    	Enable inserting a localtime timestamp
  -width int
    	Output video width (default -1)

Design

The generic video processing setup is depicted in the following figure.

The Streamer is listening for incoming HTTP requests and it spawns a child ffmpeg process that output in the stdout pipe. The content of that pipe is stramed back as an HTTP video stream as a response to the initial HTTP request.

                 +--------------+
       HTTP GET  |              | spawn
     +----------->   Streamer   +--+
                 |              |  |
                 +------^-------+  |
                        |          |
                        |      +---v----+
                        | pipe |        |  HTTP GET
                        +------+ ffmpeg +------------>
                               |        |
                               +--------+

Depending on the command line arguments, the spawned ffmpeg can feed its processing pipeline from a remote HTTP connection, e.g. another Streamer. Optionally it can read a local video stream, a file or other video source.

Copyrights

This project is licensed under the Apache 2.0 license. Please see the main LICENSE.txt for more details.

video.mp4 "Rory and the snow" by Stephen McPolin is Licensed under Public Domain.

bedstead.otf from https://fontlibrary.org/en/font/bedstead Licensed under Public Domain.

cloud-native-video-processing's People

Contributors

rdimitrov avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.