a media sharing platform built with open source software
DESCRIPTION
Sharing and handling media files in a professional context often requires expensive software packages. For the EBU P/SCAIE project, a platform was required that could handle an abundance of professional file formats, arbitrary large file sizes and which did not pose restrictions on the metadata format used. As there was no such software available, we decided to build a custom web-based platform, based on loosely coupled open source components. This paper explains the architecture of the resulting platform. With a minimum of custom code, we have created a powerful platform that meets our requirements. This integration, described in this paper, is of use to organizations wishing to build their own media platform using open source components.TRANSCRIPT
A Media Sharing Platform Built With Open Source Software
Karel Braeckman - [email protected]
VRT and VRT-medialab
VRT is the Flemish Public Broadcaster 3 TV-channels, 5 radio channels
VRT-medialab is the research department creation, distribution and management
of media content
A Media Sharing Platform Built With Open Source Software
VRT and VRT-medialabSome of our projects… EBU EC-M Scaie Media Exchange
platformMedia sharing platform with ground truth metadata to train and test media analysis tools
MediaLoepMedia search engine which employs subtitles and news anchor texts to enhance the search.
MediaMapUse of user-generated content in a professional context.
A Media Sharing Platform Built With Open Source Software
Need for Media Asset ManagementAll these projects required media management
functionality
Upload – Store – Download media
Transcode high-res to low-res, create thumbnails, …
Metadata / Search
A Media Sharing Platform Built With Open Source Software
Need for Media Asset ManagementWe created a back-end platform “MAMMIE” which is flexible and based on open-source tools.
MAMMIE
Project1
Project 2
Project 3
A Media Sharing Platform Built With Open Source Software
• upload – store – download • transcode• metadata
Overview: Problems to tackle
What data model should we use?
How to upload and download huge media files?
How to transcode these media files?
How to link all the tools together?
A Media Sharing Platform Built With Open Source Software
A Flexible Data modelAs every research project employs its own specific metadata, MAMMIE’s data model should be very generic.
Object 2
Original Media
H264
Flash Video
Thumb frame 200
Thumb frame 300
Dublin Core metadata
NewsML-G2 metadata
MPEG7 metadata
Object 1
Original Media
Mpeg2 video
Dublin Core metadata
A unique ID
A number of linked mediastreams
A number of linked XMLmetadatastreams
A Media Sharing Platform Built With Open Source Software
A Flexible Data modelFedora Commons implements this data model.
REST interface to create, read, delete an object or its data streams.
A data stream is a link to media or embedded XML
More advanced features available in Fedora (not used)SOAP, RDF, transformations using web-services, versioning, ...
Object 1
Original Media
Mpeg2 video
Dublin Core metadata
A Media Sharing Platform Built With Open Source Software
A Flexible Data model: SearchApache Solr is used to search the objects. The Fedora Gsearch plug-in will handle the synchronization.
<xml><datastream1> … </datastream1><datastream2> … </datastream2>…</xml>
Fedora Object
<xml><title> … </title><description> … </description><hires> … </hires>…</xml>
Solr Document
XSLT
A Media Sharing Platform Built With Open Source Software
configured per application
Overview: Problems to tackle
What data model should we use?
How to upload and download huge media files?
How to transcode these media files?
How to link all the tools together?
A Media Sharing Platform Built With Open Source Software
Uploading and Downloading mediaRestrictions firewall shouldn’t block → HTTP huge files (> 2GB) → no default HTML form in-browser upload → Silverlight / Flash /
Java plug-in
A Media Sharing Platform Built With Open Source Software
Silverlight Upload Component http://silverlightfileupld.codeplex.com/
Uploading and Downloading media
File part 1
File part 2
File part 3
User’s Computer Server
A Silverlight component splits the file in chunks and does a regular HTTP upload per chunk. On the server, a Java servlet accepts these uploads and reassembles the file.
A Media Sharing Platform Built With Open Source Software
File part 1
File part 2
File part 3
User’s Computer Server
File part 1
File part 2
File part 3
User’s Computer Server
File part 1
File part 2
File part 3
User’s Computer Server
uploadservlet
downloadservlet
regular HTTP DOWNLOAD
Uploading and Downloading media
.progress file contains upload byte position and the file size
A servlet is also used to download the file. The download can start as soon as the upload has started!
A Media Sharing Platform Built With Open Source Software
Problems to tackle
What data model should we use?
How to upload and download huge media files?
How to transcode these media files?
How to link all the tools together?
A Media Sharing Platform Built With Open Source Software
Transcoding media
A Media Sharing Platform Built With Open Source Software
FFmpeg, Mplayer and Flvtool2 are used to transcode the media files and generate keyframes.
original media, as uploaded(e.g., MXF DV25, D10)
low-res Flash video (*.flv) keyframes (*.jpg)
FFmpeg and Flvtool2 Mplayer2
Overview: Problems to tackle
What data model should we use?
How to upload and download huge media files?
How to transcode these media files?
How to link all the tools together?
A Media Sharing Platform Built With Open Source Software
Linking everything togetherWe employ a message queue to trigger new tasks at the end of a completed task.
RabbitMQ is used as the message broker, it is an open-source implementation of the Advanced Message Queuing Protocol (AMQP).
A message has a “routing key” and some payload: upload.compl
ete
filename = test.mxfsize = 4.3GBid = 812A Media Sharing Platform Built With Open Source Software
Linking everything together
a Xbc
Task aproduces messages
Exchange routesmessage usingrouting key
Queue stores andforwards messages
Task b and cconsumes messages
Message Broker
upload.complete
transcode.complete
Each task has a queue that subscribes to messages with a certain routing key:
A Media Sharing Platform Built With Open Source Software
Consecutive messages create a workflow
upload.complete Add a data stream to Fedora objectandStart transcoding of media file
uplo
ad
serv
let
fedo
raha
ndle
r
tran
scod
er
hand
ler
A Media Sharing Platform Built With Open Source Software
lowres.complete Add a (low-res) data stream to Fedora object
Task framework implementation The tasks are implemented using Ruby
A configuration file defines which messages (routing keys) trigger which tasks
A Ruby framework parses the configuration file and configures the task queues in RabbitMQ
A Media Sharing Platform Built With Open Source Software
def manualStartTranscode(msg) system(“ffmpeg –i #{msg[‘filename’]} …”)end
mapping:
manualStartTranscode: transcode.manualstart
startFlashVideo: flashvideo.manualstart
Overview: Problems to tackle
What data model should we use?
How to upload and download huge media files?
How to transcode these media files?
How to link all the tools together?
A Media Sharing Platform Built With Open Source Software
Future workImprovement is still possible
Error handling can be better… Scaling to different machines and stress
testing Start transcoding during upload
A Media Sharing Platform Built With Open Source Software
Conclusions It’s open-source!
All tools used are open-source Limited amount of custom code
It’s Flexible! Shot segmentation, metadata transformation, FTP
ingest, … and other tasks were effortlessly integrated.
New applications can use the MAMMIE regardless of the metadata model / media formats they employ.
More info? [email protected]
A Media Sharing Platform Built With Open Source Software
Questions
A Media Sharing Platform Built With Open Source Software