fluvie_mobile_encoder 0.2.0 copy "fluvie_mobile_encoder: ^0.2.0" to clipboard
fluvie_mobile_encoder: ^0.2.0 copied to clipboard

Render Fluvie videos to MP4 fully on-device on Android and iOS using the platform's native hardware encoder, with no FFmpeg and no server.

example/main.dart

/// Renders a two-second clip fully on-device, no FFmpeg and no server.
///
/// Runs on Android and iOS: Fluvie's own pipeline captures the frames and the
/// platform's native encoder writes the MP4, so the video never leaves the
/// device. For a complete app on this path, see the repository's
/// `examples/mobile_purrfect`.
library;

import 'package:flutter/material.dart' hide Animation, Clip, Image, Tween;
import 'package:fluvie/fluvie.dart';
import 'package:fluvie_mobile_encoder/fluvie_mobile_encoder.dart';

void main() => runApp(const MaterialApp(home: _RenderPage()));

class _RenderPage extends StatefulWidget {
  const _RenderPage();

  @override
  State<_RenderPage> createState() => _RenderPageState();
}

class _RenderPageState extends State<_RenderPage> {
  String _status = 'Tap to render on-device';

  Future<void> _render() async {
    setState(() => _status = 'Rendering…');
    final file = await OnDeviceVideoRenderer().render(
      composition: Video(
        size: VideoSize.square,
        scenes: [
          Scene(
            duration: 2.seconds,
            background: Background.color(const Color(0xFF1A2980)),
            children: [
              const Text(
                'On-device',
                style: TextStyle(color: Colors.white, fontSize: 64),
              ).animate([Animation.fadeIn()]),
            ],
          ),
        ],
      ),
      aspect: Aspect.square,
      duration: const Duration(seconds: 2),
    );
    setState(() => _status = 'Saved ${file.path}');
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: TextButton(onPressed: _render, child: Text(_status)),
      ),
    );
  }
}
1
likes
150
points
280
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Render Fluvie videos to MP4 fully on-device on Android and iOS using the platform's native hardware encoder, with no FFmpeg and no server.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#video #rendering #android #ios

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

flutter, fluvie, http, meta, riverpod

More

Packages that depend on fluvie_mobile_encoder

Packages that implement fluvie_mobile_encoder