Make GIF with video and images
Example ( Live Demo )
getFramesBytes
Get Frame images from video as ListcreateGifFromVideo
Create GIF from video as Uint8ListcreateGifFromImages
Create GIF from images as Uint8List
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)
- Example uses
flutter pub add gify
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;
}
- Pull Requests are always welcome!
- Please send a Pull Request to https://github.com/swimmingkiim/gify