boa was initially written as a service for Skyris that converted music uploaded to S3 into smaller streamable MP3s (128kbps), as well as converted lossless uploads to 320kbps MP3s to make them available for download if a user so desired. It depends on the LAME MP3 encoder. What you'll find here is a cleaned up, slightly more generalized version of this service.
It works in a few vaguely snakelike stages:
- Stalk - read messages off queue
- Hunt - download file included in message from S3
- Constrict - compresses file (if necessary) into the desired MP3s
- Digest - upload newly created files to S3, delete local copies
Expects input as a JSON blob in the following format. The id
is used in the S3 path to avoid issues with different audio files that have the same name.
{
"id": "56773ff9faa58b662fc7cbb0",
"originalUploadPath": "original-upload/56773ff9faa58b662fc7cbb0/Snake-Boy.wav",
"streamOnly": true
}
- Input validation
- Clean up error handling - better logging, set failure flag in Mongo if necessary
- Add support for other messaging queues and storage (MongoDB & RabbitMQ currently supported)
- Dockerize so installing the LAME dependency isn't an issue
- Write tests, set up CI