Khalid
Khalid

Reputation: 895

How to get Properties of Video

Does anyone know how to get properties of video on Ruby on rails (methods or gem) ?

eg : just like image properties (width, height, dimension.. etc).

Thanks

Upvotes: 2

Views: 1297

Answers (3)

amn
amn

Reputation: 180

you can use

Paperclip::Geometry.for_file(source)

you will get Height, Widht, Orientation

Upvotes: 0

anka
anka

Reputation: 3857

For video analysis I prefer FFMPEG at most. Actually I did not use it in any rails projects but you can find the gem streamio-ffmpeg gem, which looks promising.

Upvotes: 2

Neil Slater
Neil Slater

Reputation: 27207

Be warned, videos have a lot of properties and sub-formats.

You can get an XML video description using mediainfo binary, and use e.g. nokogiri to parse it.

Upvotes: 0

Related Questions