Failed Conditions
Push — master ( 814bec...e68911 )
by Sébastien
03:09
created

FFMpegAdapter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 68
ccs 0
cts 59
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B getParamsOptions() 0 63 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Soluble\MediaTools\Video\Converter\Adapter;
6
7
use Soluble\MediaTools\Video\Converter\ParamsInterface;
8
9
class FFMpegAdapter implements AdapterInterface
10
{
11
    /**
12
     * @return array<string, array<string, string>>
13
     */
14
    public static function getParamsOptions(): array
15
    {
16
        return [
17
            ParamsInterface::PARAM_OUTPUT_FORMAT => [
18
                'cli_pattern' => '-f %s',
19
            ],
20
21
            ParamsInterface::PARAM_VIDEO_CODEC => [
22
                'cli_pattern' => '-vcodec %s',
23
            ],
24
            ParamsInterface::PARAM_VIDEO_BITRATE => [
25
                'cli_pattern' => '-b:v %s',
26
            ],
27
            ParamsInterface::PARAM_VIDEO_MIN_BITRATE => [
28
                'cli_pattern' => '-minrate %s',
29
            ],
30
            ParamsInterface::PARAM_VIDEO_MAX_BITRATE => [
31
                'cli_pattern' => '-maxrate %s',
32
            ],
33
34
            ParamsInterface::PARAM_AUDIO_CODEC => [
35
                'cli_pattern' => '-acodec %s',
36
            ],
37
            ParamsInterface::PARAM_AUDIO_BITRATE => [
38
                'cli_pattern' => '-b:a %s',
39
            ],
40
            ParamsInterface::PARAM_PIX_FMT => [
41
                'cli_pattern' => '-pix_fmt %s',
42
            ],
43
            ParamsInterface::PARAM_PRESET => [
44
                'cli_pattern' => '-preset %s',
45
            ],
46
            ParamsInterface::PARAM_SPEED => [
47
                'cli_pattern' => '-speed %s',
48
            ],
49
            ParamsInterface::PARAM_THREADS => [
50
                'cli_pattern' => '-threads %s',
51
            ],
52
53
            ParamsInterface::PARAM_KEYFRAME_SPACING => [
54
                'cli_pattern' => '-g %s',
55
            ],
56
            ParamsInterface::PARAM_QUALITY => [
57
                'cli_pattern' => '-quality %s',
58
            ],
59
            ParamsInterface::PARAM_CRF => [
60
                'cli_pattern' => '-crf %s',
61
            ],
62
            ParamsInterface::PARAM_STREAMABLE => [
63
                'cli_pattern' => '-movflags +faststart',
64
            ],
65
66
            ParamsInterface::PARAM_FRAME_PARALLEL => [
67
                'cli_pattern' => '-frame-parallel %s',
68
            ],
69
            ParamsInterface::PARAM_TILE_COLUMNS => [
70
                'cli_pattern' => '-tile-columns %s',
71
            ],
72
            ParamsInterface::PARAM_TUNE => [
73
                'cli_pattern' => '-tune %s',
74
            ],
75
            ParamsInterface::PARAM_VIDEO_FILTER => [
76
                'cli_pattern' => '-vf %s',
77
            ],
78
        ];
79
    }
80
}
81