[IMC-Video] flash player recipe
Mick Fuzz
mickfuzz at rocketmail.com
Tue Sep 12 05:20:49 PDT 2006
I totally agree on using our networks of contacts and
technical expertise to put together a project like
this for video.indymedia.org - i guess let's get there
step by step is a good way to go forward.
We are going to have a meeting in London to follow up
from the transmission.cc event in Rome. In rome we
were talking about all the kind of stuff mentioned
below. the dates are 13, 14, 15 of October
It would be great to see people in IRC for that
meeting that can't come in person. I'll keep people
informed and send out the invitation in a few hours.
cya
mick
--- lotu5 <lotu5 at resist.ca> wrote:
> yeah, fuck amazon and their software patents, i was
> just talking about
> the flash player stuff...
>
> On Tue, 2006-09-12 at 02:49 -0700, mark burdett
> wrote:
> > and, boot up an amazon ec2 to handle the video
> conversion... ;)
> >
> > flash is apparently user-friendly for a lot of
> folks, i'd be happy as
> > long as there was a "download the original" link.
> >
> > i wouldn't put indymedia stuff online @ s3, given
> the potential for
> > copyright/other legal issues. maybe it could work
> with a local backup.
> >
> > --mark
> >
> > On Tue, 12 Sep 2006 00:59:25 -0700,
> lotu5 at resist.ca wrote:
> > > 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 amazon?s 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 isn?t 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
> doesn?t hit the server that
> > > hard, it?s isn?t 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.
> > >
> > > Let?s get started
> > > Let?s assume you?ve got Drupal all setup and a
> CCK content type created
> > > for your videos. There are two things you?re
> 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 don?t
> need to do this.
> > >
> > > So now we?ve 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 you?re 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
> > > ." = ''";
> > >
> > > >From here, I?ve got files and nids that I can
> use to my heart?s content.
> > > My next step is to process these files. We can
> do this fairly simply:
> > >
> > > $command = "$path_to_ffmpeg -i $file_path
> -acodec mp3 -ar 22050 -ab 32
> > > -vcodec flv -s " . $output_width . "X" .
> $output_height ." $flv_output";
> > > exec($command, $data );
> > >
> > > Note that you should have the ?enable-mp3lame
> and ?enable-faad support
> > > compiled into ffmpeg to be able to convert avi
> and mov files into flash.
> > >
> > > We should also create a thumbnail for this
> video:
> > > $command = "$path_to_ffmpeg -y -i $file_path
> -vframes 1 -ss $thumb_time
> > > -an -vcodec mjpeg -f rawvideo -s " .
> $thumb_width . "X" . $thumb_height ."
> > > $thumb_path";
> > > exec($command, $data);
> > >
> > > You may want to move the file to a different
> location at this point- I
> > > move my source files to an archive so that if
> media needs to be
> > > reconverted, that can happen.
> > >
> > > Now we need to move the flv file to amazon?s s3.
> I used the storage3
> > > library which made this straight forward:
> > >
> > > $s3=new storage3($myAccessKeyId,
> $mySecretAccessKey, $url);
> > > // put file on amazon
> > > $s3->putFile($file_path, $bucket, $file_name);
> > > // set the ACL
> > > $s3->setACL($bucket, $file_name);
> > > return "http://s3.amazonaws.com/" . $bucket .
> "/" . $file_name;
> > >
> > > At this point, we need to update Drupal?s
> database so that it knows about
> > > all these good things that we?ve done. I?ve
> stored output from the various
> > > functions so far in $files.
> > >
> > > // update files directory with the new path
> > > $query = "UPDATE files SET filepath = '".
> $file['archived_file'] . "'
> > > WHERE nid = '". $file['nid'] . "'";
>
=== message truncated ===
------------------o)------------------
http://www.ourvideo.org >> community video toolkit
http://www.clearerchannel.org << video show case for screening
Clearer channel is ready to link to now - Could you help us promote it by including this in your email signature or website somewhere?
"Clearer Channel is a place to download video for public screenings. The focus is on social change videos to wake us up, shake us up and inspire action. http://www.clearerchannel.org"
phone: 07913882193 0161 237 1832
email :mick at undercurrents.org
post: box29, Merci, Bridge 5 Mill, 22a Beswick St, Manchester, M4 7HR
id number: pending
More information about the imc-video
mailing list