Media Operations

Upload, download, convert, trim, and combine media files via the API.

Upload

POST /api/upload
Content-Type: multipart/form-data
fields:
  board_id: string
  file:     binary

Returns:

{ "filename": "saved-name.png", "url": "/media/<board-id>/saved-name.png" }

The file is saved to media/admin/<board-id>/. If the board has a connected folder, it is written there instead.

Download from URL

POST /api/download
Content-Type: application/json
body:
{
  "board_id": "…",
  "url": "https://…"
}

Runs the URL parser. For social-media URLs the downloader handles auth-free public content; for direct URLs it makes an HTTP fetch.

Returns:

{
  "elements": [ { "id": "…", "type": "image", "url": "/media/…" }, … ]
}

The returned elements are already added to the board.

Serve media

GET /media/<board-id>/<filename>

Serves files from the board’s media folder. Supports HTTP byte-range requests (essential for video seeking).

Extract audio

POST /api/extract-audio
{
  "board_id": "…",
  "element_id": "…"
}

Pulls the audio track out of a video element into a separate MP3 in the board folder.

Trim media

POST /api/trim-media
{
  "board_id": "…",
  "element_id": "…",
  "start_seconds": 0,
  "end_seconds": 10
}

Returns a new element with the trimmed file.

Convert image / video

POST /api/convert-image
{
  "board_id": "…",
  "element_id": "…",
  "format": "png" | "jpg" | "webp" | "avif",
  "width": 1920,
  "height": 1080
}
POST /api/convert-video
{
  "board_id": "…",
  "element_id": "…",
  "format": "mp4" | "webm" | "mov",
  "codec": "h264" | "h265" | "vp9",
  "bitrate": "2M"
}

Both run via the bundled FFmpeg.

Concatenate videos

POST /api/concat-videos
{
  "board_id": "…",
  "element_ids": ["…", "…", "…"]
}

Stitches videos in the given order with no transitions. Returns the new combined element.

Find similar

POST /api/find-similar
{
  "board_id": "…",
  "element_id": "…"
}

Runs SerpAPI reverse image search. Returns up to 50 matches.

Where to go next

Was this helpful?

0

Updated

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *