Getting Started
このプラグインのセットアッププロンプトをコピーして、インストール手順とフルマークダウンガイドを取得します。
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.
インストール
「インストール」のセクションAI-Assisted セットアップを使用してプラグインをインストールできます。AIツールに Capgo スキルを追加するには、以下のコマンドを実行してください。
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsThen use the following prompt:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-ffmpeg` plugin in my project.If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:
bun add @capgo/capacitor-ffmpegbunx cap syncImport
「Import」セクションimport { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';API の概要
「API の概要」セクションgetCapabilities
「getCapabilities」セクションプラットフォームのマシン読み取り可能な能力マトリックスを返します。
import { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';
await CapacitorFFmpeg.getCapabilities();reencodeVideo
「再エンコードビデオ」セクションビデオ再エンコードジョブをキューに追加します。
iOSでは、ネイティブ層がジョブを受け入れると、返されたPromiseが解決されます。
最終的な成功または失敗はリスナー経由で通知されます。 progress クリップボードにコピー
「画像変換」セクション UNIMPLEMENTED.
import { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';
await CapacitorFFmpeg.reencodeVideo({} as ReencodeVideoOptions);convertImage
iOSでは現在、以下の形式をサポートしています。および
.
Androidでは現在、以下の形式をサポートしています。 jpeg クリップボードにコピー .png「画像変換」セクション .webp, jpeg, and .png.
Web currently rejects with UNIMPLEMENTED.
import { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';
await CapacitorFFmpeg.convertImage({} as ConvertImageOptions);convertAudio
Section titled “convertAudio”Convert audio into another container or codec.
iOS currently supports m4a.
Android and web currently reject with UNIMPLEMENTED.
import { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';
await CapacitorFFmpeg.convertAudio({} as ConvertAudioOptions);Type Reference
Section titled “Type Reference”FFmpegCapabilitiesResult
Section titled “FFmpegCapabilitiesResult”export interface FFmpegCapabilitiesResult { platform: string; features: FFmpegCapabilitiesFeatures;}ReencodeVideoOptions
「ReencodeVideoOptions」セクションexport interface ReencodeVideoOptions { inputPath: string; outputPath: string; width: number; height: number; bitrate?: number;}FFmpegAcceptedJob
「FFmpegAcceptedJob」セクション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
FFmpegCapabilitiesFeaturesのセクション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
ImageOutputFormatのセクションexport type ImageOutputFormat = '.webp' | 'jpeg' | '.png';AudioOutputFormat
AudioOutputFormatのセクションexport type AudioOutputFormat = 'm4a';真実の源
真実の源のセクションこのページはプラグインから生成されています。 src/definitions.ts. upstream の public API が変更された場合に再度 Sync を実行してください。
Getting Started から続けてください。
Getting Started から続けてください。Capacitor を使用している場合 Getting Started ダッシュボードと API の作業を計画するには、Capacitor を接続してください。 Capacitor の @capgo/capacitor-ffmpeg を使用 Capacitor の @capgo/capacitor-ffmpeg のネイティブ機能の実装詳細 Capacitor の API Overview Capacitor の API Overview の実装詳細 導入 導入の詳細における実装詳細について API キー 導入の詳細におけるAPI キー、そして デバイス デバイスの実装詳細について