@m4k/server
v0.2.8
Published
Server for m4k
Maintainers
Readme
m4k - media toolkit server
A Bun media conversion server based on ffmpeg and sharp/libvips.
The docker image is available at ghcr.io/sv2dev/media-optimizer. It uses Bun as runtime.
Usage
docker run -p 3000:3000 -v $(pwd)/output:/output ghcr.io/sv2dev/m4k:0.2.1API
POST /audio/process
Request
POST /audio/process?<Options|options=OptionsJSON[]>
X-Options: <OptionsJSON[]>
Binary file contentResponse
Status: 200 OK
Content-Type: multipart/mixed; boundary=<boundary>
multipart/mixed body with status updates and the processed files (if no output option was provided)POST /images/process
Request
POST /images/process?<Options|options=OptionsJSON[]>
X-Options: <OptionsJSON[]>
Binary file contentResponse
Status: 200 OK
Content-Type: multipart/mixed; boundary=<boundary>
multipart/mixed body with status updates and the processed files (if no output option was provided)POST /videos/process
Request
POST /videos/process?<Options|options=OptionsJSON[]>
X-Options: <OptionsJSON[]>
Binary file contentResponse
Status: 200 OK
Content-Type: multipart/mixed; boundary=<boundary>
multipart/mixed body with status updates and the processed files (if no output option was provided)Options
The options can be provided as query parameters or as X-Options header.
Each provided option object will result in a processed output file, which allows you to process the same input file multiple times and create different output files (currently only enabled for images).
Examples
Using curl with headers, redirecting output to a file (within the container):
curl -X POST http://localhost:3000/videos/process \
-H 'X-Options: {"format": "mp4", "videoCodec": "libsvtav1", "output": "/output/output.mp4"}' \
--data-binary @/path/to/input.mov