Giter VIP home page Giter VIP logo

docker-ffmpeg-webm's Introduction

ffmpeg-webm

Built:

2014.12.07

An executable container I built for launching transcoders which consume IP camera streams and transcode to webm for storage and monitoring. This images includes a default mount /data for writing the resulting video out to disk. In my use case, this path is attached via NFS mount to an archival server.

I use this with a number of Cisco 5010, 2520, 2500 and Axis 3301 IP cameras. However, it should work just fine with any number of other IP cameras given the right video_path. If you don't know this information, try searching the manufacturer's docs for "RTSP URL" or "VLC"

Usage:

The script record.sh which is used as an ENTRYPOINT to this image is essential to the function of this image as built. You can see it along with the source Dockerfile over on GitHub.

ozzyjohnson / docker-ffmpeg-webm

Ideally, start by setting some same defaults in the top of record.sh to minimize the number of required command line options. Hopefully, ffmpeg will merge a time/date segmenter at some point and I can do away with some of the ugliness here.

record.sh - default variables section

...

DATE=`date +%Y-%m-%d`
TIME=`date +%H-%M-%S`
CAMERA_USER='user'
CAMERA_PASS='pass'
CAMERA_IP='10.10.10.1'
CAMERA='mycamera'

# Destination for recordings. Directors
DEST_PATH="/data/"
DEST_DIR=$CAMERA

# Duration of segments in seconds.
SEGMENT_DURATION='900'

# Group of Pictures size.
GOP_SIZE='12'

# Output resolution.
RECORDING_RESOLUTION='720x576'

# Path to to the camera stream.
VIDEO_PATH='/stream1'

...

With Defaults:

docker run -it --rm -v /data:/mnt/data ffmpeg-webm

With Options:

docker run -it --rm -v /data:/mnt/data ffmpeg-webm \
  -u camera_user \
  -p camera_password \
  -i camera_ip \
  -n camera_name \
  -s segment_duration \
  -d destination_dir \
  -v video_path \
  -r recording_resolution \
  -g gop_size \
  -o secondary_output

Image on Docker Hub

FFMPEG Build Options:

ffmpeg

--extra-libs=-ldl --enable-gpl --enable-libass --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264

others

--enable-static / --disable-shared

Sources:

Next:

  • It looks like adding date/time functionality to ffmpeg could be a straightforward patch. I'll have to give it a try.
  • record.sh is a quick, direct conversion of the upstart job I'd been using previously, is there a better way?
  • For my purposes, some built in camera templates would be nice, but I'm thinking I'll do this as a new image built from this rather than messing with the base.

docker-ffmpeg-webm's People

Contributors

ozzyjohnson avatar

Watchers

Rizky Eka Vianto avatar James Cloos 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.