1+ /// <reference types="node" />
2+ import { ReadStream , WriteStream } from "fs" ;
3+ import { PassThrough } from "stream" ;
4+ import execa from "execa" ;
5+ import TypedEmitter from "typed-emitter" ;
6+ import { FFmpeggyProgress } from "./types/FFmpeggyProgress" ;
7+ import { FFprobeResult } from "./types/probeTypes" ;
8+ export interface FFmpeggyOptions {
9+ cwd ?: string ;
10+ input ?: string | ReadStream ;
11+ output ?: string | WriteStream ;
12+ pipe ?: boolean ;
13+ globalOptions ?: string [ ] ;
14+ inputOptions ?: string [ ] ;
15+ outputOptions ?: string [ ] ;
16+ autorun ?: boolean ;
17+ overwriteExisting ?: boolean ;
18+ hideBanner ?: boolean ;
19+ }
20+ export declare type FFmpeggyProgressEvent = FFmpeggyProgress & {
21+ duration ?: number ;
22+ percent ?: number ;
23+ } ;
24+ interface FFmpegEvents {
25+ start : ( ffmpegArgs : readonly string [ ] ) => void ;
26+ error : ( error : Error ) => void ;
27+ done : ( file ?: string ) => void ;
28+ exit : ( code ?: number | null , error ?: Error ) => void ;
29+ probe : ( probeResult : FFprobeResult ) => void ;
30+ progress : ( progress : FFmpeggyProgressEvent ) => void ;
31+ writing : ( file : string ) => void ;
32+ }
33+ declare const FFmpeggy_base : new ( ) => TypedEmitter < FFmpegEvents > ;
34+ export declare class FFmpeggy extends FFmpeggy_base {
35+ running : boolean ;
36+ status ?: execa . ExecaReturnValue ;
37+ process ?: execa . ExecaChildProcess ;
38+ error ?: Error ;
39+ currentFile ?: string ;
40+ input : string | ReadStream ;
41+ outputOptions : string [ ] ;
42+ inputOptions : string [ ] ;
43+ globalOptions : string [ ] ;
44+ ffmpegBin : string ;
45+ ffprobeBin : string ;
46+ cwd : string ;
47+ output : string | WriteStream ;
48+ overwriteExisting : boolean ;
49+ hideBanner : boolean ;
50+ static DefaultConfig : {
51+ cwd : string ;
52+ output : string ;
53+ overwriteExisting : boolean ;
54+ hideBanner : boolean ;
55+ ffmpegBin : string ;
56+ ffprobeBin : string ;
57+ ffprobeArgs : string [ ] ;
58+ } ;
59+ log : string ;
60+ private pipedOutput ;
61+ private outputStream ;
62+ constructor ( opts ?: FFmpeggyOptions ) ;
63+ run ( ) : Promise < execa . ExecaChildProcess < string > | undefined > ;
64+ private parseOutput ;
65+ private awaitStatus ;
66+ stop ( signal ?: number ) : Promise < void > ;
67+ done ( ) : Promise < void > ;
68+ setOverwriteExisting ( overwriteExisting : boolean ) : FFmpeggy ;
69+ setCwd ( cwd : string ) : FFmpeggy ;
70+ setInput ( input : string ) : FFmpeggy ;
71+ setOutput ( output : string ) : FFmpeggy ;
72+ setGlobalOptions ( opts : string [ ] ) : FFmpeggy ;
73+ setInputOptions ( opts : string [ ] ) : FFmpeggy ;
74+ setOutputOptions ( opts : string [ ] ) : FFmpeggy ;
75+ reset ( ) : Promise < void > ;
76+ toStream ( ) : PassThrough ;
77+ probe ( ) : Promise < FFprobeResult > ;
78+ static probe ( filePath : string ) : Promise < FFprobeResult > ;
79+ }
80+ export { } ;
81+ //# sourceMappingURL=FFmpeggy.d.ts.map
0 commit comments