Conditions | 1 |
Paths | 1 |
Total Lines | 23 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | public function generate() : void |
||
13 | { |
||
14 | $originalDestionation = $this->destination; |
||
15 | $this->destination = $this->options->getTempFolder() . '/' . md5($this->sourceFile) . '-temp.avi'; |
||
16 | |||
17 | parent::generate(); |
||
18 | |||
19 | $this->addTempFileToRemove($this->destination); |
||
20 | |||
21 | $ffmpeg = $this->getFFMpeg(); |
||
22 | /** @var Video $video */ |
||
23 | $video = $ffmpeg->open($this->destination); |
||
24 | |||
25 | $gif = new Gif( |
||
26 | $video, |
||
27 | $video->getFFMpegDriver(), |
||
28 | $video->getFFProbe(), |
||
29 | TimeCode::fromSeconds(0), |
||
30 | new Dimension($this->options->getDimensionWidth(), $this->options->getDimensionWidth() / $this->getRatio()), |
||
|
|||
31 | $this->getDuration() |
||
32 | ); |
||
33 | |||
34 | $gif->save($originalDestionation); |
||
35 | } |
||
37 |