Page MenuHomePhabricator

Expose file sizes of transcoded assets in API
Open, LowPublicFeature

Description

API results for transcodestatus and videoinfo don't include the file size of the transcoded assets -- though this can be estimated from the content duration (see bug 55941 for difficulties getting this) combined with the per-transcode bandwidth:

https://commons.wikimedia.org/w/api.php?action=query&titles=File:Folgers.ogv&prop=transcodestatus&format=json

https://commons.wikimedia.org/w/api.php?action=query&titles=File:Folgers.ogv&prop=videoinfo&viprop=derivatives&format=json

For managing downloads or progress bars, it would be nice to have the byte count.


Version: unspecified
Severity: enhancement
URL: https://commons.wikimedia.org/w/api.php?action=query&titles=File:Folgers.ogv&prop=transcodestatus&format=json

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:19 AM
bzimport set Reference to bz55942.

Hmm, final file size is not stored in db where all the other transcode info is pulled out of.

bitrate is calculated exactly from file size though:

$bitrate = round( intval( filesize( $this->getTargetEncodePath() ) / $file->getLength() ) * 8 );

Change 286760 had a related patch set uploaded (by TheDJ):
[WIP] Log and report the file size of derivatives

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

Requires applying schema change to transcode table. Not an expensive one, but will still probably block deployment on manual work.

Change 286760 abandoned by TheDJ:
[WIP] Log and report the file size of derivatives

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

We have another table update ticket now in T185997: Transcode logging should also log the server on which the transcode process ran. Might be smart to combine both. Both should be possible to roll out as optional fields, so the db change can be done whenever we want (which i think is a requirement these days anyways).

Change 286760 restored by TheDJ:
[WIP] Log and report the file size of derivatives

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

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:13 AM