Coder Social home page Coder Social logo

softyesti / soft_converter Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 88.54 MB

A dart package/library for convert videos and images to some formats using cwebp and FFmpeg

Home Page: https://www.softyes.com.br

License: GNU Lesser General Public License v3.0

Makefile 3.60% Dart 96.40%
converter cwebp dart dart-library dart-package ffmpeg ffmpeg-wrapper flutter flutter-library flutter-package

soft_converter's Introduction

Soft Converter

A Dart package/library for convert some video and images to some formats using cwebp and FFmpeg. This package is not ready for production!

Resources

  • Convert .jpg and .png images to .webp
  • Convert .mp4 videos to .webm

Platforms

  • Windows
  • macOS
  • Linux

Pre-requisites

  • Have the cwebp binary or have it installed and available in the system path
  • Have the FFmpeg binary or have it installed and available in the system path

Usage

SoftImageConverter

// ignore_for_file: avoid_print

import 'dart:io';

import 'package:soft_converter/soft_converter.dart';

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

  try {
    final files = await converter.toWEBP(
      inputs: [File('assets/space.jpg')],
      output: Directory('assets/'),
    );

    for (final file in files) {
      print('Image file path: ${file.path}');
    }
  } catch (e) {
    rethrow;
  }
}

SoftVideoConverter

// ignore_for_file: avoid_print

import 'dart:io';

import 'package:soft_converter/soft_converter.dart';

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

  try {
    final files = await converter.toWEBM(
      inputs: [File('assets/gradient.mp4')],
      output: Directory('assets/'),
    );

    for (final file in files) {
      print('Video file path: ${file.path}');
    }
  } catch (e) {
    rethrow;
  }
}

Credits

soft_converter's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.