Page MenuHomePhabricator

Expose media metadata consistently to API through query=imageinfo and/or query=videoinfo
Closed, ResolvedPublic

Description

Currently there doesn't seem to be any consistent way to get the duration of a timed media file (such as video or audio), either through core query=imageinfo or TimedMediaHandler's modified query=videoinfo.

It looks like I can get the duration out of the metadata fields, but these are different for each format...

WebM has metadata entry 'playtime_seconds':
https://commons.wikimedia.org/w/api.php?action=query&titles=File:Fjordsteam.webm&prop=imageinfo&iiprop=url|size|mediatype|metadata&format=json

But Ogg has metadata entry 'length':
https://commons.wikimedia.org/w/api.php?action=query&titles=File:Folgers.ogv&prop=imageinfo&iiprop=url|size|mediatype|metadata&format=json

For now I can hardcode these two checks, but I'd much prefer a standard property on imageinfo.


Version: unspecified
Severity: enhancement
URL: https://commons.wikimedia.org/w/api.php?action=query&titles=File:Folgers.ogv&prop=imageinfo&iiprop=url|size|mediatype|metadata&format=json

Details

Reference
bz55941

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:19 AM
bzimport added a project: TimedMediaHandler.
bzimport set Reference to bz55941.
brion created this task.Oct 20 2013, 4:04 PM

Change 157586 had a related patch set uploaded by Brian Wolff:
Add duration field in query=imageinfo&iiprop=dimensions

https://gerrit.wikimedia.org/r/157586

Change 157586 merged by jenkins-bot:
Add duration field in query=imageinfo&iiprop=dimensions

https://gerrit.wikimedia.org/r/157586

Gilles raised the priority of this task from Low to Unbreak Now!.Dec 4 2014, 10:12 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Low.Dec 4 2014, 11:22 AM