Code Monkey home page Code Monkey logo

docker-ffmpeg-service's Introduction

ffmpeg web service API

An web service for converting audio/video files using Nodejs, Express and FFMPEG

Based off of jrottenberg/ffmpeg container

Endpoints

POST /mp3 - Convert audio file in request body to mp3

POST /mp4 - Convert video file in request body to mp4

POST /jpg - Convert image file to jpg

GET /, /readme - Web Service Readme

/mp3, /m4a

Curl Ex:

curl -F "[email protected]" 127.0.0.1:3000/mp3 > output.mp3

curl -F "[email protected]" 127.0.0.1:3000/mp3 > output.mp3

curl -F "[email protected]" 127.0.0.1:3000/mp4 > output.mp4

curl -F "[email protected]" 127.0.0.1:3000/mp4 > output.mp4

curl -F "[email protected]" 127.0.0.1:3000/jpg > output.jpg

curl -F "[email protected]" 127.0.0.1:3000/jpg > output.jpg

Configuration and New Endpoints

You can change the ffmpeg conversion settings or add new endpoints by editing the /app/endpoints.js file

Installation

Requires local Node and FFMPEG installation.

  1. Install FFMPEG https://ffmpeg.org/download.html

  2. Install node https://nodejs.org/en/download/ Using homebrew:

$ brew install node

Dev - Running Local Node.js Web Service

Navigate to project directory and:

Install dependencies:

$ npm install

Start app:

$ node app.js

Check for errors with ESLint:

$ ./node_modules/.bin/eslint .

Running Local Docker Container

Build Docker Image from Dockerfile with a set image tag. ex: docker-ffpmeg

$ docker build -t surebert/docker-ffpmeg .

Launch Docker Container from Docker Image, exposing port 9025 on localhost only

docker run -d
--name ffmpeg-service
--restart=always
-v /storage/tmpfs:/usr/src/app/uploads
-p 127.0.0.1:9025:3000
surebert/docker-ffpmeg

Launch Docker Container from Docker Image, exposing port 9026 on all IPs

docker run -p 9025:3000 -d surebert/docker-ffpmeg

docker-ffmpeg-service's People

Contributors

pvrpccc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.