-
Notifications
You must be signed in to change notification settings - Fork 4
/
media_info.ts
128 lines (123 loc) · 2.62 KB
/
media_info.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// deno-lint-ignore-file camelcase
export interface MediaInfo {
streams: MediaStream[];
format: MediaFormat;
}
export type MediaStream = VideoStream | AudioStream;
export interface VideoStream {
index: 0;
codec_name: string;
codec_long_name: string;
profile: string;
codec_type: "video";
codec_time_base: string;
codec_tag_string: string;
codec_tag: string;
width: number;
height: number;
coded_width: number;
coded_height: number;
has_b_frames: number;
pix_fmt: string;
level: number;
color_range: string;
color_space: string;
color_transfer: string;
color_primaries: string;
chroma_location: string;
refs: number;
is_avc: true;
nal_length_size: string;
r_frame_rate: string;
avg_frame_rate: string;
time_base: string;
start_pts: number;
start_time: string;
duration_ts: 714714;
duration: string;
bit_rate: string;
bits_per_raw_sample: string;
nb_frames: string;
disposition: {
default: number;
dub: number;
original: number;
comment: number;
lyrics: number;
karaoke: number;
forced: number;
hearing_impaired: number;
visual_impaired: number;
clean_effects: number;
attached_pic: number;
timed_thumbnails: number;
};
tags: {
creation_time: string;
language: string;
handler_name: string;
encoder: string;
};
}
export interface AudioStream {
index: number;
codec_name: string;
codec_long_name: string;
profile: string;
codec_type: "audio";
codec_time_base: string;
codec_tag_string: string;
codec_tag: string;
sample_fmt: string;
sample_rate: string;
channels: number;
channel_layout: string;
bits_per_sample: number;
r_frame_rate: string;
avg_frame_rate: string;
time_base: string;
start_pts: number;
start_time: string;
duration_ts: number;
duration: string;
bit_rate: string;
max_bit_rate: string;
nb_frames: string;
disposition: {
default: number;
dub: number;
original: number;
comment: number;
lyrics: number;
karaoke: number;
forced: number;
hearing_impaired: number;
visual_impaired: number;
clean_effects: number;
attached_pic: number;
timed_thumbnails: number;
};
tags: {
creation_time: string;
language: string;
handler_name: string;
};
}
export interface MediaFormat {
filename: string;
nb_streams: number;
nb_programs: number;
format_name: string;
format_long_name: string;
start_time: string;
duration: string;
size: string;
bit_rate: string;
probe_score: number;
tags: {
major_brand: string;
minor_version: string;
compatible_brands: string;
creation_time: string;
};
}