|
@@ -1,6 +1,7 @@
|
|
<?php
|
|
<?php
|
|
namespace App\Helper;
|
|
namespace App\Helper;
|
|
|
|
|
|
|
|
+use FFMpeg;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\UploadedFile;
|
|
use Illuminate\Http\UploadedFile;
|
|
use Symfony\Component\HttpFoundation\File\Exception\FileException;
|
|
use Symfony\Component\HttpFoundation\File\Exception\FileException;
|
|
@@ -67,16 +68,16 @@ trait AttachmentHelper
|
|
$url_path = $rel_path . '/' . $md5_filename;
|
|
$url_path = $rel_path . '/' . $md5_filename;
|
|
|
|
|
|
if ($fileMimeType == "video/mp4" || $fileMimeType == "video/quicktime") {
|
|
if ($fileMimeType == "video/mp4" || $fileMimeType == "video/quicktime") {
|
|
- $ffmpeg = \FFMpeg\FFMpeg::create(array(
|
|
|
|
|
|
+ $ffmpeg = FFMpeg\FFMpeg::create(array(
|
|
'ffmpeg.binaries' => '/usr/bin/ffmpeg',
|
|
'ffmpeg.binaries' => '/usr/bin/ffmpeg',
|
|
'ffprobe.binaries' => '/usr/bin/ffprobe'
|
|
'ffprobe.binaries' => '/usr/bin/ffprobe'
|
|
));
|
|
));
|
|
\Log::info($real_path);
|
|
\Log::info($real_path);
|
|
$video = $ffmpeg->open($real_path);
|
|
$video = $ffmpeg->open($real_path);
|
|
- $pic = public_path() . '/upload/vpic/'.$md5_filename.'.jpg';
|
|
|
|
|
|
+ $pic = public_path() . '/upload/vpic/'.$md5.'.jpg';
|
|
\Log::info($pic);
|
|
\Log::info($pic);
|
|
$video
|
|
$video
|
|
- ->frame(\FFMpeg\Coordinate\TimeCode::fromSeconds(10))
|
|
|
|
|
|
+ ->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(1))
|
|
->save( $pic );
|
|
->save( $pic );
|
|
}
|
|
}
|
|
$attachment = new BaseAttachmentModel();
|
|
$attachment = new BaseAttachmentModel();
|