Run FFmpeg jobs on demand with aud.io! This project implements a plain Node.JS HTTP server hosted on Heroku Dynos. It accepts audio media in the form of download links or file streamed POSTed as a part of multipart form data (making it a convenient plugin API for frontend and backends alike). Response can be accepted as a JSON with a download URL or a file stream. Download URLs are provided courtesy a presigned AWS S3 file URL with default expiration. All requests are GZIP compressed and cached in S3, and all download URLs responses are GZIP compressed. The minimal NPM dependencies allows this project to be fast and relatively portable.
curl https://aud-i0.herokuapp.com/?url=https%3A%2F%2Fwww.bensound.com%2Fbensound-music%2Fbensound-ukulele.mp3 >> normalized_audio.mp3
curl -X GET 'https://aud-i0.herokuapp.com/?url=https%3A%2F%2Fwww.bensound.com%2Fbensound-music%2Fbensound-slowmotion.mp3&presignRes=true'
curl -X POST -H "Content-Type: multipart/form-data" -F "file=@./audio.mp3" -F "type=audio/mpeg" https://aud-i0.herokuapp.com >> normalized_audio.mp3
curl -X POST -H "Content-Type: multipart/form-data" -F "file=@./audio.mp3" -F "type=audio/mpeg" -F "presignRes=true" https://aud-i0.herokuapp.com
curl -X POST -H "Content-Type: multipart/form-data" -F "url=https://www.bensound.com/bensound-music/bensound-hey.mp3" https://aud-i0.herokuapp.com >> normalized_audio.mp3
curl -X POST -H "Content-Type: multipart/form-data" -F "url=https://www.bensound.com/bensound-music/bensound-hey.mp3" -F "presignRes=true" https://aud-i0.herokuapp.com
All arguments accepted via query, params or body data. The following FFmpeg options are supported explicitly with equivalent plain-text key names:
input
/inputUrl
/url
- Input download URL for audio file (REQUIRED if no file streamed as form POST data)
I
/integratedLoudness
- Integrated Loudness (default: -14)
TP
/truePeak
- Inter-sample peak (default: -3)
LRA
/loudnessRange
- Loudness Range from softest to loudest (default: 11)
af
- audio filter (optional / default: loudnorm=I=${i}:TP=${tp}:LRA=${lra}:print_format=json
)
bitRate
- Audio Bit Rate (bits per unit time) (optional)
presignRes
/presignResponse
- returns pre-signed S3 download URL if equal to true (default: false - streams file to response)
Defaults based on normalization required for Amazon Alexa:
https://developer.amazon.com/en-US/docs/alexa/flashbriefing/normalizing-the-loudness-of-audio-content.html#additional-tools
Other FFmpeg options are implicitly supported by their key name as documented here:
https://ffmpeg.org/ffmpeg.html#toc-Options
Node.JS (HTTP/HTTPS, crypto, stream, zlib), Heroku, AWS S3, FFmpeg
aws-sdk, busboy, @discordjs/opus, ffmpeg-static, loglevel, prism-media