Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Ruby Prototype for a Handbrake Network queue with server client relation

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 java
Octocat-spinner-32 ruby
Octocat-spinner-32 README
README
This is a proof of concept to make a job queue available on the network
for the Handbrake transcoding front end (http://handbrake.fr/).

The Goal
* A Server is start with file.queue generated by Handbrake.

* A Client with HandbrakeCLI installed connects to the server

* The Server Transfers the unencoded files to the Client 
  ( Only practical over gigabit )

* The Server marks the job as checked out

* The client runs the job it checked out at described in the 
  queuefile on the server

* When the client completes it connects to the server and transfers 
  the encoded output of HandbrakeCLI

* The server marks the job completed

* The client cleans up the raw files transfered for the job

* The client checks the server for another job

* The server delegates unchecked out jobs as long as possible

* The server will then delegate the "checked out" but not "completed" jobs
  as the server sees fit until all jobs are marked "completed" 


The Reality

* The queue files generated by each Handbrake GUI are completely different
  and typically unrelated. I started based of the current queue file format
  found on the Windows version.

* Transfering files in Ruby is subject to many performance bugs in the Socket
  libraries.

* Locating HandBrakeCLI can be difficult on Windows and MacOsX. A config file
  with their location may be the best option here

* When all the jobs are checked out its difficult to know what to delgate next.
  This is because if you resend the job thats been checked out the longest it
  may be soon finished. Or on the other hand, the client may have stopped work
  and not told the server.

== Usage ==

= Serveri =
To start a server that manages queue transcoding jobs the below will work
when in server is in the current directory and lib/* are still relatively the
same. Port is optional

$ ./server path/to/queue_file (port)

The queue_file format is the same as the Windows version as of this writing.
You can generate a queue file with the Windows HandBrake GUI then use the
export functionality.

= Client =
The client works much the same as the server. Tell it who ( or where) the
server is and the port the server is listening on.

NOTE: Files will be copied into the current directory from the server.
These files are not deleted by the application in hopes of caching files
between jobs.
./client server_name_or_ip (port)
Something went wrong with that request. Please try again.