始め方
このプラグインのインストールステップとフルマークダウンガイドのセットアッププロンプトをコピーする
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-ffmpeg`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/ffmpeg/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
インストール
「インストール」のセクションCapgoのAI-Assisted Setupを使用してプラグインをインストールできます。AIツールにCapgoスキルを追加するには、以下のコマンドを実行してください。
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins次に、以下のプロンプトを使用してください。
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-ffmpeg` plugin in my project.Manual Setupを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください。
bun add @capgo/capacitor-ffmpegbunx cap syncインポート
「インポート」のセクションimport { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';API の概要
「API の概要」のセクションgetCapabilities
「getCapabilities」のセクション現在のプラットフォームのマシン読み取り可能な能力マトリックスを返します。
import { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';
await CapacitorFFmpeg.getCapabilities();reencodeVideo
「reencodeVideo」のセクションビデオ再エンコードジョブのキューを設定します。
iOS の場合、ネイティブ層がジョブを受け入れると、返されたプロミスは解決されます。
最終的な成功または失敗は、 progress リスナー。
Android と web は現在拒否しています UNIMPLEMENTED.
import { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';
await CapacitorFFmpeg.reencodeVideo({} as ReencodeVideoOptions);convertImage
「convertImage」というセクションのタイトル静止画像を別の形式に変換します。
iOS は現在 jpeg と .png。
Android は現在 .webp, jpeg、 .png。
Web は現在拒否しています UNIMPLEMENTED.
import { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';
await CapacitorFFmpeg.convertImage({} as ConvertImageOptions);convertAudio
「convertAudio」というセクションのタイトル__CAPGO_KEEP_0__を別のコンテナまたはエンコードに変換します。
__CAPGO_KEEP_1__は現在 m4a__CAPGO_KEEP_2__で拒否されています。
__CAPGO_KEEP_3__と__CAPGO_KEEP_4__では現在 UNIMPLEMENTED.
import { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';
await CapacitorFFmpeg.convertAudio({} as ConvertAudioOptions);__CAPGO_KEEP_6__
__CAPGO_KEEP_7__のセクションFFmpegCapabilitiesResult
__CAPGO_KEEP_8__のセクションexport interface FFmpegCapabilitiesResult { platform: string; features: FFmpegCapabilitiesFeatures;}ReencodeVideoOptions
__CAPGO_KEEP_10__のセクションexport interface ReencodeVideoOptions { inputPath: string; outputPath: string; width: number; height: number; bitrate?: number;}FFmpegAcceptedJob
__CAPGO_KEEP_12__のセクションexport interface FFmpegAcceptedJob { jobId: string; status: 'queued';}ConvertImageOptions
ConvertImageOptionsのセクションexport interface ConvertImageOptions { inputPath: string; outputPath: string; format: ImageOutputFormat; /** * Compression quality in the inclusive range `0.0..1.0`. * * Native platforms reject values outside that range. */ quality?: number;}ConvertImageResult
ConvertImageResultのセクションexport interface ConvertImageResult { outputPath: string; format: ImageOutputFormat;}ConvertAudioOptions
ConvertAudioOptionsのセクションexport interface ConvertAudioOptions { inputPath: string; outputPath: string; format: AudioOutputFormat;}ConvertAudioResult
ConvertAudioResultのセクションexport interface ConvertAudioResult { outputPath: string; format: AudioOutputFormat;}FFmpegProgressEvent
FFmpegProgressEventのセクションexport interface FFmpegProgressEvent { jobId: string; /** * Normalized progress as a floating-point value in the inclusive range `0.0..1.0`. */ progress: number; state: FFmpegProgressState; message?: string; outputPath?: string; /** * Legacy alias kept for compatibility while callers migrate to `jobId`. */ fileId?: string;}PluginVersionResult
PluginVersionResultのセクションexport interface PluginVersionResult { version: string;}FFmpegCapabilitiesFeatures
FFmpegの機能と機能export interface FFmpegCapabilitiesFeatures { getPluginVersion: FFmpegCapability; getCapabilities: FFmpegCapability; reencodeVideo: FFmpegCapability; convertImage: FFmpegCapability; convertAudio?: FFmpegCapability; progressEvents: FFmpegCapability; probeMedia: FFmpegCapability; generateThumbnail: FFmpegCapability; extractAudio: FFmpegCapability; remux: FFmpegCapability; trim: FFmpegCapability;}ImageOutputFormat
画像出力形式export type ImageOutputFormat = '.webp' | 'jpeg' | '.png';AudioOutputFormat
音声出力形式export type AudioOutputFormat = 'm4a';真実の源
真実の源このページはプラグインの src/definitions.tsAPIがアップストリームで変更されたときに再度Syncを実行してください。
Getting Startedから続けて
Getting Startedから続けてあなたが Getting Started を計画ダッシュボードとAPI オペレーションに接続するには Using @capgo/capacitor-ffmpeg のネイティブ機能のためにUsing @capgo/capacitor-ffmpeg API オーバービュー の実装詳細のためにAPI オーバービュー イントロダクション の実装詳細のためにイントロダクション API キー の実装詳細のためにAPI キー、 デバイス __CAPGO_KEEP_0__の実装詳細についての情報は、Devicesにあります。