$paths[] = $field["Path"];
     }
     $originalname = $field["OriginalName"];
 }
 array_multisort($sortarray, SORT_DESC, $paths);
 if (!preg_match('/ftp:\\/\\//', $paths[0])) {
     $tmpdir = $config['tempdir'] . "/MP" . md5($paths[0]);
     $this_path = getcwd();
     chdir(dirname($tmpdir));
     @mkdir(basename($tmpdir), 0775);
     chdir($tmpdir);
     $directory = translit($originalname);
     $directory = preg_replace('{[^a-z0-9_]}', "", str_replace(" ", "_", str_replace("%20", "_", strtolower($directory))));
     $directory = "frames/" . $film . "_" . substr($directory, 0, 40);
     $filename = $paths[0];
     $ThisFileInfo = $storages->getMetaInfo($filename);
     $playtime_seconds = $ThisFileInfo["playtime_seconds"] ? $ThisFileInfo["playtime_seconds"] : 3600;
     $frame_rate = $ThisFileInfo['video']["frame_rate"];
     $small_frame_width = isset($config['small_frame_width']) ? $config['small_frame_width'] : 80;
     $command = "{$config['mencoder']} -frames 1 -ovc lavc -lavcopts vcodec={$config['vcodec']} -nosound -o {$tmpdir}/tmp.avi ";
     for ($j = 0; $j < $count; $j++) {
         $res = array();
         $ss = floor(rand(300, $playtime_seconds - 600));
         $nfilename = escapeshellarg($storages->decode_path($filename));
         $command .= " {$nfilename} -ss {$ss} ";
     }
     echo "{$command}<br>\n";
     exec($command, $output);
     echo implode("<br>\n", $output);
     $smallframes = array();
     $frames = array();