Forum: Ruby on Rails How to call FFMPEG using Rails?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Andrew M (Guest)
on 2006-04-21 18:19
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.
Alan F. (Guest)
on 2006-04-21 18:47
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.
Alan F. (Guest)
on 2006-04-21 18:50
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

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

Alan
This topic is locked and can not be replied to.