Simple web API for extracting images from video and converting video files with ffmpeg
10K+
A web service for converting audio/video/image files using FFMPEG.
Based on:
FFMPEG API is provided as Docker image for easy consumption. See the use cases and troubleshooting (catswords-oss.rdbl.io).
GET / - API Readme.GET /endpoints - Service endpoints as JSON.POST /convert/audio/to/mp3 - Convert audio file in request body to mp3. Returns mp3-file.POST /convert/audio/to/wav - Convert audio file in request body to wav. Returns wav-file.POST /convert/video/to/mp4 - Convert video file in request body to mp4. Returns mp4-file.POST /convert/image/to/jpg - Convert image file to jpg. Returns jpg-file.POST /video/extract/audio - Extract audio track from POSTed video file. Returns audio track as 1-channel wav-file.
mono=no - Returns audio track, all channels.POST /video/extract/images - Extract images from POSTed video file as PNG. Default FPS is 1. Returns JSON that includes download links to extracted images.
compress=zip|gzip - Returns extracted images as zip or tar.gz (gzip).fps=2 - Extract images using specified FPS.download=yes - Downloads extracted image file and deletes it from server, immediately.GET /video/extract/download/:filename - Downloads extracted image file and deletes it from server.
delete=no - does not delete file.POST /probe - Probe media file, return JSON metadata.docker build -t ffmpeg-api .docker run -it --rm --name ffmpeg-api -p 3000:3000 ffmpeg-apidocker run -d -name ffmpeg-api -p 3000:3000 ffmpeg-apidocker run -it --rm --name ffmpeg-api -p 3000:3000 gnh1201/ffmpeg-apidocker run -d --name ffmpeg-api -p 3000:3000 gnh1201/ffmpeg-apidocker run -it --rm -p 3000:3000 -e LOG_LEVEL=debug gnh1201/ffmpeg-apidocker run -it --rm -p 3000:3000 -e FILE_SIZE_LIMIT_BYTES=1048576 gnh1201/ffmpeg-apidocker run -it --rm -p 3000:3000 -e KEEP_ALL_FILES=true gnh1201/ffmpeg-apidocker run -it --rm -p 3001:3000 -e EXTERNAL_PORT=3001 gnh1201/ffmpeg-apiInput file to FFMPEG API can be anything that ffmpeg supports. See ffmpeg docs for supported formats (www.ffmpeg.org).
Convert audio/video/image files using the API.
curl -F "[email protected]" 127.0.0.1:3000/convert/audio/to/mp3 > output.mp3curl -F "[email protected]" 127.0.0.1:3000/convert/audio/to/wav > output.wavcurl -F "[email protected]" 127.0.0.1:3000/convert/video/to/mp4 > output.mp4curl -F "[email protected]" 127.0.0.1:3000/convert/videp/to/mp4 > output.mp4curl -F "[email protected]" 127.0.0.1:3000/convert/image/to/jpg > output.jpgcurl -F "[email protected]" 127.0.0.1:3000/convert/image/to/jpg > output.jpgExtract images from video using the API.
curl -F "[email protected]" 127.0.0.1:3000/video/extract/images
curl 127.0.0.1:3000/video/extract/download/ba0f565c-0001.png
curl 127.0.0.1:3000/video/extract/download/ba0f565c-0001.png?delete=no
curl -F "[email protected]" 127.0.0.1:3000/video/extract/images?compress=zip > images.zip
curl -F "[email protected]" 127.0.0.1:3000/video/extract/images?compress=gzip > images.tar.gz
curl -F "[email protected]" 127.0.0.1:3000/video/extract/images?fps=0.5
Extract audio track from video using the API.
curl -F "[email protected]" 127.0.0.1:3000/video/extract/audiocurl -F "[email protected]" 127.0.0.1:3000/video/extract/audio?mono=noProbe audio/video/image files using the API.
curl -F "[email protected]" 127.0.0.1:3000/probe
ffprobe -of json -show_streams -show_format input.mov.Originally developed by Paul Visco @surebert (github.com).
Changes include new functionality, updated Node.js version, Docker image based on Alpine, logging and other major refactoring.
cd /usr/local/src
git clone https://github.com/gnh1201/ffmpeg-api
cd ffmpeg-api
docker build -t gnh1201/ffmpeg-api .
sudo mkdir /var/cache/ffmpeg-api
sudo chmod -R 777 /var/cache/ffmpeg-api
sudo docker run -itd --rm -p 127.0.0.1:3000:3000 -v /var/cache/ffmpeg-api:/tmp -e KEEP_ALL_FILES=false -e LOG_LEVEL=debug gnh1201/ffmpeg-api # OR `-p 0.0.0.0:3000:3000`
Content type
Image
Digest
sha256:5cd31e84e…
Size
91.5 MB
Last updated
over 2 years ago
docker pull gnh1201/ffmpeg-api