class ProcessNewVideo extends Job implements ShouldQueue

Traits

SerializesModels
InteractsWithQueue
Queueable
Dispatchable

Properties

int $tries

The number of times the job may be attempted.

Video $video

The new video that should be processed.

protected Video $ffmpegVideo

The FFMpeg video instance.

protected bool $deleteWhenMissingModels

Ignore this job if the video does not exist any more.

Methods

__construct(Video $video)

Create a new instance.

void
handle()

Execute the job.

handleFile(Video $file, string $path)

Process a cached video file.

string
getCodec(string $url)

Get the codec of a video

float
getVideoDuration(string $path)

Get the duration of the video.

Dimension
getVideoDimensions(string $url)

Get the dimensions of a video

string
generateVideoThumbnail(string $path, float $time, int $width, int $height, string $format)

Generate a thumbnail from the video at the specified time.

array
getThumbnailTimes(float $duration)

Get the times at which thumbnails should be sampled.

Details

at line 61
__construct(Video $video)

Create a new instance.

Parameters

Video $video

The video that should be processed.

at line 71
void handle()

Execute the job.

Return Value

void

at line 108
handleFile(Video $file, string $path)

Process a cached video file.

Parameters

Video $file
string $path

at line 175
protected string getCodec(string $url)

Get the codec of a video

Parameters

string $url

URL/path to the video file

Return Value

string

at line 195
protected float getVideoDuration(string $path)

Get the duration of the video.

Parameters

string $path

Video file path.

Return Value

float

Duration in seconds.

at line 209
protected Dimension getVideoDimensions(string $url)

Get the dimensions of a video

Parameters

string $url

URL/path to the video file

Return Value

Dimension

at line 229
protected string generateVideoThumbnail(string $path, float $time, int $width, int $height, string $format)

Generate a thumbnail from the video at the specified time.

Parameters

string $path

Path to the video file.

float $time

Time for the thumbnail in seconds.

int $width

Width of the thumbnail.

int $height

Height of the thumbnail.

string $format

File format of the thumbnail (e.g. 'jpg').

Return Value

string

Vips image buffer string.

at line 253
protected array getThumbnailTimes(float $duration)

Get the times at which thumbnails should be sampled.

Parameters

float $duration

Video duration.

Return Value

array