forked from tanersener/react-native-ffmpeg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
87 lines (80 loc) · 2.91 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
declare module 'react-native-ffmpeg' {
export class LogLevel {
static AV_LOG_QUIET: number;
static AV_LOG_PANIC: number;
static AV_LOG_FATAL: number;
static AV_LOG_ERROR: number;
static AV_LOG_WARNING: number;
static AV_LOG_INFO: number;
static AV_LOG_VERBOSE: number;
static AV_LOG_DEBUG: number;
static AV_LOG_TRACE: number;
}
export interface LogMessage {
level: LogLevel;
log: string;
}
export interface Statistics {
videoFrameNumber: number;
videoFps: number;
videoQuality: number;
size: number;
time: number;
bitrate: number;
speed: number;
}
export interface StreamInformation {
index?: number;
type?: string;
codec?: string;
fullCodec?: string;
format?: string;
fullFormat?: string;
width?: number;
height?: number;
bitrate?: number;
sampleRate?: number;
sampleFormat?: string;
channelLayout?: string;
sampleAspectRatio?: string;
displayAspectRatio?: string;
averageFrameRate?: string;
realFrameRate?: string;
timeBase?: string;
codecTimeBase?: string;
metadata?: [string, string];
}
export interface MediaInformation {
format?: string;
path?: string
duration?: number;
startTime?: number;
bitrate?: number;
metadata?: [string, string];
streams?: StreamInformation[];
rawInformation?: string;
}
export class RNFFmpeg {
static getFFmpegVersion(): Promise<{version: string}>;
static getPlatform(): Promise<{platform: string}>;
static executeWithArguments(arguments: string[]): Promise<{rc: number}>;
static execute(command: string, delimiter: string): Promise<{rc: number}>;
static cancel(): void;
static disableRedirection(): void;
static getLogLevel(): Promise<{level: number}>;
static setLogLevel(level: number): void;
static disableLogs(): void;
static disableStatistics(): void;
static enableLogCallback(newCallback: (log: LogMessage) => void): void;
static enableStatisticsCallback(newCallback: (statistics: Statistics) => void): void;
static getLastReceivedStatistics(): Promise<Statistics>;
static resetStatistics(): void;
static setFontconfigConfigurationPath(path: string): void;
static setFontDirectory(path: string, mapping?: { [key: string]: string }): void;
static getPackageName(): Promise<{packageName: string}>;
static getExternalLibraries(): Promise<string[]>;
static getLastReturnCode(): Promise<{lastRc: number}>;
static getLastCommandOutput(): Promise<{lastCommandOutput: string}>;
static getMediaInformation(path: string, timeout?: number): Promise<MediaInformation>;
}
}