UNPKG

lw-ffmpeg-node

Version:

`lw-ffmpeg-node` is a lightweight Node.js library for manipulating video files using FFmpeg. It provides various methods to retrieve information about video files, compress videos, create video slices, crop videos, change video size and frame rate, and sa

61 lines (60 loc) 2.3 kB
/** * A class that allows support for using FFMPEG by providing a path to it. */ import { ProcessOptions } from "./FFMPEGManipulator"; type WithoutKeys<T, V extends keyof T> = { [K in Exclude<keyof T, V>]: T[K]; }; export declare class YTDLPModel { private ytdlpPath?; constructor(ytdlpPath?: string | undefined); private linuxCmd; cmd: (command: string, options?: ProcessOptions) => Promise<string>; getVersion(): Promise<string>; downloadVideo(url: string, destination: string, options?: { cliOptions?: Partial<WithoutKeys<ProcessOptions, "cwd">>; shouldOverwrite?: boolean; quality?: "high"; }): Promise<string>; static getYoutubeId(url: string): { videoId: string; ytUrl: string; }; } export declare class FFMPEGPathModel { private ffmpegPath; private ffprobePath; ffprobe: FFPROBEModel; constructor(ffmpegPath: string, ffprobePath: string); cmd: (command: string) => Promise<string>; getVersion(): Promise<string>; compress(inputPath: string, outputPath: string): Promise<string>; createVideoSlice(input_path: string, output_path: string, inpoint: number, outpoint: number, options?: { convertToMp4?: boolean; }): Promise<string>; cropVideo(inputPath: string, outputPath: string, x: number, y: number, width: number, height: number): Promise<void>; changeSize(inputPath: string, outputPath: string, width: number, height: number): Promise<void>; changeFramerate(inputPath: string, outputPath: string, frameRate: number): Promise<void>; saveThumbnail(inputPath: string, outputPath: string, time: number): Promise<void>; } declare class FFPROBEModel { private ffprobePath; constructor(ffprobePath: string); cmd: (command: string) => Promise<string>; getVersion(): Promise<string>; getVideoInfo(filepath: string): Promise<{ codec_name: string; width: number; height: number; bit_rate: number; r_frame_rate: number; filename: string; duration: number; nb_streams: number; size: number; }>; getVideoDuration(filePath: string): Promise<number>; getVideoFrameRate(filePath: string): Promise<number>; private convertFractionStringToNumber; } export {};