Last modified: 2014-09-18 18:25:31 UTC
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.
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