# How to call FFMPEG using Rails?

**URL:** <https://www.ruby-forum.com/t/how-to-call-ffmpeg-using-rails/58426>\
**Category:** Rails\
**Created:** [April 21, 2006, 4:19pm UTC](https://www.ruby-forum.com/t/how-to-call-ffmpeg-using-rails/58426 "2006-04-21T16:19:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e47c2d/32.png) [@Andrew\_M](https://www.ruby-forum.com/u/Andrew_M)\
**Post date:** [April 21, 2006, 4:19pm UTC](https://www.ruby-forum.com/t/how-to-call-ffmpeg-using-rails/58426/1 "2006-04-21T16:19:35Z")

</div>

Basically i am wondering how to call ffmpeg in rails so i can read video  
files in order to get their properties? My goal is to have ffmpeg read  
thru a list of video files and then take their properties and place  
these properties along with the name in a sql table.

---

<div class="post-metadata">

**Author:** ![Andrew\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e47c2d/32.png) [@Andrew\_M](https://www.ruby-forum.com/u/Andrew_M)\
**Post date:** [April 21, 2006, 4:47pm UTC](https://www.ruby-forum.com/t/how-to-call-ffmpeg-using-rails/58426/2 "2006-04-21T16:47:00Z")

</div>

Andrew M wrote:

> Basically i am wondering how to call ffmpeg in rails so i can read video  
> files in order to get their properties? My goal is to have ffmpeg read  
> thru a list of video files and then take their properties and place  
> these properties along with the name in a sql table.

You can call a shell program using backticks `ffmpeg ...options...` If  
there’s a way to get the program to output the infirmation you require  
to stdout, you can capture it and store it.

This is more a Ruby question, than a Rails one, I think. Sorry I can’t  
be more help.

A.

---

<div class="post-metadata">

**Author:** ![Andrew\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e47c2d/32.png) [@Andrew\_M](https://www.ruby-forum.com/u/Andrew_M)\
**Post date:** [April 21, 2006, 4:50pm UTC](https://www.ruby-forum.com/t/how-to-call-ffmpeg-using-rails/58426/3 "2006-04-21T16:50:55Z")

</div>

Alan F. wrote:

> This is more a Ruby question, than a Rails one, I think. Sorry I can’t  
> be more help.

Here, for example, is some ruby code that captures `ssh-agent` output  
and uses it.

The %x{…} is the same as the backticks I think.

[http://www.joeygibson.com/blog/2004/01/07](http://www.joeygibson.com/blog/2004/01/07)

Shouldn’t be a strech to run ffmpeg instead and take the parsed output  
and put it in a model.

Alan
