a media sharing platform built with open source software

24
A Media Sharing Platform Built With Open Source Software Karel Braeckman - VRT-medialab [email protected]

Upload: vrt-medialab

Post on 30-Apr-2015

1.676 views

Category:

Technology


0 download

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

Page 1: A MEDIA SHARING PLATFORM BUILT WITH OPEN SOURCE SOFTWARE

A Media Sharing Platform Built With Open Source Software

Karel Braeckman - [email protected]

Page 2: A MEDIA SHARING PLATFORM BUILT WITH OPEN SOURCE SOFTWARE

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

Page 3: 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

Page 4: 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

Page 5: 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

Page 6: A MEDIA SHARING PLATFORM BUILT WITH OPEN SOURCE SOFTWARE

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

Page 7: 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

Page 8: 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

Page 9: 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

Page 10: A MEDIA SHARING PLATFORM BUILT WITH OPEN SOURCE SOFTWARE

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

Page 11: 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/

Page 12: A MEDIA SHARING PLATFORM BUILT WITH OPEN SOURCE SOFTWARE

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

Page 13: 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

Page 14: 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

Page 15: 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

Page 16: A MEDIA SHARING PLATFORM BUILT WITH OPEN SOURCE SOFTWARE

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

Page 17: 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

Page 18: A 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

Page 19: 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

Page 20: A MEDIA SHARING PLATFORM BUILT WITH OPEN SOURCE SOFTWARE

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

Page 21: A MEDIA SHARING PLATFORM BUILT WITH OPEN SOURCE SOFTWARE

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

Page 22: 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

Page 23: 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

Page 24: A MEDIA SHARING PLATFORM BUILT WITH OPEN SOURCE SOFTWARE

Questions

A Media Sharing Platform Built With Open Source Software