Video thumbnail plugin Video thumbnail plugin
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Video thumbnail plugin

Started by Irondutchess, April 03, 2020, 08:15:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Irondutchess

Hi,

After uploading mp4 video to the gallery, the thumbnail shown is just a generic video thumbnail. Is there a plugin or a way to get Coppermine to display a thumbnail from the actual video?

Irondutchess

I am aware you can make a sreenshot image of every video and upload it as thumb_filrname.jpg/png.

I was interested to know if there was an outomated option the same as you have for images?

ron4mac

There is this: https://forum.coppermine-gallery.net/index.php/topic,79519.0.html
But it is some work to make the image first.

Because I've had COVID-19 time on my hands, I thought I would try to put something together. There are too many issues trying to do something on the server when the video is uploaded ... so I've approached it from the client side. I'm almost done with it (another day or two). The way it will work is that, when on the intermediate page for the video, there will be a button to create a thumbnail from the video's current frame. So you can position the video where you want, hit the button and the thumbnail will be set. It will require a modern web browser and will (currently) only work with videos handled by the CPG HTMLV player.

Irondutchess

Cool,  This gets me a good way there, saves a lot of the work required to create a video thumbnail.

Many thanks  :)

ron4mac

#4
You can try out this initial version of the plugin. Let me know what issues you might have.

See the contributed version here.

Irondutchess

There doesn't seem to be any issues so far. The only thing to watch is if you already have a thumb that you created manually and it is a .png file, the new thumbnail is created as a .jpg, and for some reason .png files take presidence over .jpg, so you have to delete your original thumb .png image before the .jpg thumb will show.

Not really an issue for the first itme use or subsequent use as the .jpg will just get overwritten.  It will just need a mention in the instructions that if you have a .png thumb already it will need to be deleted first.

This plugin seems to work perfectly, and saves a huge amount of work.

Many thanks for your efforts and providing the solution to my problem  :)

ron4mac

Quote from: Irondutchess on April 05, 2020, 01:39:01 PM
The only thing to watch is if you already have a thumb that you created manually and it is a .png file, the new thumbnail is created as a .jpg, and for some reason .png files take presidence over .jpg, so you have to delete your original thumb .png image before the .jpg thumb will show.

Not really an issue for the first itme use or subsequent use as the .jpg will just get overwritten.  It will just need a mention in the instructions that if you have a .png thumb already it will need to be deleted first.

It is slightly dependent on the browser, but I could add an option whether .jpg or .png thumbs are created. Went with jpegs as the size would be smaller.

See above for an updated version that adds a small overlay as indication that it is a video.

Irondutchess

Quote from: ron4mac on April 05, 2020, 02:07:25 PM

See above for an updated version that adds a small overlay as indication that it is a video.

I'm not sure I follow you regarding the 'overlay', is this an overlay on the thumbnail indicating it is a video?  I have created thumbnails in Chrome & Firefox running on Linux Mint and the thumbnails look the same.

I think you were right to choose .jpg. I just had .png thumbnail images as it was the omly option in the program I use to take screenshots of the videos.

ron4mac

Quote from: Irondutchess on April 05, 2020, 02:41:54 PM
I'm not sure I follow you regarding the 'overlay', is this an overlay on the thumbnail indicating it is a video?  I have created thumbnails in Chrome & Firefox running on Linux Mint and the thumbnails look the same.

You may have to clear your browser cache to get the effect ...

Irondutchess

Quote from: ron4mac on April 05, 2020, 03:08:33 PM
You may have to clear your browser cache to get the effect ...

Cleared the cache in both Chrome and Firefox, no change.  I use the Cloudflare open DNS servers, so maybe they or my ISP have some kind of caching going on?

Irondutchess

Well that's strange, I went off to do a couple of jobs and grab a coffe, and when I came back and refreshed the page it had started working  :D must have been a cache problem of some sort.

That feature is really useful, especially on the home page when random files are displayed.

Im expecting this to be a popular plugin, as not only does it make creating video thumbnails easy, you have an infinite choice of which video frame to choose.


phill104

I've seen Linux Mint do caching of served webpages in the past but cannot remember what the module was called. Last time I used it was in 2015 on version 17 cinnamon so a lot has changed. You may want to start there, but IIRC the time was set quite low So it is probably not worth the effort,
It is a mistake to think you can solve any major problems just with potatoes.