__CAPGO_KEEP_2__

Getting Started

GitHub

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-ffmpeg
bunx cap sync
import { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';

Return the machine-readable capability matrix for the current platform.

import { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';
await CapacitorFFmpeg.getCapabilities();

動画再エンコードジョブをキューに追加します。

iOSでは、ネイティブレイヤーがジョブを受け入れると、返されたPromiseが解決されます。 最終的な成功または失敗はリスナー経由で伝えられます。 progress AndroidとWebは現在

クリップボードにコピー UNIMPLEMENTED.

import { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';
await CapacitorFFmpeg.reencodeVideo({} as ReencodeVideoOptions);

iOSでは現在

listener jpeg.png現在、Androidは .webp, jpeg、そして .png現在、Webは UNIMPLEMENTED.

import { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';
await CapacitorFFmpeg.convertImage({} as ConvertImageOptions);

オーディオを別のコンテナまたはエンコードに変換します。

現在、iOSは m4a現在、AndroidとWebは UNIMPLEMENTED.

import { CapacitorFFmpeg } from '@capgo/capacitor-ffmpeg';
await CapacitorFFmpeg.convertAudio({} as ConvertAudioOptions);
export interface FFmpegCapabilitiesResult {
platform: string;
features: FFmpegCapabilitiesFeatures;
}
export interface ReencodeVideoOptions {
inputPath: string;
outputPath: string;
width: number;
height: number;
bitrate?: number;
}
export interface FFmpegAcceptedJob {
jobId: string;
status: 'queued';
}
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;
}
export interface ConvertImageResult {
outputPath: string;
format: ImageOutputFormat;
}
export interface ConvertAudioOptions {
inputPath: string;
outputPath: string;
format: AudioOutputFormat;
}
export interface ConvertAudioResult {
outputPath: string;
format: AudioOutputFormat;
}
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;
}
export interface PluginVersionResult {
version: string;
}
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;
}
export type ImageOutputFormat = '.webp' | 'jpeg' | '.png';
export type AudioOutputFormat = 'm4a';

ソース・オブ・トゥルース

ソース・オブ・トゥルース

このページはプラグインの src/definitions.tsパブリックAPIがアップストリームで変更されたら、再度同期を実行してください。

始めから始める

始めから始める

あなたが 始めから始める を使用している場合、ダッシュボードとAPIの作業を計画するには、を接続してください。 Using @capgo/capacitor-ffmpeg for the native capability in Using @capgo/capacitor-ffmpeg, APIの概要 Capgoの実装詳細についてはAPIの概要を参照してください。 概要 Capgoの実装詳細については概要を参照してください。 APIのキー Capgoの実装詳細についてはAPIのキー、 デバイス Capgoの実装詳細についてはデバイスを参照してください。