xaus-group / nyx_converter

A Flutter package that makes it easier to convert formats, codecs, etc. of media files.
https://pub.dev/packages/nyx_converter
GNU Lesser General Public License v3.0
6 stars 1 forks source link
audio audio-codec audio-converter codec converter dart ffmpeg flutter format video video-codec video-converter

Nyx Converter Github release pub package License Github Stars Issues

nyx_converter logo

The nyx_converter package in Flutter empowers you to seamlessly convert media files between various formats, codecs, resolutions, bitrates, and audio properties. It utilizes the robust ffmpeg under the hood, providing a convenient and efficient solution for your media processing needs within your Flutter applications.

Key Features

Installation

To use this package, add nyx_converter as a dependency in your pubspec.yaml file.

dependencies:
  nyx_converter: <latest-version>

Platform Support

The following table shows Android API level, iOS deployment target and macOS deployment target requirements in nyx_converter releases.

Android
API Level
iOS Minimum
Deployment Target
macOS Minimum
Deployment Target
24 12.1 10.15

Using

Import: Import the package in your Dart code:

import 'package:nyx_converter/nyx_converter.dart';

Widget Usage: Use .convertTo method for initiate the media file path and desired output file path to save converted media file.

final filePath = 'path/to/my.mp4';
final outputPath = 'path/to/';
result =  NyxConverter.convertTo(
  filePath, // Specify the input file path
  outputPath, // Define the output file path

Container: Choose the desired container for your output media file.

Video Audio
AVI WAV
MP4 FLAC
MKV OGG
MOV AAC
WebM MP3
  container: NyxContainer.mp4,

Debug Mode: Set true for get detailed logs

  debugMode: true,

Output file name: Set output file name

  fileName: 'new_name',

Execution: execution callback provides the path of the converted file and the status and messages of the conversion process.

  execution: (String? path, NyxStatus status, {String? errorMessage}) {
    //TODO: codes
  }
);

Stop process: Use .kill method to kill all nyx_converter processes.

NyxConverter.kill();

Contributing

There is not much to contribute since the package serves its purpose, however, in chance of needing to bump or adjust some version, or any other suggestion for that matter, please read CONTRIBUTING.