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

パッケージ詳細v0.3.0

ffmpeg_cli

DartからFFMPEG CLIコマンドを実行する。

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
657
いいね数
49
Pub ポイント
135

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

flutter pub add ffmpeg_cli

パッケージ概要

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

Flutter/Dart パッケージで、Dart コードから直接 FFMPEG コマンドラインインターフェース(CLI)コマンドを実行できるようにします。複数のプラットフォームで動画エンコード、音声抽出、形式変換など、マルチメディア処理タスクを簡単かつ効率的に実行する方法を提供します。ネイティブの FFMPEG バイナリとのやり取りの複雑さを抽象化し、Flutter アプリケーション内で利用可能にします。プラットフォーム固有のコードを書かずに強力なメディア操作機能が必要な開発者に最適です。

用途

  • 動画形式の変換
  • 動画からのオーディオ抽出
  • メディアファイルの圧縮
  • マルチメディアファイルのバッチ処理
  • リアルタイム動画エンコーディング

主な機能

  • クロスプラットフォーム対応
  • シンプルな CLI コマンドの実行
  • Flutterアプリとの統合
  • すべての主要なOSプラットフォームをサポート
  • 軽量で使いやすい

適している対象

  • メディア重視のアプリを開発する開発者
  • 動画/音声処理を必要とするアプリ
  • コンテンツ作成者向けツール
  • マルチメディアを含む教育プロジェクト
  • Flutterを使用したバックエンドサービス

注意事項

  • ターゲットデバイスに FFMPEG バイナリが必要です
  • プラットフォーム固有の設定が必要になる場合があります
  • FFMPEG 依存関係による大きなバイナリサイズ
  • 基本的な使用におけるエラー処理の制限
  • パフォーマンスはデバイスのハードウェアに依存します

元の README

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

FFMPEG CLI - Run FFMPEG CLI commands from Dart

Built by the Flutter Bounty Hunters



Check out our Usage Guide


What is FFMPEG?

FFMPEG is a very popular, longstanding tool for reading, writing, and streaming audio and video content. Most developers use FFMPEG through its command-line interface (CLI), because that's much easier than interfacing with the C code upon which FFMPEG is built.

What is ffmpeg_cli

This package allows you to configure FFMPEG CLI commands with Dart code.

ffmpeg_cli purposefully retains the complexity of FFMPEG commands so that anything the FFMPEG CLI can do, the ffmpeg_cli package can do.

Quickstart

First, make sure that ffmpeg is installed on your device, and is available on your system path.

Compose an FFMPEG command with Dart:

// Define an output stream, which will map the filter
// graph to the video file. The ID names can be whatever
// you'd like.
const outputStream = FfmpegStream(
  videoId: "[final_v]", 
  audioId: "[final_a]",
);

// Compose your desired FFMPEG command, with inputs, filters, arguments,
// and an output location.
final command = FfmpegCommand(
  inputs: [
    FfmpegInput.asset("assets/intro.mp4"),
    FfmpegInput.asset("assets/content.mp4"),
    FfmpegInput.asset("assets/outro.mov"),
  ],
  args: [
    // Map the filter graph to the video file output.
    CliArg(name: 'map', value: outputStream.videoId!),
    CliArg(name: 'map', value: outputStream.audioId!),
    const CliArg(name: 'vsync', value: '2'),
  ],
  filterGraph: FilterGraph(
    chains: [
      FilterChain(
        inputs: [
          // Send all 3 video assets into the concat filter.
          const FfmpegStream(videoId: "[0:v]", audioId: "[0:a]"),
          const FfmpegStream(videoId: "[1:v]", audioId: "[1:a]"),
          const FfmpegStream(videoId: "[2:v]", audioId: "[2:a]"),
        ],
        filters: [
          // Concatenate 3 segments.
          ConcatFilter(
            segmentCount: 3, 
            outputVideoStreamCount: 1, 
            outputAudioStreamCount: 1,
          ),
        ],
        outputs: [
          // Give the output stream the given audio/video IDs
          outputStream,
        ],
      ),
    ],
  ),
  outputFilepath: "/my/output/file.mp4",
);

// Execute command
final process = await Ffmpeg().run(command: command);

How ffprobe support is managed

There are a lot of properties in ffprobe. Many of these properties can present in varying formats, which are not effectively documented.

The approach to ffprobe is to add missing result parameters as they are discovered and to add parsing functionality per property as the various possible formats are discovered. In other words, only do what is necessary in the given moment because the overall scope is too large and difficult to discover.

カテゴリー

依存関係

依存関係一覧 3 件

ソースリポジトリ

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

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