Git Product home page Git Product logo

ffmpeg-vod-transcoder's Introduction

ffmpeg-vod-transcoder

A micro-service with Springboot and Docker used to transcode a single video file in multiple formats, in the cloud.

Running the transcoding job manually

docker run --rm=true --volume=${HOME}/tmp/streamkit:/tmp/streamkit \
    ddragosd/ffmpeg-vod-transcoder:latest --configJson={\"source\":\"http://s3.footagesearch.com/demos/naturefootage/Q4/OF-04-Fish-Demo-Q4.mp4\"}

Running the transcoding job in Chronos

This microservice is built to be executed once for every file that needs to be transcoded. Chronos is a nice way to schedule jobs if you're using Mesos. Chronos is a fault tolerant distributed scheduler for jobs that includes ISO8601 support and dependency based job scheduling.

To start a job in Chronos make a POST request to http://<master>:4400/scheduler/iso8601 with body:

{ 
 "schedule": "R1//PT2M",
 "name": "transcoding-sample-footage-2",
 "container": {
   "type": "DOCKER",
   "image": "ddragosd/ffmpeg-vod-transcoder:latest",
   "network":"BRIDGE"
 },
 "command": "java -jar /usr/local/vod-transcoder/vod-transcoder.jar --configJson=<replace-with-base64-encoded-json>",
 "shell":"false",
 "cpus": "3",
 "mem": "4096"
}

The current command was tested with Chronos 2.3.3 framework and Mesos 0.22.0.

Developer guide

To build the microservice simply issue:

    make all

This Makefile command will build the java binary, updating the docker container making it ready for execution.

Running the transcoder in Docker

To test with Docker execute:

    make docker-run

To pass extra parameters to the docker container, use DOCKER_ARGS:

    make docker-run DOCKER_ARGS="--configJson='{\"source\":\"http://techslides.com/demos/sample-videos/small.mp4\"}'"
    make docker-run DOCKER_ARGS="--configJson='{\"source\":\"http://s3.footagesearch.com/demos/naturefootage/Q4/OF-04-Fish-Demo-Q4.mp4\"}'"
    make docker-run DOCKER_ARGS=\"--configJson='`cat ./src/main/resources/default_config_2.json`'\ --debug\"

Using Base64 encoded configJson

    make docker-run DOCKER_ARGS=\"--configJson='`cat ./src/main/resources/default_config_2.json | base64`'\"

The result of the encoding is saved into your home folder, under ~/tmp/streamkit/. To test with the same input file multiple times you might need to clean this directory; ffmpeg will not overwrite any files.

ffmpeg-vod-transcoder's People

Contributors

ddragosd avatar

Watchers

 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.