madsynn's avatar

Need some assistance with spatie-medialibrary

1

I have this library installed and working just fine. Question is on this command i would like to run it for every 5 seconds not just once can you tell me how i would go about doing this? like a repeating command of some sort?

https://github.com/spatie/laravel-medialibrary

https://docs.spatie.be/laravel-medialibrary/v7/converting-other-file-types/using-image-generators

Current

$this->addMediaConversion('thumb')
     ->width(368)
     ->height(232)
     ->extractVideoFrameAtSecond(20)
     ->performOnCollections('videos');

What I need it to do?

$this->addMediaConversion('thumb')
     ->width(368)
     ->height(232)
     ->extractVideoFrameAtSecond(EVERY 5 SECONDS)
     ->performOnCollections('videos');

2

On this model i have both videos and images fields for multiple uploads where they upload to same collections.

toMediaCollection('images') toMediaCollection('videos')

Both are working correctly but when the images are generated from the video i need them to show in the images section if index.blade.php and i'm not sure how to make that happen.

Here is what is happening.

Video uploads to

uploads/clips/{id}/

Images generated from the video go to

uploads/clips/{id}/conversions/

Images uploaded are here

uploads/images/{id}/

I need the images from the video to show up as a uploaded image so they show in the same index.

Any help would be very appreciated as I am stuck.

0 likes
0 replies

Please or to participate in this conversation.