Nyx Converter

Pub package GitHub release GitHub Stars Issues License

Nyx Converter

FFmpeg media conversion and inspection for Flutter.


What is Nyx Converter?

Nyx Converter is a Flutter package for working with audio and video files using FFmpeg.

It provides a simple API for:

  • Media conversion
  • Audio and video codecs
  • Containers
  • Bitrates
  • Video size
  • Audio sample rate
  • Audio channel layout
  • Real-time conversion progress
  • Media information
  • Thumbnail generation
  • Conversion cancellation

FFmpeg command generation and execution are handled internally.


Installation

Add Nyx Converter to your pubspec.yaml:

dependencies:
  nyx_converter: ^1.0.0

Then run:

flutter pub get

Quick Start

Import the package:

import 'package:nyx_converter/nyx_converter.dart';

Convert a media file:

await NyxConverter.convertTo(
  '/storage/input.mp4',
  '/storage/output',
  container: NyxContainer.mp4,
  videoCodec: NyxVideoCodec.h264,
  audioCodec: NyxAudioCodec.aac,
  size: NyxSize.w1920h1080,
  sampleRate: NyxSampleRate.hz48000,
  channelLayout: NyxChannelLayout.stereo,
  videoBitrate: 5,
  audioBitrate: 192,
  fileName: 'converted',
  execution: (
    status, {
    progress,
    fps,
    speed,
    errorMessage,
  }) {
    switch (status) {
      case NyxStatus.running:
        print('Progress: ${progress ?? 0}%');
        break;

      case NyxStatus.completed:
        print('Conversion completed');
        break;

      case NyxStatus.failed:
        print(errorMessage);
        break;

      case NyxStatus.cancel:
        print('Conversion cancelled');
        break;
    }
  },
);

You can also use convertTo with only the options you need.


More

Nyx Converter also provides APIs for:

NyxConverter.getMediaInfo(...)
NyxConverter.getThumbnail(...)
NyxConverter.kill()

See the Wiki for complete API usage, supported codecs and containers, configuration options, media information, thumbnails, callbacks, validation, and troubleshooting.


Documentation

📚 Nyx Converter Wiki

The Wiki contains the complete documentation:

  • Audio Codecs
  • Video Codecs
  • Containers
  • Audio Settings
  • Video Settings
  • Media Information
  • Thumbnails
  • Conversion Lifecycle
  • Execution Callback


Contributing

Contributions, bug reports, and feature requests are welcome.

Please see CONTRIBUTING.md before contributing.


License

Nyx Converter is licensed under the GNU LGPL v3.0 license.

Libraries

nyx_converter
A Flutter package for converting and inspecting audio and video files using FFmpeg and FFprobe.