markevans / dragonfly

A Ruby gem for on-the-fly processing - suitable for image uploading in Rails, Sinatra and much more!
http://markevans.github.io/dragonfly
MIT License
2.12k stars 244 forks source link

speed up video analyzer #409

Open khoan opened 9 years ago

khoan commented 9 years ago
# currently takes a long time
identify -ping -format '%m %w %h' /path/to/video.mp4

can we somehow extract first frame and use it to return format, width and height?

khoan commented 9 years ago
# this runs in seconds
identify -ping -format "%m %w %h" /path/to/video.mp4[0]
markevans commented 9 years ago

it probably wouldn't hurt always analysing the first frame - feel free to send a pull request