[IMC-Video] flash player recipe
lotu5 at resist.ca
lotu5 at resist.ca
Tue Sep 12 00:59:25 PDT 2006
We reall, really need to do something like this for video.indymedia.org
using nimiq or whatever its next incarnation is:
http://www.tunaspecial.com/?p=162
also, some other great featuers of youtube that make people use it a lot are:
- user accounts
- rss feeds and subscriptions
- comments
- messaging
- tags, allowing "related videos"
here's the full posting from arthur's blog post, found on
indyblogs.protest.net:
A Drupal youtube Site Recipe
Overview
This describes a Drupal project to create a youtube style video sharing
site. There are two major pieces that this project dealt with that stretch
the project:
# converting users uploaded files into a multi-platform format (flv flash
videos)
# hosting the uploaded content with amazons s3 services
The project ended up breaking the upload process apart from the conversion
and media hosting processes. Since Drupal already does a good job of
getting media on to a machine, what seemed an appropriate way to conserve
hardware cycles was to break the conversion process out in a separate
script. This script uses the Drupal database to find out what files it
needs to process, processes them, then moves them, pushes them over to the
s3 servers, and then updates the Drupal database with urls to the media.
Why not the Drupal video module?
Given that there is a preexisting Drupal video module which does a nice
job of embedding media in the page, why go the route of writing custom
script?
Well there are several reasons for this, one of the primary reasons is
that the Drupal file system management isnt yet up to the task of
integrating to an off site server easily.
Secondly, I wanted to break the processing side out from the uploading, so
that in the event of large numbers of simultaneous uploads, the strain on
the server could be moderated. While ffmpeg doesnt hit the server that
hard, its isnt hard to imagine that a few uploads and a few conversions
happening concurrently could really load up a machine.
Why use CCK?
Part of the thinking behind this project is an attempt to stay as in the
box as possible- instead of writing large numbers of custom modules to
handle the specifics of things, I figured we could use CCK, use a few
tricks (like the form_alter and nodeapi hooks) to make the upload process
function more elegantly.
Secondly, CCK offers greater flexibility for integration with views,
increasing the amount of data collected in the future, and so on.
Lets get started
Lets assume youve got Drupal all setup and a CCK content type created
for your videos. There are two things youre going to need to add to that
content type:
# a amazon url
# a thumbnail path
I created a custom module which uses the form alter hook to hide these
when the user creates their video, but you dont need to do this.
So now weve got some information about how to start finding out files we
need to process- because no newly uploaded file will have an amazon url,
we know that we can use this as a point of reference for what needs to get
processed. Obviously, this is an assumption that holds true in my system-
you need to make sure that when youre getting your list of files that you
choose an appropriate way to select them.
$query = "SELECT files.filepath, files.nid FROM files " .
"LEFT JOIN ". $drupal_cck_content_table . " ON files.nid = ".
$drupal_cck_content_table . ".nid " .
"LEFT JOIN node ON node.vid = ". $drupal_cck_content_table . ".vid " .
"WHERE ". $drupal_cck_content_table . "." . $drupal_cck_amazon_url_field
." = ''";
More information about the imc-video
mailing list