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.
インストール
「インストール」のセクションCapgoのAI-Assistedセットアップを使用してプラグインをインストールできます。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 syncImport
「Import」のセクションimport { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';APIの概要
「APIの概要」のセクションgetCapabilities
「getCapabilities」のセクション現在のプラットフォームのマシン読み取り可能な能力マトリックスを返します。
import { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';
const result = await CapacitorFFmpeg.getCapabilities();console.log(result);reencodeVideo
「reencodeVideo」のセクション動画再エンコードジョブをキューします。
iOSでは、ネイティブレイヤーがジョブを受け入れると、返されたPromiseが解決されます。最終的な成功または失敗はリスナーを介して伝えられます。 progress listener.
リスナーを介して最終的な成功または失敗が伝えられます。 UNIMPLEMENTED.
import { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';
const result = await CapacitorFFmpeg.reencodeVideo({ inputPath: 'path/to/file', outputPath: 'path/to/file', width: 1080, height: 1920,});console.log(result);convertImage
「convertImage」というセクション静止画を別の形式に変換します。
iOSでは jpeg 、 .png。 .webp, jpegAndroidでは .png、と UNIMPLEMENTED.
import { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';
const result = await CapacitorFFmpeg.convertImage({ inputPath: 'path/to/file', outputPath: 'path/to/file', format: 'webp',});console.log(result);convertAudio
「convertAudio」のセクション別のコンテナまたはエンコードにオーディオを変換します。
iOSは現在 m4a。AndroidとWebは UNIMPLEMENTED.
import { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';
const result = await CapacitorFFmpeg.convertAudio({ inputPath: 'path/to/file', outputPath: 'path/to/file', format: 'm4a',});console.log(result);型参照
「型参照」のセクションFFmpegCapabilitiesResult
「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
プラグインバージョン結果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.ts公開APIがアップストリームで変更されたときは、再度同期を実行してください。
続けて始めましょう
「続けて始めましょう」Capgoを使用している場合 CapgoのGetting Started Capgoを使用してダッシュボードとAPIの操作を計画するには、APIに接続します。 Capgoの@capgo/capacitor-ffmpegを使用 Capgoの@capgo/capacitor-ffmpegのネイティブ機能のために APIの概要 CapgoのAPIの概要の実装詳細 導入 導入の実装詳細 APIのキー Capgoの実装詳細についてはAPIキーの詳細を参照してください。 デバイス Capgoの実装詳細についてはデバイスの詳細を参照してください。