forked from JetBrains/phpstorm-stubs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathffmpeg.php
257 lines (218 loc) · 6.79 KB
/
ffmpeg.php
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<?php
class ffmpeg_movie
{
/** Open a video or audio file and return it as an object.
* @param string $path_to_media - File path of video or audio file to open.
* @param boolean $persistent - Whether to open this media as a persistent resource. See the PHP documentation for more info about persistent resources
*/
public function __construct($path_to_media, $persistent)
{ }
/** Return the duration of a movie or audio file in seconds.
* @return int
*/
public function getDuration()
{ }
/** Return the number of frames in a movie or audio file.
* @return int
*/
public function getFrameCount()
{ }
/** Return the frame rate of a movie in fps.
* @return int
*/
public function getFrameRate()
{ }
/** Return the path and name of the movie file or audio file.
* @return string
*/
public function getFilename()
{ }
/** Return the comment field from the movie or audio file.
* @return string
*/
public function getComment()
{ }
/** Return the title field from the movie or audio file.
* @return string
*/
public function getTitle()
{ }
/** Return the author field from the movie or the artist ID3 field from an mp3 file.
* @return string
*/
public function getAuthor()
{ }
/** Return the author field from the movie or the artist ID3 field from an mp3 file.
* @return string
*/
public function getArtist()
{ }
/** Return the copyright field from the movie or audio file.
* @return string
*/
public function getCopyright()
{ }
/** Return the genre ID3 field from an mp3 file.
* @return string
*/
public function getGenre()
{ }
/** Return the track ID3 field from an mp3 file.
* @return string|int
*/
public function getTrackNumber()
{ }
/** Return the year ID3 field from an mp3 file.
* @return string|int
*/
public function getYear()
{ }
/** Return the height of the movie in pixels.
* @return int
*/
public function getFrameHeight()
{ }
/** Return the width of the movie in pixels.
* @return int
*/
public function getFrameWidth()
{ }
/** Return the pixel format of the movie.*/
public function getPixelFormat()
{ }
/** Return the bit rate of the movie or audio file in bits per second.
* @return int
*/
public function getBitRate()
{ }
/** Return the bit rate of the video in bits per second.
* NOTE: This only works for files with constant bit rate.
* @return int
*/
public function getVideoBitRate()
{ }
/** Return the audio bit rate of the media file in bits per second.
* @return int
*/
public function getAudioBitRate()
{ }
/** Return the audio sample rate of the media file in bits per second.
* @return int
*/
public function getAudioSampleRate()
{ }
/** Return the current frame index.
* @return int
*/
public function getFrameNumber()
{ }
/** Return the name of the video codec used to encode this movie as a string.
* @return string
*/
public function getVideoCodec()
{ }
/** Return the name of the audio codec used to encode this movie as a string.
* @return string
*/
public function getAudioCodec()
{ }
/** Return the number of audio channels in this movie as an integer.
* @return int
*/
public function getAudioChannels()
{ }
/** Return boolean value indicating whether the movie has an audio stream.
* @return boolean
*/
public function hasAudio()
{ }
/** Return boolean value indicating whether the movie has a video stream.
* @return boolean
*/
public function hasVideo()
{ }
/** Returns a frame from the movie as an ffmpeg_frame object. Returns false if the frame was not found.
* @param int $framenumber - Frame from the movie to return. If no framenumber is specified, returns the next frame of the movie.
* @return ffmpeg_frame
*/
public function getFrame($framenumber)
{ }
/** Returns the next key frame from the movie as an ffmpeg_frame object. Returns false if the frame was not found.
* @return ffmpeg_frame
*/
public function getNextKeyFrame()
{ }
}
class ffmpeg_frame
{
/**
* NOTE: This function will not be available if GD is not enabled.
* @param resource $gd_image
*/
public function __construct(resource $gd_image)
{
}
/** Return the width of the frame.
* @return int
*/
public function getWidth()
{ }
/** Return the height of the frame.
* @return int
*/
public function getHeight()
{ }
/** Return the presentation time stamp of the frame.
* @return int
*/
public function getPTS()
{ }
/** Return the presentation time stamp of the frame.
* @return int
*/
public function getPresentationTimestamp()
{ }
/** Resize and optionally crop the frame. (Cropping is built into ffmpeg resizing so I'm providing it here for completeness.)
* @param int $width - New width of the frame (must be an even number).
* @param int $height - New height of the frame (must be an even number).
* @param int $croptop - Remove [croptop] rows of pixels from the top of the frame.
* @param int $cropbottom - Remove [cropbottom] rows of pixels from the bottom of the frame.
* @param int $cropleft - Remove [cropleft] rows of pixels from the left of the frame.
* @param int $cropright - Remove [cropright] rows of pixels from the right of the frame.
* NOTE: Cropping is always applied to the frame before it is resized. Crop values must be even numbers.
*/
public function resize($width, $height, $crop_top = 0, $crop_bottom = 0, $crop_left = 0, $crop_right = 0)
{ }
/** Crop the frame.
* @param int $croptop - Remove [croptop] rows of pixels from the top of the frame.
* @param int $cropbottom - Remove [cropbottom] rows of pixels from the bottom of the frame.
* @param int $cropleft - Remove [cropleft] rows of pixels from the left of the frame.
* @param int $cropright - Remove [cropright] rows of pixels from the right of the frame.
* NOTE: Crop values must be even numbers.
*/
public function crop($crop_top, $crop_bottom = 0, $crop_left = 0, $crop_right = 0)
{ }
/** Returns a truecolor GD image of the frame.
* NOTE: This function will not be available if GD is not enabled.
* @return resource
*/
public function toGDImage()
{ }
}
class ffmpeg_animated_gif
{
/**
* @param string $output_file_path - Location in the filesystem where the animated gif will be written.
* @param int $width - Width of the animated gif.
* @param int $height - Height of the animated gif.
* @param int $frame_rate - Frame rate of the animated gif in frames per second.
* @param int $loop_count - Number of times to loop the animation. Put a zero here to loop forever or omit this parameter to disable looping.
*/
public function __construct($output_file_path, $width, $height, $frame_rate, $loop_count = 0)
{ }
/** Add a frame to the end of the animated gif.
* @param ffmpeg_frame $frame_to_add - The ffmpeg_frame object to add to the end of the animated gif.
*/
public function addFrame(ffmpeg_frame $frame_to_add)
{ }
}