# Getting Quicktime movie size with Ruby

**URL:** <https://www.ruby-forum.com/t/getting-quicktime-movie-size-with-ruby/136158>\
**Category:** Rails\
**Created:** [April 29, 2008, 2:18pm UTC](https://www.ruby-forum.com/t/getting-quicktime-movie-size-with-ruby/136158 "2008-04-29T14:18:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [April 29, 2008, 2:18pm UTC](https://www.ruby-forum.com/t/getting-quicktime-movie-size-with-ruby/136158/1 "2008-04-29T14:18:15Z")

</div>

I am trying to automatically insert the object properties in order to  
play some embedded videos in my webpage. The problem is that I need to  
specify the height and width of the video. I can do it by hand but it is  
a bit of pain.

Is it possible to get the video attributes using Ruby?

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [April 29, 2008, 3:52pm UTC](https://www.ruby-forum.com/t/getting-quicktime-movie-size-with-ruby/136158/2 "2008-04-29T15:52:55Z")

</div>

> I am trying to automatically insert the object properties in order to  
> play some embedded videos in my webpage. The problem is that I need to  
> specify the height and width of the video. I can do it by hand but it is  
> a bit of pain.
> 
> Is it possible to get the video attributes using Ruby?

RVideo might do the trick…

[http://code.google.com/p/rvideo/](http://code.google.com/p/rvideo/)  
[http://rvideo.rubyforge.org/](http://rvideo.rubyforge.org/)

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [April 29, 2008, 6:47pm UTC](https://www.ruby-forum.com/t/getting-quicktime-movie-size-with-ruby/136158/3 "2008-04-29T18:47:05Z")

</div>

On Apr 29, 8:18 am, Fernando P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I am trying to automatically insert the object properties in order to  
> play some embedded videos in my webpage. The problem is that I need to  
> specify the height and width of the video. I can do it by hand but it is  
> a bit of pain.
> 
> Is it possible to get the video attributes using Ruby?

If you don’t want to muck with a ruby wrapper, and aren’t afraid to  
simply run console command, simply running mencoder or some such tool  
on it then parsing the text output can get you the information you  
need.

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [April 30, 2008, 1:10pm UTC](https://www.ruby-forum.com/t/getting-quicktime-movie-size-with-ruby/136158/4 "2008-04-30T13:10:35Z")

</div>

Thanks for your advice. Finally I think it will be easier to create a  
Video model, and have a field where I can type in the video resolution,  
I wont’ be having millions of videos anyway.
