root/indytube/tags/plumi-0.1-3/README

Revision 177, 4.9 kB (checked in by andy, 20 months ago)

slight update to the docs, removing cron reference, and explaining
about the new twisted system

Line 
1What is IndyTube?
2-----------------
3
4This is a very basic script for reencoding arbitrary video files to
5flash video (flv), and then including this video in the browser with a
6flash video player.  The exact same approach can be used to embed a
7cortado java player that can play ogg theora files, but the files here
8don't do that yet.  The overriding design goal is to make it
9absolutely trivial for the largest number of users to view video
10content, while still making the original files available for download,
11and not compromising privacy and anonymity of uploaders and viewers by
12relying on a commercial service like YouTube or Google Video.
13
14Design: Why not build this into the cms?
15--------------------------------
16
17Video transcoding, even on good hardware, is a time-intensive task.
18So any CMS that wanted to support embedded video would probably need
19to run the encoding job in an asynchronous process anyway.  On systems
20that do support asynchronous production processes, like Mir, you
21probably wouldn't want to put big encoding jobs into the queue anyway,
22because no one wants to wait 20 minutes for a video to finish encoding
23when they need to update the startpage.  Running the video encoding in
24a separate process also allows the encoding process to get "nice'd"
25to an appropriate priority so it doesn't bring down your server. 
26It also means that it is very easy to graft support for embedded
27video onto any existing cms that stores video in the file system.
28
29This script uses Twisted networking framework, to run every 60 seconds
30or whatever you like, and scan a directory files for new videos to
31encode.
32
33What do I need to run this?
34---------------------------
35
36* Python 2.4 or higher
37
38* Flowplayer, available from http://flowplayer.sourceforge.net
39
40        This provides a nice embedded flash video player, you should
41        download a copy and put a copy on your web site.
42
43* Mencoder, the Mplayer video encoder/decoder swiss army knife. 
44
45        This is better than ffmpeg because it is designed to handle
46        any proprietary cruft that your users throw at it.
47        Get it from www.mplayerhq.hu, or, for debian packages, from
48        www.debian-multimedia.org
49
50* FLVTool2, http://inlet-media.de/flvtool2
51       
52        You need to be able to write some metadata to the file so
53        users can seek during playback.  This ruby program does the
54        trick (make sure you've got ruby installed!)
55
56* Cheetah template library for Python.
57       
58        You can get this from http://www.cheetahtemplate.org/, or just
59        'apt-get install python-cheetah'
60
61* Twisted networking -
62        You can get this from http://www.twistedmatrix.com
63        or 'apt-get install python-twisted'
64
65* For OggTheora support, you need ffmpeg2theora and Cortado applet
66
67How do I set it up?
68-------------------
69
70First, you need to open up indytube.py and change the config variables
71to something sensible(TODO SOON: pull out to command line args).  Here
72you need to set the paths for your orginal and encoded files, plus
73urls for the resources like the flowplayer files and your splash
74screen image(an Indymedia one is included here if you need one).  You
75can also tweak the encoder options(sensible defaults are included for
76small video files and quick encoding with decent quality) and turn off
77encoding altogether.  There's logging settings for debugging, and a
78way to specify the maximum number of encoders you'd like to run in
79parallel, and at what priority.
80
81You also might want to customize the include.template, which is used
82to generate a fragment to be included in any page with video.  The
83basic idea is that the cms template is tweaked to pull in this
84template, which does nothing if it isn't there, and also to include a
85"waiting for encoder" message, which a bit of javascript in the
86generated include fragment "turns off".
87
88An example, for mir, might make this more clear.  What you need to do
89is go into the place in the article template where the link to the
90video file attached to an article happens, and add something like:
91
92  <div id="waiting4encoder${media.id}">
93        <i>Waiting for encoder...check back in 10 minutes for flash version.</i>
94  </div>
95  <!--#include virtual="/media/${media.creationdate.formatted["yyyy/MM"]}/${media.id}.flv.inc" -->
96
97Make sure that the "waiting4encoder" div preceds the include file!
98Notice you can also put something like:
99
100        <!--#config errmsg=" " -->
101
102if you want to suppress the [an error occurred while processing this
103directive] stuff that will happen while you're waiting for an encoder.
104
105Then, just set up indytube.py to run every minute or so out of cron.
106If the maximum numbers of encoders are already running, it just
107stops. Otherwise, it will check for video files in the directory
108you've specified, see if they've already been encoded, or if another
109encoder is already handling them, and if not, generate the flv file
110and the include file.  And then you've got streaming embedded video.
111 
112
113Still Todo:
114-----------
115
116* Configuration via command-line options
117* Video thumbnail generation (how do you find a non-blank frame automatically?)
Note: See TracBrowser for help on using the browser.