soft_converter 0.3.0-dev copy "soft_converter: ^0.3.0-dev" to clipboard
soft_converter: ^0.3.0-dev copied to clipboard

Convert some videos and images to some formats

example/soft_converter_example.dart

// ignore_for_file: avoid_print

import 'dart:io';

import 'package:soft_converter/soft_converter.dart';

Future<void> main() async {
  // The paths for the cwebp and ffmpeg binaries are optional,
  // if not defined SoftConverter will use the system path.
  final imageConverter = SoftImageConverter();
  final videoConverter = SoftVideoConverter();

  try {
    final output = Directory('../assets/');

    final images = await imageConverter.toWEBP(
      output: output,
      inputs: [File('assets/space.jpg')],
    );

    final videos = await videoConverter.toWEBM(
      output: output,
      inputs: [File('assets/gradient.mp4')],
    );

    for (final file in images) {
      print('Image file path: ${file.path}');
    }

    for (final file in videos) {
      print('Video file path: ${file.path}');
    }
  } catch (e) {
    rethrow;
  }
}
4
likes
150
points
28
downloads

Publisher

verified publishersoftyes.com.br

Weekly Downloads

Convert some videos and images to some formats

Homepage
Repository (GitHub)
View/report issues

Topics

#converter #image #video #ffmpeg #cwebp

Documentation

API reference

License

LGPL-3.0 (license)

Dependencies

path

More

Packages that depend on soft_converter