Reputation: 895
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
Reputation: 180
you can use
Paperclip::Geometry.for_file(source)
you will get Height, Widht, Orientation
Upvotes: 0
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
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