Total Complexity | 3 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
8 | trait HandlesFFMpeg |
||
9 | { |
||
10 | public function mergeWithFFMpeg(): void |
||
11 | { |
||
12 | $exporter = FFMpeg::fromDisk($this->manager->chunksFilesystem()) |
||
13 | ->open($this->mapChunksToArray()) |
||
|
|||
14 | ->export() |
||
15 | ->inFormat($this->guessFormat()) |
||
16 | ->concatWithoutTranscoding(); |
||
17 | |||
18 | if (! empty($visibility = $this->visibility())) { |
||
19 | $exporter->withVisibility($visibility); |
||
20 | } |
||
21 | |||
22 | $exporter->toDisk( |
||
23 | $this->manager->getMergeDisk() |
||
24 | )->save($this->destination); |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Retrieve visibility option. |
||
29 | * |
||
30 | * @return string|null |
||
31 | */ |
||
32 | public function visibility(): ?string |
||
37 | ); |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Guess format from destination file extension. |
||
42 | * |
||
43 | * @return mixed |
||
44 | */ |
||
45 | abstract public function guessFormat(); |
||
46 | } |
||
47 |