gify 1.0.9 copy "gify: ^1.0.9" to clipboard
gify: ^1.0.9 copied to clipboard

Make GIF with video and images, control speed with fps, set size when create GIF

gify #

Make GIF with video and images

Example ( Live Demo ) #

createGifFromVideo example

Features #

  • getFramesBytes Get Frame images from video as List
  • createGifFromVideo Create GIF from video as Uint8List
  • createGifFromImages Create GIF from images as Uint8List

Getting started #

Prerequisites #

  • ios
    • Minimum target version : 12.1
  • android
    • Minimum SDK version : 24
  • Run example
    • Example uses image_picker, so you need to modify your Info.plist (documentation)

Installation #

flutter pub add gify

Usage #

  Future<List<Uint8List>?> testFrames() async {
    final XFile? videoFile =
        await ImagePicker().pickVideo(source: ImageSource.gallery);
    if (videoFile != null) {
      final result = await _gifyPlugin.getFramesBytes(videoFile, fps:1);
      return result;
    }
    return null;
  }

  Future<Uint8List?> testVideoToGif() async {
    final XFile? videoFile =
        await ImagePicker().pickVideo(source: ImageSource.gallery);
    if (videoFile != null) {
      final result = await _gifyPlugin.createGifFromVideo(videoFile, fps:1, width: 320);
      return result;
    }
    return null;
  }

  Future<Uint8List?> testImagesToGif() async {
    final List<XFile> imageFiles = await ImagePicker().pickMultiImage();
    final result = await _gifyPlugin.createGifFromImages(imageFiles,
        fps: 1,
        width: 300,
        height: 480,
        textMessages: [
          const GifyTextMessage(
            text: 'test111',
            fontColor: Color.fromRGBO(247, 24, 7, 1),
            fontSize: 30,
            x: 10.0,
            y: 10.0,
          ),
          const GifyTextMessage(
            text: 'test222',
            fontColor: Color.fromRGBO(7, 67, 247, 1),
            fontSize: 20,
            x: 30.0,
            y: 30.0,
          ),
        ]);
    return result;
  }

Contributing #

License #

5
likes
140
pub points
59%
popularity

Publisher

unverified uploader

Make GIF with video and images, control speed with fps, set size when create GIF

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

cross_file, ffmpeg_kit_flutter_full, flutter, flutter_web_plugins, js, path_provider, plugin_platform_interface, universal_html

More

Packages that depend on gify