FQA - embed Internal Streaming Videos in Your Organization with Confluence
Tuesday, 24 August 2010 02:40
This sort of thing isn't new, pretty much all organizations do it. Google posts their technical talks[2] online and shares it with the rest of the world.
The trouble is, within our company, if you're not available to be present for the talk, you've lost out. Well, that's not cool. What if it was really critical to what you're working on? Or, what if you attended, but can't remember that one brilliant point the speaker made? What about new hires who weren't around at the time of the talk? Why does that knowledge have to be lost?
Quite simply, it doesn't. We recently started recording our seminars, purchasing a Flip Mino HD[3] for the task. Simple to use, it produces wonderful videos in clear h.264 encoded MP4 files.
But here comes the problem, where to put these videos for everyone to find?
Well, we could just put them on the file system, organize them in subdirectories and try to give them easy to remember names. But who's going to go navigate through a maze of a file system directory hierarchy? There's gotta be a better way. Oh wait, there is... the wiki!
Attaching Videos to the Wiki
How about we just attach these video files to a wiki page and just embed the video as easy as an image? Well, a few problems. First, while Confluence supports embedding a number of multimedia formats[4] (e.g., Flash, Windows Media, AVI files), MP4 with h.264 encoding is not one of them. We could post-process our media files and covert them to a format that Confluence supports, but we run into another problem, large file sizes. Our seminars run 45-60 minutes in length, generating a video file in the 1-2 gigabyte range. If we kept uploading them and attaching them to pages, we'd quickly run out of space. Furthermore, every time someone hit that page, they'd be downloading 1-2 gigs of data, which could be a nasty hit to our network.
Linking to Videos on the File System from the Wiki
Instead, we could simply link to the video file on the file system from the wiki. But, that doesn't feel too satisfying. Furthermore, while it might work for some users who are using Internet Explorer, Mozilla Firefox users would have to take extra steps because Firefox forbids linking to your local file system as a security precaution[5].
Using Video Hosting Services and the Widget Macro
So what other solutions exist out there? What we want is our own YouTube. Wait, why not just use YouTube[6]? And there are a whole bunch of other services out there like Vimeo[7] and Episodic[8] if YouTube isn't to our liking. Furthermore, we can embed them directly using the Widget Macro[9]. Sounds like a great solution. Unfortunately, most organizations (including my own) don't feel comfortable putting internal content out on the web, either for all to see or even if it's private.
Using a Hosted Media Server and a Custom Macro
So we're back to wanting our own YouTube. Well, what options exist out there? There's a few, but most of them cost money. For example, the Adobe Flash Media Server[10] suite of products is pretty popular, but we were looking for a lost-cost alternative, free being even better. Red5[11] is an Open Source Flash Server that handles streaming media. But, is there something even easier for us to use? After some searching, we found that we could simply run our own Apache[12] web server with the h.264 streaming module[13] and JW Player[14]. Then all we had to do was implement a custom macro to serve it up.
Implementing a Solution
So we decided to run an Apache[15] web server with the h.264 streaming module[16] and using JW Player[17] with a custom user macro. It was actually pretty simple to do. Let me show you how.
Installing Apache and h.264 Streaming Module
First up, go ahead and download and install Apache HTTP Server[18] and the h.264 streaming module[19] for Apache. You could also run a different web server, but we went with Apache. Also, note that the h.264 module is free to use for non-commercial usage. So, if you're planning on using this for commercial purposes, then you'll have to purchasing their commercial license (which is pretty inexpensive).
You might want to name your HTTP server something like http://video.mycompany.com/ or http://media.mycompany.com/.
Next, download the JW Player[20] by Longtail Video. You'll need to drop the player.swf and swfobject.js into a specific web accessible directory in your Apache installation. Similar to the h.264 streaming module, JW Player is only free for non-commercial usage. So, if you're going to use it for commercial purposes, purchase a commercial license (again, really cheap).
User Macro
Finally, you'll want to create a user macro in your Confluence installation. At my company, we set this up as ???. The video macro takes a few required parameters. First, you'll need to give your video a unique name using the name parameter. This is just to give Confluence a way to reference where to put video in your page. The more important required parameter is url. You'll want to replace this with the full url of where your video file is (e.g., url=http://video.mycompany.com/path/to/videofile.mp4). In addition to the required parameters, you can also specify a custom width and height in pixels. And there you have it. You'll be able to embed h.264 files (and other files that JW Player supports) as streaming videos directly in Confluence. If you want to get fancy, there are a bunch of specialized parameters you can add to JW Player such as skinning, fullscreen, autoplay, etc.). Take a look at the JW Player documentation for the full range of options.
That's our solution to embed streaming video into a Confluence installation. Our seminars (and other videos, like software demos and walkthroughs) are now captured. That knowledge is kept safe and secure behind our own firewall where we can share those videos internally without exposing them to the external network. Users can skip to any point in the video without having to buffer the whole video first.#set($width=400)
#set($height=300)
#if($paramwidth)
#set($width=$paramwidth)
#end
#if($paramheight)
#set($height=$paramheight)
#end
???
<div id="$paramname">
The player will show in this paragraph</div>
<script src="http://video.mycompany.com/swfobject.js" type="text/javascript"></script>
<script type="text/javascript">
var s1 = new SWFObject('http://video.mycompany.com/player.swf','player','$width','$height','9.0.115');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('flashvars','file=$paramurl');
s1.write('$paramname');
</script>
???
Using Apache, the h.264 streaming module, and JW Player is just one solution. How do you share your videos at your company? Share your experiences in the comments.
References
- ^ my company (www.cra.com)
- ^ technical talks (research.google.com)
- ^ Flip Mino HD (www.theflip.com)
- ^ supports embedding a number of multimedia formats (confluence.atlassian.com)
- ^ Firefox forbids linking to your local file system as a security precaution (support.mozilla.com)
- ^ YouTube (www.youtube.com)
- ^ Vimeo (www.vimeo.com)
- ^ Episodic (www.episodic.com)
- ^ Widget Macro (confluence.atlassian.com)
- ^ Adobe Flash Media Server (www.adobe.com)
- ^ Red5 (osflash.org)
- ^ Apache (httpd.apache.org)
- ^ h.264 streaming module (h264.code-shop.com)
- ^ JW Player (www.longtailvideo.com)
- ^ Apache (httpd.apache.org)
- ^ h.264 streaming module (h264.code-shop.com)
- ^ JW Player (www.longtailvideo.com)
- ^ Apache HTTP Server (httpd.apache.org)
- ^ h.264 streaming module (h264.code-shop.com)
- ^ JW Player (www.longtailvideo.com)
...


