/** * Extract file meta data * * @param File $file file instance * @return Meta */ protected function extractInformation(File $file) { $meta = new Meta(); $meta->id = $file->getId(); $meta->originId = $file->getOriginId(false); $tmpPathname = $this->temp->getTempPathname(); $this->temp->createFile($tmpPathname, $this->storage->read($file)); $info = $this->reader->analyze($tmpPathname); $this->temp->remove($tmpPathname); if (isset($info['audio']['streams'])) { unset($info['audio']['streams']); } $meta->audio = $info['audio']; $meta->video = $info['video']; $meta->playtime = $info['playtime_seconds']; $meta->bitrate = $info['bitrate']; return $meta; }