Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 244 | Rev 246 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 244 Rev 245
Línea 117... Línea 117...
117
                            'height' => $sizes[1]
117
                            'height' => $sizes[1]
118
                        ]);    
118
                        ]);    
119
                    }
119
                    }
Línea -... Línea 120...
-
 
120
                    
120
                    
121
                    
-
 
122
                    //$cmd        = "/usr/bin/ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width  $full_filename";
121
                    
123
                    $cmd        = "/usr/bin/ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width  $full_filename";
-
 
124
                    
122
                    $cmd        = "/usr/bin/ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width  $full_filename";
125
                    echo $cmd . PHP_EOL. PHP_EOL. PHP_EOL;
-
 
126
                    
Línea 123... Línea 127...
123
                    //$cmd        = "ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width  $full_filename";
127
                    $response   = trim(shell_exec($cmd));
124
                    $response   = trim(shell_exec($cmd));
128
                    echo $response . PHP_EOL. PHP_EOL. PHP_EOL;
Línea 137... Línea 141...
137
                            $values = explode('=', $line);
141
                            $values = explode('=', $line);
138
                            $source_height = $values[1];
142
                            $source_height = $values[1];
139
                        }
143
                        }
140
                    }
144
                    }
Línea -... Línea 145...
-
 
145
                    
-
 
146
 
-
 
147
             
Línea 141... Línea 148...
141
                    
148
                    
Línea 152... Línea 159...
152
                            if($orientation == 'P' && $target_height < $size['height']) {
159
                            if($orientation == 'P' && $target_height < $size['height']) {
153
                                $target_width   = $size['width'];
160
                                $target_width   = $size['width'];
154
                                $target_height  = $size['height'];
161
                                $target_height  = $size['height'];
155
                            }
162
                            }
Línea 156... Línea 163...
156
 
163
 
157
                            if($orientation == 'P' && $target_width <  $size['width']) {
164
                            if($orientation == 'L' && $target_width <  $size['width']) {
158
                                $target_width   = $size['width'];
165
                                $target_width   = $size['width'];
159
                                $target_height  = $size['height'];
166
                                $target_height  = $size['height'];
Línea 160... Línea 167...
160
                            }
167
                            }
Línea 168... Línea 175...
168
                        $target_width = $candidate_sizes[0]['width'];
175
                        $target_width = $candidate_sizes[0]['width'];
169
                        $target_height = $candidate_sizes[0]['height'];
176
                        $target_height = $candidate_sizes[0]['height'];
170
                    }
177
                    }
Línea -... Línea 178...
-
 
178
                    
-
 
179
                    
-
 
180
                    echo 'source_width = ' . $source_width . PHP_EOL;
-
 
181
                    echo 'source_height = ' . $source_height . PHP_EOL . PHP_EOL;
-
 
182
                    
-
 
183
                    
-
 
184
                    echo 'target_width = ' . $target_width . PHP_EOL;
-
 
185
                    echo 'target_height = ' . $target_height . PHP_EOL . PHP_EOL;
-
 
186
             
171
                    
187
                    
172
                    
188
                    
173
                    if($source_width && $source_height) {
189
                    if($source_width && $source_height) {
174
                        $width_ratio    = $target_width / $source_width;
190
                        $width_ratio    = $target_width / $source_width;
Línea 180... Línea 196...
180
                    } else {
196
                    } else {
181
                        $resized_width = $target_width;
197
                        $resized_width = $target_width;
182
                        $resized_height = $target_height;
198
                        $resized_height = $target_height;
183
                    }
199
                    }
Línea -... Línea 200...
-
 
200
                    
-
 
201
                    
-
 
202
                    echo 'resized_width = ' . $resized_width . PHP_EOL;
-
 
203
                    echo 'resized_height = ' . $resized_height . PHP_EOL . PHP_EOL;
-
 
204
                    
-
 
205
                   
-
 
206
                    
-
 
207
                    
184
                    
208
                    
185
                    $values = explode('.', $full_filename);
209
                    $values = explode('.', $full_filename);
Línea 186... Línea 210...
186
                    $full_tempname = $values[0] .'-' . uniqid() . '.' . $values[1];
210
                    $full_tempname = $values[0] .'-' . uniqid() . '.' . $values[1];
Línea 187... Línea 211...
187
                    
211
                    
188
                    rename($full_filename, $full_tempname);
212
                    rename($full_filename, $full_tempname);
189
                    
-
 
190
                    $sizeVideo = $resized_width . ':' . $resized_height;
-
 
191
                    $cmd            = "/usr/bin/ffmpeg -y -i $full_tempname -vf scale=$sizeVideo $full_filename";
-
 
Línea -... Línea 213...
-
 
213
                    
-
 
214
                    $sizeVideo = $resized_width . ':' . $resized_height;
-
 
215
                    //$cmd            = "/usr/bin/ffmpeg -y -i $full_tempname -vf scale=$sizeVideo $full_filename";
-
 
216
                    
Línea 192... Línea 217...
192
                    
217
                    
193
                    //$cmd            = "ffmpeg -y -i $full_tempname -vf scale=$sizeVideo $full_filename";
218
                    $cmd            = "/usr/bin/ffmpeg -y -i $full_tempname -vf scale=$sizeVideo,setdar=9,16  $full_filename";
-
 
219
                    echo $cmd . PHP_EOL. PHP_EOL. PHP_EOL;
-
 
220
                    exec($cmd);
194
                    exec($cmd);
221
                   
Línea 195... Línea 222...
195
                    
222
                    
Línea -... Línea 223...
-
 
223
                    
-
 
224
                    //$cmd            = "/usr/bin/ffmpeg -y -i $full_tempname  -vframes 1  -vf scale=$sizeVideo $full_filename $full_filename_poster";
196
                    
225
                    $cmd            = "/usr/bin/ffmpeg -y -i $full_tempname  -frames:v 1 -vf scale=$sizeVideo $full_filename $full_filename_poster";
Línea 197... Línea 226...
197
                    
226
                   
198
                    
227
                    echo $cmd . PHP_EOL. PHP_EOL. PHP_EOL. PHP_EOL;