-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
738d456
commit fc32d31
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
declare module "mp4box" { | ||
export interface MP4FileInfo { | ||
duration: number; // Duration in timescale units | ||
timescale: number; // Timescale of the file | ||
isFragmented: boolean; // Whether the MP4 is fragmented | ||
brands: string[]; // Major and compatible brands | ||
created: Date; // Creation time | ||
modified: Date; // Modification time | ||
tracks: MP4Track[]; // Array of tracks in the file | ||
} | ||
|
||
export interface MP4Track { | ||
id: number; // Track ID | ||
type: string; // Track type (e.g., "video", "audio") | ||
codec: string; // Codec used for this track | ||
language: string; // Language of the track | ||
created: Date; // Creation time | ||
modified: Date; // Modification time | ||
timescale: number; // Timescale for the track | ||
duration: number; // Duration in timescale units | ||
bitrate: number; // Average bitrate of the track | ||
width?: number; // Video width (if applicable) | ||
height?: number; // Video height (if applicable) | ||
sampleCount: number; // Number of samples in the track | ||
samples: any[]; // Detailed sample information | ||
} | ||
|
||
export interface MP4ArrayBuffer extends ArrayBuffer { | ||
fileStart: number; // Start position of the buffer in the file | ||
} | ||
|
||
export interface MP4BoxFile { | ||
onReady?: (info: MP4FileInfo) => void; | ||
onError?: (error: string) => void; | ||
appendBuffer(data: ArrayBuffer): number; | ||
start(): void; | ||
stop(): void; | ||
flush(): void; | ||
createFile(): MP4BoxFile; | ||
} | ||
|
||
export function createFile(): MP4BoxFile; | ||
} |