FormatFilter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 7
c 1
b 1
f 0
dl 0
loc 18
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFormatOptions() 0 12 1
1
<?php
2
3
4
namespace Streaming\Filters;
5
6
7
use FFMpeg\Format\VideoInterface;
8
use Streaming\Utiles;
9
10
abstract class FormatFilter extends StreamFilter
11
{
12
    /**
13
     * @param VideoInterface $format
14
     * @return array
15
     */
16
    protected function getFormatOptions(VideoInterface $format): array
17
    {
18
        $basic = Utiles::arrayToFFmpegOpt([
19
            'c:v' => $format->getVideoCodec(),
20
            'c:a' => $format->getAudioCodec(),
21
        ]);
22
23
        $options = Utiles::arrayToFFmpegOpt(
24
            array_merge($format->getAdditionalParameters() ?? [])
25
        );
26
27
        return array_merge($basic, $options);
28
    }
29
}