Exemplo n.º 1
0
 public function testgetPicture()
 {
     $ff = new FFmpeg();
     $ff->setFile(__DIR__ . '/../../_file/bunny.mp4');
     $file = file_get_contents(__DIR__ . '/../../_file/picture.jpg');
     $this->assertEquals($ff->getPicture(), $file);
     $this->assertEquals($ff->getFormat(), 'jpg');
     $this->assertEquals($ff->getTypeMine(), 'image/jpeg');
 }
Exemplo n.º 2
0
 /**
  * Convert format file.
  */
 private function createPicture()
 {
     $ff = new FFmpeg();
     $ff->setFile($this->document->getPathDat());
     $this->getNewDocument()->setDatas($ff->getPicture($this->getPage() !== null ? $this->getPage() : 50));
     $this->getNewDocument()->setEncoding(Document::TYPE_BINARY_STR);
     $this->getNewDocument()->setFormat($ff->getFormat());
     $this->getNewDocument()->setSize($ff->getSize());
     $this->getNewDocument()->setType($ff->getTypeMine());
     $this->getNewDocument()->setName($this->document->getName());
     $this->getNewDocument()->setWeight(strlen($this->getNewDocument()->getDatas()));
     $this->setPage(null);
 }