soft_converter 0.1.1-dev
soft_converter: ^0.1.1-dev copied to clipboard
Convert some videos and images to some formats
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 binaries or have it installed on your machine.
Usage #
SoftConverter image
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 imageConverter = SoftImageConverter(
cwebpWindows: 'bin/cwebp_win.exe',
cwebpMacOS: 'bin/cwebp_macos',
cwebpLinux: 'bin/cwebp_linux',
);
try {
final file = await imageConverter.toWEBP(
input: 'assets/space.jpg',
output: 'assets/space.webp',
);
print('Image file: ${file.path}');
} catch (e) {
rethrow;
}
}
Credits #
- João Sereia <joao.sereia@softyes.com.br>
- SoftYes TI <softyes.com.br>