Cms: Expand getWidth() and and getHeight() to video files

Created on 6 Oct 2017  路  8Comments  路  Source: craftcms/cms

Sometimes we need to get video sizes in before eg. for lazy loading or stuff like packery.

enhancement

All 8 comments

They'd probably want something like:

https://github.com/JamesHeinrich/getID3

If they wanted to extract the meta information. It's non-trivial to try to do.

It's definitely not trivial and is pretty niche. I could see it happening as a plugin, though.

This plugin already does it:

https://github.com/carlcs/craft-assetmetadata

maybe exiftools is worth a try, if its installed on the host system.

This definitely feels like a job for a plugin.

@jan-thoma there鈥檚 no additional package installation required to get Asset Metadata plugin running (it uses getID3). You can store the video width, height or other metadata like framerate.

{{ metadata.video.resolution_x ?? null }}

That plugin doesn't seem to have made it to the plugin store yet. What are folks doing in Craft 3 for this?

For anyone that ends up here, @khalwat's Transcoder plugin can help with this.
https://plugins.craftcms.com/transcoder

Here's the relevant bit from the docs:
https://nystudio107.com/docs/transcoder/Using.html#generating-a-transcoded-video

Was this page helpful?
0 / 5 - 0 ratings

Related issues

angrybrad picture angrybrad  路  3Comments

angrybrad picture angrybrad  路  3Comments

brandonkelly picture brandonkelly  路  3Comments

bitboxfw picture bitboxfw  路  3Comments

darylknight picture darylknight  路  3Comments