Public | Automated Build

Last pushed: 3 years ago
Short Description
Short description is empty for this repo.
Full Description


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\":\"\"}

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",
 "command": "java -jar /usr/local/vod-transcoder/vod-transcoder.jar --configJson=<replace-with-base64-encoded-json>",
 "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\":\"\"}'"
    make docker-run DOCKER_ARGS="--configJson='{\"source\":\"\"}'"
    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.

Docker Pull Command
Source Repository