Playing Flv Files in Ruby On Rails (Part 1)
Ruby On Rails November 20th, 2007Playing Flv Files in Ruby On Rails (Part 1)
Rails has been a great and powerful framework for me since I have got in touch with. This time in order to test the power of Rails framework, I choose to play with the flash based video playback for web apps using the rails framework.
Before we actually get our hands dirty in writing the core programs of video playback, we first need to check out the requirement and the basic knowledge of the requirements that are actually required as a part of the development process.
The following listing provides the basic tools and equipments that should be in our hand before we start off with the development
1.Flash Player Helper Plugin:
This is the first most important tool which we require for playing the video file.
You can Install the plugin into your Rails App from the following site:
ruby script/plugin install svn://rubyforge.org/var/svn/flashplayrhelpr
For actually integrating the plugin into your application use the rake:
rake flash_player:install
That’s gonna install the falsh player into your application.
For more information regarding the plugin please visit :
http://www.jroller.com/abstractScope/entry/flash_mp3_imageslideshow_media_player
And not forgetting a thanks to farooq ali for a great tutorial regarding the integration of the plugin into the rails app.
2 .File Column Plugin for File Upload:
You can download and install the file column plugin from the following location:
ruby script/plugin install http://opensvn.csie.org/rails_file_column/
plugins/file_column/trunk
For more information of the plugin and its usage please visit:
http://www.kanthak.net/opensource/file_column/
3.Mplayer/Mencoder:
The basic task of a mencoder which comes bundled with the mplayer, is mainly used for the conversion of the a movie file(basics format .WMV,.AVI …etc). into .FLV(Flash Video) format .
In order to download the mencoder(MPlayer 1.0rc1 Windows), please refer to the instruction on the following site
http://www.cscs.ch/~mvalle/mencoder/mencoder.html
We will discuss the integration of mencoder into our Rails app in the second part of this tutorial
4.Video Codecs:
These are the most important role playing stuff when it comes to video conversion from one format to the other.
You can download the latest version of the codecs(Windows x86 20071007) from the following location:
http://www4.mplayerhq.hu/homepage/design6/dload.html#binary_codecs
Configuration of codecs in Mplayer/Mencoder
When you download the codec pack from the mplayer site .You will find that the codecs are mere dll files. So in order to use these codecs ,what we have to do is copy the all the dll files into the codecs folder in the mplayer directory
NOTE: Please create a codecs folder if not present and do not forget to read the readme in the mplayer source directory for more information
With these basic configuration in hand we can now move to develop a Rails app for flash Video playback in the upcoming part








