cancel
Showing results for 
Search instead for 
Did you mean: 

Integration with Media Servers?

risenhoover
Champ in-the-making
Champ in-the-making
I'm planning on using Alfresco to store a lot of video, and I'd like to gather some opinions on the best mechanism for integrating external media servers with Alfresco.  Specifically, I'd like to be able to upload the video assets into Alfresco and then be able to stream them from an external media server, such as, say the Flash media player.

One of my basic questions is: "How do I get the location of the actual file from alfresco so that I can pass that to the media server?"

Any thoughts would be appreciated.
Thanks,
wpr
7 REPLIES 7

pmonks
Star Contributor
Star Contributor
Generally speaking you can't get the location of the physical files stored by Alfresco, since there's no guarantee that Alfresco is actually storing them in the filesystem.  Alfresco happens to use the filesystem to store files by default, but that's by no means the only place that Alfresco can store files (for example there's been at least one community developed extension that modifies Alfresco to store the files in the database in BLOB columns, and I know of another prototype that stores the files on Amazon S3).

The upshot is that the only guaranteed way to access content in an Alfresco repository is via one of the public access mechanisms:
  • Web Client UI

  • APIs (including the remotely invokable APIs such as Web Scripts, Web Services, JCR-RMI, etc.)

  • Virtual File Servers (WebDAV, CIFS, FTP and NFS)
For the scenario you describe, it sounds like using one of the virtual file servers would probably be the best way to allow the media servers to access and stream the content.  For example, you might mount the repository via CIFS or NFS and configure the media servers to stream content from the mount point (which will look, taste and smell like a CIFS or NFS mounted filesystem, but is an actual fact the Alfresco repository).

Cheers,
Peter

dinger
Champ in-the-making
Champ in-the-making
Why don't you just access the file in Alfresco via HTTP? This will probably quicker than CIFS/NFS?

What media server are you using? If you're using VLC I know you can give it a HTTP URL and it will stream that out again (doing transcoding on the fly if you want).

Are you planning to do any transcoding in Alfresco itself? This is something I'd be interested in.

Rob

risenhoover
Champ in-the-making
Champ in-the-making
Hi Guys,

Sorry for not responding sooner – I was away for a while – actually I was in Alfresco training (!).  I kinda figured that I was going to have to use CIFS/NFS for my mount point.  My problem is that I'll need to set up an active/passive cluster in order to maintain my uptime goals.  If I mount my media server at the primary server, and then bring that Alfresco instance down, my load balancer will correctly move everybody to the passive Alfresco instance, but the media server will remain mounted at the primary instance.

The only way around this is if the Alfresco system is smart enough to recognize other members of it's cluster and then pass the CIFS netbios name around based on a heartbeat.  Considering the SAMBA team has only just recently implemented active/passive clustering, I'm pretty sure Alfresco doesn't do this [yet].  It is of course possible to set up a Linux cluster that moves IP addresses back and forth based on a heartbeat, but that only comes into play if the entire server goes down.  If I want to bring just Tomcat down – say, to perform an upgrade, this mechanism wouldn't work.

In regards to database storage of files – I won't be using that mechanism.

For the record, I'm using Windows Media Services, Darwin, and soon, Adobe's Media Server.

In regards to HTTP streaming – yes it's possible to do this, but the performance degrades substantially when you start streaming 1.5Mb files.  It's important to us to have small latency on the trick controls, and for that we really need RTSP.

Another option that I've thought about is to create symlinks to the actual files and export those to the media servers.  Very ugly, but it's all I can think of for now.

Any other thoughts?

pmonks
Star Contributor
Star Contributor
Symlinks won't work since there's not a 1-to-1 correspondence between assets ("files") in the repo and files in the contentstore (for example every time a file is edited in the repo a new file is created in the contentstore). Even were this not the case, accessing the contentstore directly is strongly discouraged because Alfresco reserves the right to change the way the repository is persisted at any time.

It sounds to me like deploying the files out of Alfresco to a vanilla filesystem (from which the media servers read the files) might be a better option - have you considered using the WCM functionality for managing these assets?

Cheers,
Peter

dinger
Champ in-the-making
Champ in-the-making
Still not sure I totally understand your use case.

Can't Darwin accept HTTP streams and then re-stream it? That way you wouldn't have to mess around with CIFS and it would be quite easy to to the load balancing you're talking about.

Rob

moschops
Champ in-the-making
Champ in-the-making
Came across this thread while researching a similar requirement - I need to have image and other "static" resources uploaded and managed by Alfresco, but then in production be served from Amazon S3 so I can utilize their CloudFront content distribution network.  When you have a site that is accessed globally with large amounts of traffic serving images directly from Alfresco just isn't an option.

My best solution so far would be to have a script that copies all content with an "S3-able" aspect to S3.  The aspect would include an S3 relative URL that would normally be derived from the the Alfresco location of the content, that would determine where on S3 it was copied to, and at runtime on production could be used to generate an appropriate S3 relative URL. 

However I have no idea how to do the copy to S3 part.  It seems like I'd have to write some Java code to do it since clearly it can't be done from Javascript right? 

An alternative would be to use Alfresco's web-dav or CIFS access to expose Alfresco content to standard Unix scripts and have a cron job that periodically mirrors the content to an S3 store.

pmonks
Star Contributor
Star Contributor
This is exactly the kind of use case the WCM deployment functionality (http://wiki.alfresco.com/wiki/WCM_Deployment_Features) is intended to support.  Although Alfresco doesn't directly provide a feature for deployment to S3, the FSR (http://wiki.alfresco.com/wiki/FSR) has a number of callbacks (http://wiki.alfresco.com/wiki/FSR#Extending_the_FSR) that can be used to forward deployed content to other types of repository (which can be just about anything).

Cheers,
Peter