パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.0.0

video_compress_plus

Flutter用の軽量な動画操作ライブラリ。Dartコードから動画を圧縮し、音声を削除し、動画サムネイルを取得します。

AndroidiOSmacOS
30日間ダウンロード
39
いいね数
23
Pub ポイント
140

パッケージをインストール

flutter pub add video_compress_plus

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Dartコードから直接動画の圧縮、オーディオトラックの削除、サムネイルの生成を可能にする、軽量なFlutterパッケージです。Android、iOS、macOS向けに設計されており、Flutterアプリ内でのマルチメディア処理を簡素化します。ネイティブの動画処理機能とシームレスに統合され、デバイス上で効率的な動画最適化を実現します。オフラインでの動画編集や外部依存なしにファイルサイズを小さくしたいアプリに最適です。

用途

  • より速いアップロードのために動画を圧縮する
  • 動画ファイルからオーディオを削除する
  • 動画プレビュー用のサムネイルを生成する
  • アプリでの動画ストレージの最適化
  • 共有する前に動画を処理する
  • アプリバンドルサイズの削減

主な機能

  • 動画圧縮
  • オーディオの削除
  • サムネイルの生成
  • クロスプラットフォーム対応
  • ネイティブ統合
  • 最小構成

適している対象

  • メディア重視のアプリ
  • ソーシャルメディアアプリ
  • 動画編集ツール
  • ファイル管理アプリ
  • オフライン動画プロセッサ
  • モバイルおよびデスクトップ向けアプリ

注意事項

  • Android および iOS でのネイティブ権限が必要です
  • 基本的な動画操作に限定
  • プラットフォーム固有の動作によって異なる場合があります
  • 高度な動画編集機能なし
  • 下位のネイティブライブラリに依存しています
  • リアルタイム動画処理には適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

video_compress

Compress videos, remove audio, manipulate thumbnails, and make your video compatible with all platforms through this lightweight and efficient library. 100% native code was used, we do not use FFMPEG as it is very slow, bloated and the GNU license is an obstacle for commercial applications. In addition, google chrome uses VP8/VP9, safari uses h264, and most of the time, it is necessary to encode the video in two formats, but not with this library. All video files are encoded in an MP4 container with AAC audio that allows 100% compatibility with safari, mozila, chrome, android and iOS.

Works on ANDROID, IOS and desktop (just MacOS for now).

Table of Contents

Lets Get Started

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  video_compress: 1.0.0
    git: https://github.com/kamaravichow/VideoCompressPlus.git
2. Install it

You can install packages from the command line:

with pub:

$  pub get
3. Import it

Now in your Dart code, you can use:

import 'package:video_compress_plus/video_compress_plus.dart';

How to use

Imports
import 'package:video_compress_plus/video_compress_plus.dart';
    

Video compression

MediaInfo mediaInfo = await VideoCompress.compressVideo(
  path,
  quality: VideoQuality.DefaultQuality, 
  deleteOrigin: false, // It's false by default
);

Check compress state

VideoQuality.isCompressing

Get memory thumbnail from VideoPath

final uint8list = await VideoCompress.getByteThumbnail(
  videopath,
  quality: 50, // default(100)
  position: -1 // default(-1)
);

Get File thumbnail from VideoPath

final thumbnailFile = await VideoCompress.getFileThumbnail(
  videopath,
  quality: 50, // default(100)
  position: -1 // default(-1)
);

Get media information

final info = await VideoCompress.getMediaInfo(videopath);

delete all cache files

  • Delete all files generated by this will delete all files located at 'video_compress', you shoule ought to know what are you doing.
await VideoCompress.deleteAllCache()

Listen the compression progress

class _Compress extends State<Compress> {

  Subscription _subscription;

  @override
  void initState() {
    super.initState();
    _subscription =
        VideoCompress.compressProgress$.subscribe((progress) {
      debugPrint('progress: $progress');
    });
  }

  @override
  void dispose() {
    super.dispose();
    _subscription.unsubscribe();
  }
}
TODO
  • Add the trim video function
  • Add cancel function to Android

Methods

Functions Parameters Description Returns
getByteThumbnail String path[video path], int quality(1-100)[thumbnail quality], int position[Get a thumbnail from video position] get thumbnail from video path Future<Uint8List>
getFileThumbnail String path[video path], int quality(1-100)[thumbnail quality], int position[Get a thumbnail from video position] get thumbnail file from video path Future<File>
getMediaInfo String path[video path] get media information from video path Future<MediaInfo>
compressVideo String path[video path], VideoQuality quality[compressed video quality], bool deleteOrigin[delete the origin video], int startTime[compression video start time], int duration[compression video duration from start time], bool includeAudio[is include audio in compressed video], int frameRate[compressed video frame rate] compression video at origin video path Future<MediaInfo>
cancelCompression none cancel compressing Future<void>
deleteAllCache none Delete all files generated by 'video_compress' will delete all files located at 'video_compress' Future<bool>

Subscriptions

Subscriptions Description Stream
compressProgress$ Subscribe the compression progress steam double progress

Contribute

Contributions are always welcome!

acknowledgment

Inspired by the flutter_ffmpeg library. https://github.com/rurico/flutter_video_compress

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。