• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In
Recached

visavi / rotor / 28340133337

28 Jun 2026 11:47PM UTC coverage: 16.561% (+0.09%) from 16.474%
28340133337

push

github

visavi
Ядро и модули переведены на datetime, удалена константа SITETIME

18 of 95 new or added lines in 31 files covered. (18.95%)

7 existing lines in 6 files now uncovered.

989 of 5972 relevant lines covered (16.56%)

2.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/app/Traits/ConvertVideoTrait.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace App\Traits;
6

7
use FFMpeg\Exception\RuntimeException;
8
use FFMpeg\FFMpeg;
9
use FFMpeg\FFProbe;
10
use FFMpeg\Format\Video\X264;
11

12
trait ConvertVideoTrait
13
{
14
    /**
15
     * Конвертирует видео
16
     */
17
    public function convertVideo(array $file): void
×
18
    {
19
        $isVideo = str_contains($file['mime_type'], 'video/');
×
20

21
        // Обработка видео
22
        if ($isVideo && config('ffmpeg.enabled')) {
×
23
            $config = [
×
24
                'ffmpeg.binaries'  => config('ffmpeg.path'),
×
25
                'ffprobe.binaries' => config('ffmpeg.ffprobe_path'),
×
26
                'ffmpeg.threads'   => config('ffmpeg.threads'),
×
27
                'timeout'          => config('ffmpeg.timeout'),
×
28
            ];
×
29

30
            // Перекодируем видео в h264
UNCOV
31
            $ffprobe = FFProbe::create($config);
×
32
            $videoInfo = $ffprobe
×
33
                ->streams(public_path($file['path']))
×
34
                ->videos()
×
35
                ->first();
×
36

37
            if (
38
                $videoInfo
×
39
                && $file['extension'] === 'mp4'
×
40
                && $videoInfo->get('codec_name') !== 'h264'
×
41
            ) {
42
                try {
43
                    $ffmpeg = FFMpeg::create($config);
×
44
                    $video = $ffmpeg->open(public_path($file['path']));
×
45

46
                    $format = new X264();
×
47

48
                    $video->save($format, public_path($file['path'] . '.convert.mp4'));
×
49

50
                    rename(public_path($file['path'] . '.convert.mp4'), public_path($file['path']));
×
51
                } catch (RuntimeException) {
×
52
                }
53
            }
54
        }
55
    }
56
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc