Page MenuHomePhabricator

Allow way to choose thumbnail frame for video on its File: description page
Open, LowPublic


When uploading a video file (for example to Wikimedia Commons) a thumbnail for the media detail page is automatically generated, apparently somewhere around the middle of the movie. In some cases it would be very welcome if a possibility would exists to change the thumbnail, e.g.:

See a discussion about this subject here in the village pump on Commons:

One suggestion is to add a special keyword to the page to change the thumbnail moment, e.g.:


See Also:
T44632: Ability to specify default page of multi-paged media
T225593: Allow defining a specific frame for video file thumbnail, on demand (via the "thumbtime" parameter)

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:50 PM
bzimport set Reference to bz20647.
bzimport added a subscriber: Unknown Object (MLST).

There's interest in this again due to T92457 -- PageImages sometimes selects a video that's listed prominently, and it'd be easy for everyone if the default thumbnail could be set nicely.

Note this needs to work across foreign repos for Commons and such.

Jdlrobson raised the priority of this task from Low to Medium.Apr 25 2018, 6:40 PM
Jdlrobson added a project: Web-Team-Backlog.
Jdlrobson moved this task from Incoming to Needs Prioritization on the Web-Team-Backlog board.

A parser function that sets a page prop with the target time should be fairly easy to create on the backend, with prettier UX for setting it via GUI something to consider as an alternative or future addition.

Cross-site considerations, however:

  • if just in the page prop, it won't be visible to a Handler on a foreign wiki (eg, enwiki vs file+file page on commons).
  • -> so could instead save into the file's metadata, which gets exported via both local foreign repos (WMF sites) and API repos (InstantCommons)
  • Probably should save into page props *and* reflect into the metadata? Or is that redundant...

Handler transforms then only need to pull the default time from the metadata, which they already receive...

Thumbs using the default -- in place of the -seek=60- or whatever in their filenames, however, will go to thumbor in production instead of to MediaWiki, and will not see the default. I think this is not a problem however -- we only need to apply the default at transform generation time, so we'll be producing a distinct URL with the exact time.

Another consideration is cache invalidation -- when changing the metadata we must invalidate cache usages of the file as well as the page.

Who maintains this extension or knows enough about how it works to help set this up?

For TimedMediaHandler that'd be me -- I'll do a spike on this tomorrow. :)

Got sidetracked on a research project; continuing. :)

Unblocked, got a patch for that. :D Will poke further along today.

Is there a patch I can help review?

Change 436434 had a related patch set uploaded (by Brion VIBBER; owner: Brion VIBBER):
[mediawiki/extensions/TimedMediaHandler@master] DO NOT MERGE - WIP - Thumbtime parser function for TMH

@Jdlrobson I just uploaded my current version of it. I've got the parser function & page prop working, but trying to shove it into the extended file metadata may be a mistake. Currently it fails in concert with CommonsMetadata extension. I'll see if there's a saner way to do this tomorrow. :D Feel free to take a peek!

@brion just to note this is on my radar but annual reviews are taking up all my time right now :)

Aklapper lowered the priority of this task from Medium to Low.Jun 12 2019, 10:31 AM
Aklapper updated the task description. (Show Details)
Aklapper removed a subscriber: wikibugs-l-list.

What's the state of the associated patch @brion ?

Removing task assignee due to inactivity, as this open task has been assigned to the same person for more than two years (see the emails sent to the task assignee on Oct27 and Nov23). Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome.
(See for tips how to best manage your individual work in Phabricator.)

At [[commons:Commons:Deletion requests/File:Why Can't You Download Videos on YouTube How a 20-Year-Old Law Stops youtube-dl Users AND Farmers.webm‎]], we have a case where the auto-selected image is a nonfree frame. It's likely de minimis within the video, but it's not appropriate as the default thumb. And if we blur/blank it out for stricter license compliance, then we have blurred or blank image as the default thumb.

Change 436434 abandoned by TheDJ:

[mediawiki/extensions/TimedMediaHandler@master] Thumbtime parser function for TMH


3 years old

Change 436434 restored by TheDJ:

[mediawiki/extensions/TimedMediaHandler@master] Thumbtime parser function for TMH

whoops, sorry Brion, got mixed in with other stuff that I was abandoning.

We at WMDE have a cooperation where this topic comes up regularly.
We would really aprreciate if the thumbnail could be chosen or added by the uploader.
We have a whole series of high-quality videos donated / provided under CC BY and we want to make them shine

What is the state of the patch? It seemed ready in 2018, what is blocking it? The approach seems right to me. I agree that it is urgently needed!

I rebased it, wasn't able to test it yet.

Perhaps this should go as a new feature, but if it's not too late to get it right from the start, this thumbnail should also be used on search result pages.