file_exists($path.'-'.$maxX.'-'.$maxY.'-'.$scalingup)) { return new \OC_Image($thumbnails_view->getLocalFile($path.'-'.$maxX.'-'.$maxY.'-'.$scalingup)); } // does the sourcefile exist? if (!\OC_Filesystem::file_exists($path)) { \OC_Log::write('Preview', 'File '.$path.' don\'t exists', \OC_Log::WARN); return false; } // call ffmpeg to do the screenshot shell_exec('ffmpeg -y -i {'.escapeshellarg($path).'} -f mjpeg -vframes 1 -ss 1 -s {'.escapeshellarg($maxX).'}x{'.escapeshellarg($maxY).'} {.'.$thumbnails_view->getLocalFile($path.'-'.$maxX.'-'.$maxY.'-'.$scalingup).'}'); // output the generated Preview $thumbnails_view->getLocalFile($path.'-'.$maxX.'-'.$maxY.'-'.$scalingup); unset($thumbnails_view); } } OC_Preview::registerProvider('OC_Preview_Movie'); }