# How to obtain the dimensions of a video file?

**URL:** <https://www.ruby-forum.com/t/how-to-obtain-the-dimensions-of-a-video-file/71827>\
**Category:** Ruby\
**Created:** [October 11, 2006, 7:21pm UTC](https://www.ruby-forum.com/t/how-to-obtain-the-dimensions-of-a-video-file/71827 "2006-10-11T19:21:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bira](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c89c15/32.png) [@Bira](https://www.ruby-forum.com/u/Bira)\
**Post date:** [October 11, 2006, 7:21pm UTC](https://www.ruby-forum.com/t/how-to-obtain-the-dimensions-of-a-video-file/71827/1 "2006-10-11T19:21:45Z")

</div>

Hello,

I’ve posted a few messages on this list before, but this is my first  
real question :).

I’ve written a script, using Rake, to automate the conversion of a  
bunch of AVI video files to a DVD image I can burn and watch on my TV.  
It’s working OK so far, and I promise I’ll post the code as soon as I  
get home from work :).

The problem I have is that this rakefile still requires some manual  
tweaking before every execution, because it makes some calculations  
based on the original video’s resolution (i.e., 640x480, 704x396,  
etc.), and must also use slightly different parameters if the original  
video is widescreen.

So, is there a Ruby library or some Linux utility I can use from Ruby  
that can find out the domensions of a video file? That would allow me  
to make the process completely automated.

---

<div class="post-metadata">

**Author:** ![Bira](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c89c15/32.png) [@Bira](https://www.ruby-forum.com/u/Bira)\
**Post date:** [October 11, 2006, 10:23pm UTC](https://www.ruby-forum.com/t/how-to-obtain-the-dimensions-of-a-video-file/71827/2 "2006-10-11T22:23:01Z")

</div>

Hi Bira,

Look at rmovie. It uses ffmpeg and can do that for you.

Cheers,  
Carl.

---

<div class="post-metadata">

**Author:** ![Bira](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c89c15/32.png) [@Bira](https://www.ruby-forum.com/u/Bira)\
**Post date:** [October 12, 2006, 4:40pm UTC](https://www.ruby-forum.com/t/how-to-obtain-the-dimensions-of-a-video-file/71827/3 "2006-10-12T16:40:52Z")

</div>

On 10/11/06, Carl W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi Bira,
> 
> Look at rmovie. It uses ffmpeg and can do that for you.
> 
> Cheers,  
> Carl.

Thanks, I’ll take a look at it.
