scratch – Diff between revs 112 and 115
?pathlinks?
Rev 112 | Rev 115 | |||
---|---|---|---|---|
Line 116... | Line 116... | |||
116 | $config['STORE_FOLDER'], |
116 | $config['STORE_FOLDER'], |
|
117 | $file |
117 | $file |
|
118 | ) |
118 | ) |
|
119 | ); |
119 | ); |
|
Line -... | Line 120... | |||
- | 120 | |
||
- | 121 | ### Do not re-create the thumbnail if it already exists. |
||
120 | |
122 | if(!file_exists($userPath.'.'.'jpg')) { |
|
121 | ### Extract thumbnail. |
123 | ### Extract thumbnail. |
|
122 | $ffmpeg = FFMpeg\FFMpeg::create(); |
124 | $ffmpeg = FFMpeg\FFMpeg::create(); |
|
123 | $video = $ffmpeg->open($CANON_URL); |
125 | $video = $ffmpeg->open($CANON_URL); |
|
124 | $frame = $video->frame( |
126 | $frame = $video->frame( |
|
125 | FFMpeg\Coordinate\TimeCode::fromSeconds( |
127 | FFMpeg\Coordinate\TimeCode::fromSeconds( |
|
126 | $config['VIDEO_PREVIEW_IMAGE_FRAME_SECOND'] |
128 | $config['VIDEO_PREVIEW_IMAGE_FRAME_SECOND'] |
|
127 | ) |
129 | ) |
|
128 | ); |
130 | ); |
|
- | 131 | $frame->save($userPath.'.'.'jpg'); |
||
- | 132 | } |
||
- | 133 | |
||
129 | $frame->save($userPath.'.'.'jpg'); |
134 | ### Get preview image size. |
|
Line 130... | Line 135... | |||
130 | list($imageWidth, $imageHeight) = getimagesize($userPath.'.'.'jpg'); |
135 | list($imageWidth, $imageHeight) = getimagesize($userPath.'.'.'jpg'); |
|
131 | |
136 | |
|
132 | ### Probe video for width and height. |
137 | ### Probe video for width and height. |