ankoder
Get Version
0.0.6→ ‘ankoder’
What
ankoder is a service provided by rorcraft that allows you convert a Video of any format (YouTube's videos,etc) to MPEG4 (AVI/MOV/MP4/MP3/3GP) or FLV file online. And this gem is to provide the API for you to send request to our video encoding server.
Installing
sudo gem install ankoder
The basics
As this service is still in private beta stage, for every developer start to use this api , have to apply for the private testing account. To apply the testing account, please fill in the form in http://free.ankoder.com/ .
Demonstration of usage
After we have approved the application , we will assign the username and password to login the service, for example, api_user as username , and api_passowrd as password.
Add the following lines to ApplicationController
require "ankoder"
include Ankoder
To create a user session
user = Auth.create("api_user", "api_password")
To list out the available converting profile
profiles = user.profiles.find(:all)
To download a video from Youtube
download = user.downloads.create('url' =>"http://www.youtube.com/watch?v=Sex4w4h7Tqk")
To create a job to convert a video file
convert_job.create(:video_id =>download.id , :profile_id => profile.id )
To Get the list of the upload server
api_servers = user.upload.find(:all)
or to get the recommended upload server
api_server = user.upload.find(:first)
Direct Upload Form Example
the form action can get from user.upload.find(:all)
params that accept by ankoder upload api
access_key ( required ) : your own access key
success_redirect ( required ) : url that will redirect to if the upload is successful
failed_redirect ( required ) : url that will redirect to if the upload is failed
postback_url ( optional ) : our server will send out the direct postback to you contain the id of the upload video
You can also add some custom params that if you want us to postback to you, as this kind of message will be using your private key to hash , so that you can sure that the message is issued by ankoder.
Params that begin with custom_ will be conside as your custom param.
for the file name field , you have to use the below format
<input class="text" id="uploaded_data" name="file[uploaded_data]" size="30" type="file" />
Below is the demo of the upload form structure
<h1>Upload a file</h1>
<form action="http://ec2-api.ankoder.com/files/upload" enctype="multipart/form-data" method="post">
<input name="success_redirect" type="hidden" value="http://www.youhost.com/uplaod_success" />
<input name="failed_redirect" type="hidden" value="http://www.youhost.com/uplaod_failed" />
<input name="access_key" type="hidden" value="your_access_key" />
<input name="postback_url" type="hidden" value="http://www.youhost.com/postback/upload" />
<input name="custom_video_name" type="hidden" value="test.mp4" />
<input name="custom_video_format" type="hidden" value="mp4" />
<p><label for="file_uploaded_data">File</label>
<input name="file[uploaded_data]" size="30" type="file" />
</p>
<input name="commit" type="submit" value="Upload" />
</form>
Forum
http://groups.google.com/group/ankoder
Our development Blog
How to submit patches
Read the 8 steps for fixing other people’s code and for section 8b: Submit patch to Google Groups, use the Google Group above.
The trunk repository is svn://rubyforge.org/var/svn/ankoder/trunk for anonymous access.
License
This code is free to use under the terms of the MIT license.
Contact
Comments are welcome. Send an email to info@rorcraft.com or via the forum
Ankoder, a service by RoRCraft Limited,
Last Updated :
1st April 2008
Theme extended from Paul Battley