@@ -13,21 +13,29 @@ class FFMpeg
13
13
14
14
public string $ ffprobe ;
15
15
16
+ public ?string $ logChannel = null ;
17
+
16
18
final public function __construct (
17
19
?string $ ffmpeg = null ,
18
20
?string $ ffprobe = null ,
21
+ ?string $ logChannel = null ,
19
22
) {
20
23
// @phpstan-ignore-next-line
21
24
$ this ->ffmpeg = $ ffmpeg ?? config ('media.ffmpeg.ffmpeg_binaries ' ) ?? config ('laravel-ffmpeg.ffmpeg.binaries ' );
25
+
22
26
// @phpstan-ignore-next-line
23
27
$ this ->ffprobe = $ ffprobe ?? config ('media.ffprobe.ffprobe_binaries ' ) ?? config ('laravel-ffmpeg.ffprobe.binaries ' );
28
+
29
+ // @phpstan-ignore-next-line
30
+ $ this ->logChannel = $ logChannel ?? config ('media.ffmpeg.log_channel ' );
24
31
}
25
32
26
33
public static function make (
27
34
?string $ ffmpeg = null ,
28
35
?string $ ffprobe = null ,
36
+ ?string $ logChannel = null ,
29
37
): static {
30
- return new static ($ ffmpeg , $ ffprobe );
38
+ return new static ($ ffmpeg , $ ffprobe, $ logChannel );
31
39
}
32
40
33
41
public function video (): Video
@@ -40,9 +48,8 @@ public function video(): Video
40
48
*/
41
49
protected function execute (string $ command ): array
42
50
{
43
- // @phpstan-ignore-next-line
44
- if ($ channel = config ('media.ffmpeg.log_channel ' )) {
45
- Log::channel ($ channel )->info ("ffmpeg: {$ command }" );
51
+ if ($ this ->logChannel ) {
52
+ Log::channel ($ this ->logChannel )->info ("ffmpeg: {$ command }" );
46
53
}
47
54
48
55
exec ($ command , $ output , $ code );
0 commit comments