Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 242 Rev 244
Línea 77... Línea 77...
77
            $videoConvertMapper->delete($video);
77
            $videoConvertMapper->delete($video);
Línea 78... Línea 78...
78
            
78
            
79
            $full_filename = $video->filename;
79
            $full_filename = $video->filename;
Línea 80... Línea 80...
80
            $full_filename = str_replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $full_filename);
80
            $full_filename = str_replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $full_filename);
Línea 81... Línea 81...
81
            
81
            
Línea 82... Línea 82...
82
            $full_filename_poster = substr($full_filename, 0, strlen($full_filename) - 3) . '.jpg';
82
            $full_filename_poster = substr($full_filename, 0, strlen($full_filename) - 3) . 'jpg';
Línea 94... Línea 94...
94
                    case VideoConvert::TYPE_MICRO_LEARNING :
94
                    case VideoConvert::TYPE_MICRO_LEARNING :
95
                        $size = $this->config['leaderslinked.image_sizes.microlearning_video_size'];
95
                        $size = $this->config['leaderslinked.image_sizes.microlearning_video_size'];
96
                        break;
96
                        break;
Línea 97... Línea 97...
97
                        
97
                        
98
                    default : 
98
                    default : 
Línea 99... Línea 99...
99
                        $size = [];
99
                        $size = '';
Línea -... Línea 100...
-
 
100
                        
-
 
101
                }
100
                        
102
                
101
                }
-
 
102
                
-
 
103
                if($size) {
-
 
104
                    $sizes = explode('x', $size);
-
 
105
                    $target_width = $sizes[0];
-
 
Línea -... Línea 103...
-
 
103
   
-
 
104
                
-
 
105
                if($size) {
-
 
106
                    
-
 
107
                    $target_width = 0 ; 
-
 
108
                    $target_height = 0;
-
 
109
                    
-
 
110
                    $candidate_sizes = [];
-
 
111
                    $arrSizes = explode(',', $size);
-
 
112
                    foreach($arrSizes as $elementSize)
-
 
113
                    {
-
 
114
                        $sizes = explode('x', $elementSize);
-
 
115
                        array_push($candidate_sizes, [
Línea 106... Línea 116...
106
                    $target_height = $sizes[0];
116
                            'width' =>  $sizes[0],
-
 
117
                            'height' => $sizes[1]
107
                    $source_width =  0;
118
                        ]);    
Línea 108... Línea 119...
108
                    $source_height = 0;
119
                    }
Línea 109... Línea 120...
109
                    
120
                    
110
                    
121
                    
111
                    
122
                    $cmd        = "/usr/bin/ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width  $full_filename";
112
                    $cmd        = "/usr/bin/ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width  $full_filename";
123
                    //$cmd        = "ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width  $full_filename";
Línea 128... Línea 139...
128
                        }
139
                        }
129
                    }
140
                    }
Línea 130... Línea 141...
130
                    
141
                    
-
 
142
                    
-
 
143
                    
-
 
144
                    if($source_width && $source_height) {
-
 
145
                        
-
 
146
                        
-
 
147
                        $orientation = $source_width > $source_height ? 'L' : 'P';
-
 
148
                        
-
 
149
                        foreach($candidate_sizes as $size) 
-
 
150
                        {
-
 
151
 
-
 
152
                            if($orientation == 'P' && $target_height < $size['height']) {
-
 
153
                                $target_width   = $size['width'];
-
 
154
                                $target_height  = $size['height'];
-
 
155
                            }
-
 
156
 
-
 
157
                            if($orientation == 'P' && $target_width <  $size['width']) {
-
 
158
                                $target_width   = $size['width'];
-
 
159
                                $target_height  = $size['height'];
-
 
160
                            }
-
 
161
                            
-
 
162
                        }
-
 
163
                        
-
 
164
                        
-
 
165
                        
-
 
166
                    
-
 
167
                    } else {
-
 
168
                        $target_width = $candidate_sizes[0]['width'];
-
 
169
                        $target_height = $candidate_sizes[0]['height'];
-
 
170
                    }
131
                    
171
                    
132
                    
172
                    
133
                    if($source_width && $source_width) {
173
                    if($source_width && $source_height) {
Línea 134... Línea 174...
134
                        $width_ratio    = $target_width / $source_width;
174
                        $width_ratio    = $target_width / $source_width;
Línea 146... Línea 186...
146
                    $full_tempname = $values[0] .'-' . uniqid() . '.' . $values[1];
186
                    $full_tempname = $values[0] .'-' . uniqid() . '.' . $values[1];
Línea 147... Línea 187...
147
                    
187
                    
Línea 148... Línea 188...
148
                    rename($full_filename, $full_tempname);
188
                    rename($full_filename, $full_tempname);
149
                    
189
                    
-
 
190
                    $sizeVideo = $resized_width . ':' . $resized_height;
-
 
191
                    $cmd            = "/usr/bin/ffmpeg -y -i $full_tempname -vf scale=$sizeVideo $full_filename";
150
                    $sizeVideo = $resized_width . ':' . $resized_height;
192
                    
Línea 151... Línea 193...
151
                    $cmd            = "/usr/bin/ffmpeg -i $full_tempname -vf scale=$sizeVideo $full_filename";
193
                    //$cmd            = "ffmpeg -y -i $full_tempname -vf scale=$sizeVideo $full_filename";
-
 
194
                    exec($cmd);
152
                    exec($cmd);
195
                    
Línea 153... Línea 196...
153
                    
196
                    
Línea 154... Línea 197...
154
                    
197