fluvie_api 0.1.3 copy "fluvie_api: ^0.1.3" to clipboard
fluvie_api: ^0.1.3 copied to clipboard

discontinuedreplaced by: fluvie_server

HTTP API that renders Fluvie videos to files (local or S3), with a web-safe client.

fluvie_api #

An HTTP API that renders Fluvie videos to files, plus a web-safe client to drive it. Submit a composition key, a VideoSpec, or a natural-language prompt; the server renders asynchronously, stores the file locally or on S3-compatible storage, and returns a download URL.

pub package license: MIT

The package ships two libraries:

  • package:fluvie_api/client.dart, a web-safe HTTP client (http only), usable from any Flutter app (web, mobile, desktop).
  • package:fluvie_api/server.dart, the dart:io/shelf server. Not web-safe.

Run the server #

cp deploy/env/api.env.example deploy/env/api.env   # set API_TOKEN and CLEANUP_TOKEN
docker compose -f deploy/docker-compose.yml up --build

Then:

curl -s -X POST http://localhost:8080/v1/renders \
  -H "Authorization: Bearer $API_TOKEN" -H "content-type: application/json" \
  -d '{"key":"demo"}'

See the Rendering on a server guide for the full API, local-vs-S3 storage, public-vs-private files, scheduled cleanup, and the environment variables.

Use the client #

import 'package:fluvie_api/client.dart';

final client = ApiRenderClient(
  baseUrl: Uri.parse('https://render.example.com'),
  apiToken: 'your-token',
);

final job = await client.renderAndWait(
  ApiRenderRequest.key('demo'),
  onUpdate: (view) => print('${view.status} ${view.progress}'),
);
print('Download: ${job.video?.downloadUrl}');
client.close();

ApiRenderRequest also has .spec(...), .prompt(...), and .edit(...) factories. The client is an interface class, so tests can mock it.

How it renders #

Rendering is the same two-process pipeline as the fluvie_cli: capture frames with flutter test (headless software rendering, no display server), then encode with ffmpeg. The server drives a configurable RENDER_PROJECT (the example app by default) and runs jobs through a bounded queue.

Status #

On-device rendering on web and mobile is not supported yet, so a hosted web app renders through this server. See the guide for details.

1
likes
140
points
238
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

HTTP API that renders Fluvie videos to files (local or S3), with a web-safe client.

Topics

#video #rendering #server #api

License

MIT (license)

Dependencies

crypto, fluvie_cli, http, meta, minio, shelf, shelf_router, shelf_static

More

Packages that depend on fluvie_api