swimmingkiim / gify

Make GIF with video and images

Home Page:https://pub.dev/packages/gify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Make GIF with video and images

https://pub.dev/packages/gify

License:MIT License


Languages

Language:Dart 72.4%Language:JavaScript 11.4%Language:Ruby 5.0%Language:HTML 4.1%Language:Kotlin 3.6%Language:Swift 2.0%Language:Objective-C 1.4%