Caracal is a light multimedia server designed as a service.
It provides a simple HTTP REST API and a HTML5 user interface.
npm install caracal
GraphicsMagick or ImageMagick is required. FFmpeg (not libav) is necessary for video resizing and converting.
docker pull yellowiscool/caracal
- File uploads
- File suppressions
- Picture and video thumbnails
- Picture resizing
- Video resizing and converting
- Convert videos to H264 or Webm
- Can fetch distant HTTP files
- Multimedia reverse proxy with a cache
- Transparent resizing
- Transparent video converting
- Basic HTTP authentification support
- Light HTML5 user interface
- Drag and drop support
- Progression bar for slow connexions
- Thumbnails and pagination
HTML5 user interface.
JSON list of files stored in the server
[
{
"size": 168454,
"hash": "e8f8f15bfefafae3a19d845b9d5c42dc2014206f",
"extension": "jpeg",
"type": "image/jpeg",
"name": "Veymont-aiguille_mg-k.jpg",
"url": "http://upload.wikimedia.org/wikipedia/commons/d/d3/Veymont-aiguille_mg-k.jpg",
"mtime": "2014-04-09T11:36:05.145Z",
"_id": "sEHgLEvyYAkV94J8"
},...
]Save on the server the provided file
{
"name": "208T16-05E.jpg",
"status": "ok",
"hash": "f2a4b8f39e757e59e89c03f1ec36ada979f75203",
"extension": "jpeg"
}If the URL is not in the cache, fetch, save and return the content of the url.
Example : GET /http://perdu.com
If the URL is not in the cache fetch and save the content of the url. Then return information about the URL.
Response example :
{
"status": "ok",
"hash": "70aa99ede90f16ffbb7cbb66c8bde1a4e8d37383",
"extension": "jpeg"
}Remove the related files to the hash and the extension from the server.
Example : GET /remove/70aa99ede90f16ffbb7cbb66c8bde1a4e8d37383.jpeg
Create and return a 128x128 thumbnail of the given file. If the format is not supported by GraphicsMagic, an error is returned.
Example : ```GET /thumbnail/70aa99ede90f16ffbb7cbb66c8bde1a4e8d37383.jpeg``
Resize the given image. The image aspect ratio is conserved.
The image format must be compatible with GraphicsMagick.
Example : GET /resize/1280/720/70aa99ede90f16ffbb7cbb66c8bde1a4e8d37383.jpeg
Same as resize but the ratio is not conserved.
Resize the given video. The video aspect ratio is conserved.
The input video format must be compatible with your FFmpeg installation.
Supported output formats : mp4 or webm Supported output sizes : 240, 480, 720, 1080
Example : GET /convert/mp4/720/e7c7c984066753d5cc52e97f26f4f7892df67bacb.wmv
Create and return a 128x128 thumbnail of the distant image.
Example : GET /thumbnail/http://upload.wikimedia.org/wikipedia/commons/d/d3/Veymont-aiguille_mg-k.jpg
Resize the distant image. The image aspect ratio is conserved.
Example : GET /resize/1280/720/http://upload.wikimedia.org/wikipedia/commons/d/d3/Veymont-aiguille_mg-k.jpg
Same as resize but the ratio is not conserved.
Resize the distant video. The video ratio is conserved.
The input video format must be compatible with your FFmpeg installation.
Supported output formats : mp4 or webm Supported output sizes : 240, 480, 720, 1080
Example : GET /convert/webm/480/http://example.net/video.flv
Return the file :-)
- NodeJs
- GraphicsMagick with gm
- FFmpeg with node-fluent-ffmpeg
- Express
- Bootstrap
- jQuery
- jQuery File Upload
- NeDB
You can change the http listening port, the user-agent and the list of basic http authentification username/password couples in the config.json file.
This library is developed in context of the BRIDGE project.
The source code of this library is licenced under the MIT License.