You are on page 1of 81

Table of Contents

Drupal..................................................................................................................................................................1 Multimedia in Drupal..............................................................................................................................1 . .................................................................................................................................................................1 About Drupal...........................................................................................................................................1 Getting Started....................................................................................................................................................3 Using the site without logging in............................................................................................................3 Registering and Login..............................................................................................................................3 Overview of adding content.....................................................................................................................3 Create a Post........................................................................................................................................................5 Add a Blog post.......................................................................................................................................5 Uploading Audio with the Audio module.........................................................................................................8 Getting Started.........................................................................................................................................8 .................................................................................................................................................................9 Uploading your file..................................................................................................................................8 Error messages? ...............................................................................................................................10 Using a Wysiwyg Editor...................................................................................................................................12 Uploading an Image...............................................................................................................................12 Adding a link to a Webpage ...................................................................................................................14 Uploading and Embedding Video ....................................................................................................................16 Uploading from Computer.....................................................................................................................16 Adding video from another site using Embedded Media Field.............................................................18 Using Modules...................................................................................................................................................22 Evaluating and Choosing Modules.......................................................................................................22 Installing Modules.................................................................................................................................23 Introducing the Views Module........................................................................................................................24 An example of View.............................................................................................................................24 Creating Views Basic........................................................................................................................................26 Understanding Displays in Views ..........................................................................................................26 Understanding Settings in Views....................................................................................................27 Using the Content Construction Kit (CCK) Module.....................................................................................29 Installing CCK.......................................................................................................................................29 Introduction to Creating Content Types...............................................................................................29 Content Types with CCK.................................................................................................................................31 Getting Started with CCK......................................................................................................................31 Creating a Video Content Type with CCK .....................................................................................................33 Preparation.............................................................................................................................................33 Getting Started.......................................................................................................................................33 Video Upload Field........................................................................................................................34 Subtitle Upload Field .......................................................................................................................35 FLV Video Field.............................................................................................................................36 Feeds Overview ...............................................................................................................................................38 What are the possibilities of Media Feeds.............................................................................................38 Types of Feeds.......................................................................................................................................38 Aggregating Feeds.................................................................................................................................38 i

Table of Contents
Feeds Overview Creating Feeds.......................................................................................................................................39 Creating a Media Aggregation site..................................................................................................................40 Evaluation of kinds of Media Feeds......................................................................................................40 Configuring Feed API and Emfield .................................................................................................................42 Embedded Media Field..........................................................................................................................42 Configuring FeedAPI and Feed Element Mapper.................................................................................43 Custom URL Media Feeds in Embedded Media Field..........................................................................43 embedded_video_zz_custom_ur patch ...........................................................................................44 How it works in a nutshell.......................................................................................................44 Section to add..................................................................................................................................44 How to aggregate a third party Media feed feed Step by Step........................................................44 Creating Feeds...................................................................................................................................................46 Using File Field Podcaster................................................................................................................................47 Installing the right modules ..................................................................................................................47 Setting up your Podcast View ...............................................................................................................47 Adding Feed with Feed API.............................................................................................................................54 Start .......................................................................................................................................................54 Uploading Multimedia......................................................................................................................................56 What fields to choose for your Content Type........................................................................................56 Create our Content Type in CCK ...........................................................................................................56 Using External Media or Uploaded Media............................................................................................56 Embedded Media module ................................................................................................................56 File uploads and Media Mover .......................................................................................................56 Embedding or Uploading - Streaming and Downloading and Torrenting......................................57 Flash Video Module..........................................................................................................................................58 External help on Flash Video .................................................................................................................58 Preparing Ffmpeg to convert Video................................................................................................................59 Installing Ffmpeg to work with Drupal.................................................................................................59 Ffmpeg Wrapper....................................................................................................................................59 Media Mover.....................................................................................................................................................61 Media Mover module .........................................................................................................................................................61 .............................................................................................................................61 Pass 1: convert video to standard format.................................................................................61 Displaying Multimedia Overview....................................................................................................................64 JW player...............................................................................................................................................64 1 Pixel out player...................................................................................................................................65 Theming Multimedia Content.........................................................................................................................66 Bittorrent Module.............................................................................................................................................67 Using SWF Tools...............................................................................................................................................68 Using template files...............................................................................................................................68 Using Display settings in Content type section.....................................................................................68 ii

Table of Contents
Translation Overview.......................................................................................................................................69 Multilingual Subtitles on Video Player...........................................................................................................70 Required modules..................................................................................................................................70 Create Content Type..............................................................................................................................70 Changing content template for the Content type...................................................................................72 Translating.............................................................................................................................................73 Install following modules................................................................................................................73 Change content type workflow settings..........................................................................................73 Add Languages................................................................................................................................73 Adding a new Video and Subtitle data and choosing your language..............................................74 File formats...............................................................................................................................75 Example: Site showing mulingual subtitle support working on Drupal................................................77

iii

Drupal
[the name of the manuals should be changed to multimedia in drupal]

Multimedia in Drupal
There are many other features which makes Drupal a great CMS for web developers who want to use Multimedia flexibly. In the following chaptere we detail how to create a variety of different websites with Drupal and selected modules. It takes a beginner focused approach to Drupal with the focus of creating a Video sharing site with some additional information about working with Audio files as well. We aim to give you the outlines of how to set up a Drupal site and give hands-on examples of some of the stages you will need to go through in order to do the following things. Upload Video to your site Easily Embed Videos from other sites into your pages Import (or aggregate) Video RSS feeds to automatically appear on your site Moderate content added by other users or coming in from feeds Give users of the site different levels of access based on what they need to do Flexibly display video content in a variety of ways with different players

About Drupal
Drupal is a Free/Libre Open Source Software Content Management System (CMS). It can be used for a variety of purposes - ranging from a simple blog for an individual to complex multi-user sites for large groups of users. It is most commonly used to create community websites where members can publish multimedia content and site administrators can flexibly arrange the way that that content is organised and displayed.

There was a time when many web developers used to write a whole code base to create custom Content Management Systems. Nowadays many prefer to use an existing code base such as Drupal, which takes care of a lot of the aspects that are common to CMS's. These include: User authentication: Users can be registered and authenticated in a variety of secure and flexible Drupal 1

ways. Role based permission system: Admins assign permissions to roles so that different users have different levels of access. Searching: Content is fully indexed and searchable using the built in search module. Search Engine Friendly URLs: Drupal creates URLs that are both user and search engine friendly. File Uploads: You can define which kinds of files can be uploaded and linked to your content - and these can be displayed in various and flexible ways. Caching: Drupal's caching system reduces database queries which increases the speed of your site. Modules: The Drupal community has contributed many modules which provide functionality that extend Drupal use. There are literally thousands of modules - so many that it's sometimes hard to know which ones to use and there is little need to write your own code.

Getting Started
This chapter is a general introduction to using Drupal from a non-develloper perspective.

Using the site without logging in


If you want to look at the content of most Drupal websites you don't have to log into browse the content there. However it may be that some pages are restricted to users that have logged in. If you click on a link and at any point see. ???? - access restricted Then this is a sign that you may need to log in to see that particular content. Of course if the Drupal site you are looking at is a community or contains User Generated Content then you may wish to do more than browse you may want to add your own content.

Registering and Login


The first step to creating your own content on a Drupal website, or doing some moderating is to get a user account. Different Drupal websites have different ways of checking that you are person with good intentions before they let you log in. This may involve having to fill in a 'Captcha' box where you have to enter a series of letters and numbers. Or you may have to wait until a website admin has approved your application for a user account before you can start to add content.

When you have registered and have been approved (if this is how the site is set up) then you are free to add content.

Overview of adding content


When you have logged in the kind of content you can add will depend on what user permissions have been set for you. If you can't add the kind of content you want immediately, you may have to get in touch with the admins of the Drupal site to be able to make the most of it. Getting Started 3

Overview of adding content

Create a Post
The way to creating content in Drupal can vary from site to site so don't be surprised if you are using a site and it isnt' set up in exactly the way you see in this help. Normally when you have logged into your website you'll see a Create Content link in your sidebar.

When you click on Create content you should see a list of different content types and a description of the content.

You need to choose what content type you want to upload. This normally should be easy enough if you have a specialist media type like Audio or Video. It may be less obvious for other cases, for example what if you want to blog about an event coming up? You may want to check where the content appears on the website as well before you make the decison of which content type you want to upload. For example for the website above I'm going to upload a Blog entry as I know it appears in the middle of the front page.

Add a Blog post


This section illustrates how to add a post. If you don't have a Blog post type on your website you might find some of the step similar. To add a blog post click on the text Blog Post from the list of content types. The next screen you get to will ask you for a Title and to choose what Area the post relates to.

Create a Post

Some of the other field that you should fill are Free Tags, Teaser, and Body. Free Tags are useful to categorise what you are writing about. Sometimes websites use 'tag clouds' which lists all the popular tags which people have used in this box. It's also possible to see a page with all content that has been given a certain tag. Teasers are used in pages where a summaries of the posts are listed. Because of this you shuld normally only enter a few lines in the teaser. The Body is where you put in the full entry. There is normally no limit on how much you can enter here. If you want to add links, make text bold, italic etc, then there is more information on formatting the body entry in the Using a WYSWIG editor chapter.

Then you may want to add an image or a pdf or another type of file to your blog post. In this particular Drupal set up we have the option to do that with File attachments.

Add a Blog post

You browse your hard drive for your file and then click Attach. If you are uploading a large file then this may take some time.

When the file has been uploaded you can see the URL that the file now has as part of the website. This is useful if you want to incorporate the image of a link to the file from the body of the post. This is detailed more in the Using a WYSWIG editor chapter.

Add a Blog post

Uploading Audio with the Audio module


Mostly now Drupal devellopers are moving away from the idea of using self contained modules to work with media. However the Audio module still works very well if you want to simply upload audio files to your website. This chapters shows you how to use it from the uploaders perspective.

Getting Started
To get started you'll need to point your browser to the Add Audio upload form. This maybe different for different sites but normally you'll click on the 'Create Content' link on your side menu. Once you've done that you'll see a form not unlike that shown below.

Every Drupal site is slightly different so you might have Categories or other things to fill in. However the essential elements of the Audio module type are here.

Uploading your file

Uploading Audio with the Audio module

Let's jump straight to filling out the 'Body' field. The reason we are going to do this before filling out the Title of the form is that the Title should be completed for us if the mp3 file that we upload is correctly formatted ( that's what the [audio-raw-tag] things are all about). Try to fill out as much relevant information as you can.

Next, to start uploading an audio file click on the 'Browse' button next to the 'Add a new audio file:' box.

The browse on your computer for the file you want to upload.

Click on Open and you'll see that a link to your file has been recorded in the box of the input field.

That's great you can now keep filling in the form. The next part of the form is to add an image. This isn't totally necessary but it does make your post look much better so do try to find an image even if it meands downloading a slightly random one from the Internet. The process for uploading your image is similar to the mp3 file. Click on the 'Browse' button next to the 'Add a new image' field.

Browse for the image that you want to use for this entry. Generally it's best if you can use one that is quite square as it tends to crop it in that way. It's worth adding a licence so that people know if they can reuse or redistribute your work.

I'm going to choose a Creative Commons Attribution licence which means that people can pretty much do what they like with it as long as they credit where it came from. Filll out any other part of the form that you think is relevant and then click on 'Submit' and the bottom of the form.

Error messages?
You may get an error message if the file that you upload doesn't have any title or artist information.

Dont' worry just scroll down and fill in the relevant information.

Error messages?

10

Then click on 'Submit' again. Hopefully you'll see your audio file and information.

Error messages?

11

Using a Wysiwyg Editor


When entering content on a Drupal site it is quite often set up so you can use a What You See Is What You Get - WYSISYG editor. What this means in a nutshell is that you get the ability to do Word Processing like operations like Making text Bold, Italic and Underlined Making text into links Inserting Images into entries Creating list entries Changing the size and colour of text This is done using a WYSYWIG toolbar. There are different tools which can be used in Drupal two popular ones are TiyMCE and FCK editor. The following examples use the TinyMCE editor.

The way to alter the text is to select the text using your mouse and then to click on the image which represents what you want to do it. For example to make a selection of text BOLD, you would click on the button.

Uploading an Image
To upload an image you would place the flashing cursor where you want the image to appear in your post and then click on the button. A pop up window then appears.

Using a Wysiwyg Editor

12

The thing we need enter is the URL of where the Image is located on the Internet. This if fine if have already uploaded the image to our site. We can find the image and use the Copy Image Location ability which our browser gives us. If the image is not already uploaded to the image then you need to upload it, ideally to the same site that you are already working on. You may have the ability to upload files on the same page you are using the this WYSIWYG editor. This is the case for the website I'm working on. If I go down the page I see the text File attachments.

Click on the text File attachments and you'll see an upload box open up.

Click on the Browse button and upload your Image in this way. When you have uploaded it you should see a line with the attached file name listed and also the URL of the image on the website.

Select and copy the URL of your image. You are not ready to continue to the Insert Image box which appears when you press in your editor. Paste in the URL of the image into the box Image URL.

In my example I've added description of the image which is good for compatability and accessibility of your Uploading an Image 13

web page. The dimensions (in pixels) were added in automatically but if your image is a suitable size you don't need to enter anything in these boxes. Or if for some reason you have uploaded an image that is too big you can resize it here. I've also aligned the image to the left and added some space around the Image to make sure that the text which wraps around the image isn't too close.

Adding a link to a Webpage


To add a link to a webpage, the best thing to do first is to copy the URL of the page that you want to link to your computers memory. The easiest way to to this is to visit the page in your browser and select the URL from the Address bar at the top of your browser and copy it (eg. press Ctrl + C ).

You can then return to the post that you were editing in Drupal and select the text that you wish to turn into a link.

Then click on the

button. A pop up window will appear.

Adding a link to a Webpage

14

Here you should paste (eg CTRL + V ) the URL of the page you want to link to in to the Link URL box. You should also enter something in the Title box as well to make sure your site is compatible and accessible for the most amount of people.

You should then click on the Insert button to complete adding the link. Your text should appear in the link colour that is set for your website ( in my case it's green).

Adding a link to a Webpage

15

Uploading and Embedding Video


This is a users' guide for uploading video. As Drupal is a system which can be set up in many different ways, there are so many ways to upload video. We'll look a a couple of common ways that is it done using one website as an example. The ways we'll look at is uploading a video file from your computer, and another is to embed a video from another video sharing site.

Uploading from Computer


In order to start uploading a file from your computer, you'll need to have it in the right format. Actually because of the many different type of video files there are a few different formats that are likely to work. So maybe it's better to say that we need to know what kind of files to avoid. You should avoid video files that are huge, sometimes you may have saved a file out of a video encoding project as full quality. Don't upload this large file. You'll need to encode it first. There is help on this elsewhere. The programmes that use Free Software solutions to encoding video are Avidemux (Cross platform), Ffmpegx (Mac), Handbrake(Cross Platform) and SUPER encoder (Windows). In order to add a video from your computer you'll need to be logged in and point your browser to the Add Content page. On this website the link you need to click on is the Video Upload link.

The description for the Video Upload content type is 'Upload a video from your computer and convert it into a flash web-video ( like on YouTube or Blip).' This gets across the idea that you'll have a click and play type video on your page. Click on the Video Upload link and it will take to a form for you to fill out information about the Video file. This information is called 'Metadata', data about the video data. A sample input form with space for you to add metadata is below.

Uploading and Embedding Video

16

There are some field that are very useful for people to find your video; ie Title, Body (which is a full description of the video), Producer of the Video, Date produced. You'll also see some other options which you can click on to see more options. These are put their by default by the system. If you don't know what these options mean, don't worry you can safely ignore them. The Video Upload box is there so we can click on Browse and find the video file that you want to upload. When you have chosen the video from your computer then click on Upload.

When the video has been uploaded you should see the name of it displayed, the size and what file type it is.

When you've completed all the fields that you think are relevant to the best of you ability remembering to include as much data as you can, then click on the submit button at the bottom of your form.

Uploading from Computer

17

If all goes well your videos should be converted and displayed as a video on the relevant page of your site as a Video that you can click and play, as shown below.

Adding video from another site using Embedded Media Field


In a nutshell the Embedded Media Field is an input box in a form which lets you paste in the web address of a video that has been uploaded to another video sharing site, that you want to appear on the page. For example you may have a video up on YouTube that you want to feature without uploading it again.

To start the process you'll need to be logged in and point your browser to the Add Content page. On this website the link you need to click on is the Video link. There is a description which reads 'Use this to add videos from third party sites like YouTube or Blip'. Click on Video and you'll be take to a form to fill out the relevant data on the video. Below is an extract from the form similar to one that you might fill in.

Adding video from another site using Embedded Media Field

18

Below is a screen shot of the Video on YouTube that you would like to add.

We now need to copy and paste some of the information from the You Tube page into our form. The most vital bit of information to copy is the URL, the web address of the page.

Adding video from another site using Embedded Media Field

19

To do this select the URL in the navigation bar of your browser when you are viewing the Video on your sharing site and copy it in to your computer's memory. Paste this into the Embed Video File box of your input form.

You can then either copy and paste or type in the rest of the needed information on the form. When you have finished that click on the Submit button at the end of the form

You should then get a page which displays your video.

Adding video from another site using Embedded Media Field

20

Adding video from another site using Embedded Media Field

21

Using Modules
Modules in Drupal are the easiest way to increase the functionality of your site. They are lines of code written in a special way so that they easily slot into your core Drupal system and can be administered through the administration menu. The number of modules you can add is fairly mind boggling and is a sign of the strength of the Drupal community. The modules reflect that when people write an addition to Drupal system they often want to give that work back to the community. The best way to do this is to package up that additional functionality into a module and put it on the Drupal website for others to download, evaluate, bug test, revise etc.

Evaluating and Choosing Modules


The process of researching which module to use is a skill in itself. Mature and stable modules quickly and easily add great functionality to your site, however not all modules have been tested extensively and some are what we would call 'bleeding edge' technology. The last thing you want to do is to waste time and potentially break your site temporarily by installing a module that in all honesty isn't really ready to be used. There are a few ways to check how effective your module is and how ready it is to use none of these are exhaustive but . You can have a look at the comments at the foot of the module's home page. There are also links for Resources, Support and Development. The Read Documentation page is a good start for your research.

Looking at the contents of these links is a good way to see if the project is active or not. Although activity is not necessarily a sign that that module is right for you, as a simple, stable module may not be very active. You can click on View all issues to see how many bugs are being reported, what feature requests there are and how responsive the community of developers are. You'll see a screenshot as below.

Using Modules

22

Installing Modules
There are different ways of installing modules. The end result of all the ways of installing modules is that the module which is distributed as a .tar.gz - 'tarball' file, is extracted and the resulting folder or files placed in the /sites/all/modules directory of your Drupal installation.

Installing Modules

23

Introducing the Views Module


The Views module is a very powerful way of displaying the content of your Drupal site in a flexible way. It acts like a customisable search engine which creates pages which always return the same kind of result. Say for example you wanted a page which showed all the Audio and Video entries of your site that were about a certain place and had been categorised in this way, Views would be one way of doing this. Views has become very popular in the Drupal community partly because it is so flexible and you don't need to write any code to make it work.

An example of View
Let's look at an example of a View. Point your browser to the admin page which lists views. /admin/build/views/list In my set up there is a view which hasn't been enabled yet called Recent Comments.

The description of the View says that it 'Contains a blog and a page to list recent comments' the block will automatically link to the page, which displays the comment body as well as the link to the node. To work out exactly what this means to us, let's enable the view. Click on the Enable link.

When you have clicked the enable link you see that there is Path: comments/recent link. We can click on that to see what our newly enabled view looks like.

Introducing the Views Module

24

Well there's a surprise it gives us a list of our most recent comments. In the description of the view it said that it also created a block listing the same content which we could use. If we enable the block on the blocks page by pointing our browser at the admin/build/block page and chosing a region for it appear in.

You need to Save these settings. And you'll then see a Recent Comments blog in the Left sidebar.

In another chapter we'll look at how you create and modify your own views.

An example of View

25

Creating Views Basic


To further understand views to be able to create our own let's look into how and existing view is set up. To create or to alter a view we need to point our browser at the Views part of the Admin page. /admin/build/views/list Let's look at a view that we've already set up and change the properties of it. To do this we need to click on the Edit link associated with the view.

The next stage is where things start to get a bit scarey. The trick with views is to take it step by step and learn what each option does using examples.

Let's have a look at the way the Views page is laid out and check out some of the settings that are likely to want to alter for some of the view that we create in the future.

Understanding Displays in Views


The default display for the View is Defaults. We also see Page and Block which we saw the results of in the Introducing Views chapter. The idea is to set up the default settings with settings that will be the same for both the Page and Block display.

Creating Views Basic

26

When these have settings have been set up then you would create other Displays based on the default one. In this example two have been set up Page and Block. These new displays can override the default settings, for example you might want to display more items in a Page view than in a Block view.

Understanding Settings in Views


Let's have a look at some of these settings to see what they might mean. Some are easy to work out. Basic Settings: We have the Name of the current Display, Title of the view, How many items ot display, so some of these settings are clearly understood. Some of the other settings need more investigation for those unused to using Views. Relationships: You can set nodes that this view relates to. I'm not sure how this works exactly. This example relates to a Comment Node Arguments: The arguments allow you to set a dynamic elements to the view which can be set via the URL. Fields: Here we set the fields that are displayed for the view. In this particular view, if we look more fields are selected for the Page display than for a Block display.

Above you can see that four fields are selected for the Page display of this View. And 25 items are set to be displayed.

Here we can see that only two fields are selected for the Block display of this Recent Comments View. Also only 5 items are set to be displayed.

Understanding Displays in Views

27

Sort Criteria: Sort criterial affect the order in which the entries are displayed. In this example they are sorted by the date they were posted in descending order of date (desc) so the most recent appears first.

Filters: Filters allow you to exclude certain results or include only certain results. In the above example you'll see that there is a filter to only show 'Published or admin' which only shows users published nodes or ones which they have admin access to view.

Understanding Settings in Views

28

Using the Content Construction Kit (CCK) Module


The Content Contruction Kit is a way of creating your own 'content types'. Drupal comes with two content types already installed by default, Story and Page. These allow you to enter a Title, and text in to a Body field. There are also other modules that can be installed which come with predefined fields, for example the Audio module. If you install the Audio module and go to the Create Content page in Drupal and click on Audio with an aim of posting an audio file, Then you'll be asked to fill in a form with various bits of information, Title, Producer, Length, Bitrate etc. Some of these fields may be appropriate to what you need, some may not. The CCK framework was put in place so you can create a custom content type who exactly and only what you need. This can happen in a couple of ways. When you have installed the CCK module the you can add custom fields to existing content types or you create your own new content types and define which fields you want to for it.

Installing CCK
Using CCK effectively involves installing a number of modules. The most vital is the core module. The other modules are optional and give you either more flexibility about the information you can input into forms or the way that information can be displayed. CCK core module: provides teh which has its home here - http://drupal.org/project/cck date: creates an timestamp date field - http://drupal.org/project/date image field: an image field - "http://drupal.org/project/imagefield link: a URL field - http://drupal.org/project/link Embedded Media: a field for multimedia often from other sites - http://drupal.org/project/emfield content template (contemplate): allows for control over the form and display of fields, including teaser and RSS feeds - http://drupal.org/project/contemplate views: provides many types of listings of content; CCK exposes its fields to the Views system http://drupal.org/project/views

Introduction to Creating Content Types


There is good help for using CCK to create content types in the Drupal handbook here http://drupal.org/node/162247 What follows is a short introduction to the process. The flexibility of the CCK system means that you can plan your content type to include many different field types. If you create a new content type then you'll have the options manage field and you'll be able to add extra CCK fields.

Using the Content Construction Kit (CCK) Module

29

On the install I'm working on I've got quite a few field types enabled for CCK. You can see a dialogue box with the choice below.

Introduction to Creating Content Types

30

Content Types with CCK


Content types are a way of uploading the kind of material and information you want to Drupal. Drupal comes with two pre-installed content types 'Story' and 'Page'. As with most things in Drupal there are many ways of extending this out of the box functionality. If you want to add other content types you can use the Content administration tools that come with Drupal. This will normally leave you with only the options to include the Title and Body fields in your content type, which of course is pretty limited in its usefulness. CCK allows you create your own content types (say Video for example) and then to add different types of fields to content types you create. This is generally regarded as the most useful way of building up your content types. CCK the Content Creation Kit is a set of tools which allows us to do exactly this. It's so useful that it's going to be incorporated in to Drupal core. In essense CCK allows you do define what fields needed for a type of content. Below you can see a display of a Video content type, and all the fields that have been created for it.

Getting Started with CCK


We cover how to install modules elsewhere in this manual. To get CCK working make sure you install the CCK download (which is a collection of modules) from here. http://drupal.org/project/cck There is a handbook on CCK on the Drupal site which is useful for more in depth information. http://drupal.org/node/162242 CCK is actually a package of more than one module so after you have extracted it you don't need to enable all the modules. The main one that you can't do without is 'Content' some other ones that you may need to install are Node Reference User Reference Text Number Content Types with CCK 31

Options Widget There are many, many other field modules which you can download and install separately. The problem wth CCK sometimes is that there are too many options and it becomes confusing to work out the best way to approach a solution. Often people running Drupal site reply on personal reccomendations of CCK modules rather than doing all the research and experiments themselves. If you want a more detailed, hands on approach then you can look at the chapter 'Creating a Video Content Type'.

Getting Started with CCK

32

Creating a Video Content Type with CCK


This is a hands on demo to create a Video content type that uses subtitles as well. We'll cover the CCK modules that are needed to created a Video Type with subtitles. The aim is to be able to upload a video to your site of any type, and for that to be transcoded (ie converted) into a video type that can be displayed in a streaming video player. While this can be done using the open OGG file format, in this chapter we'll look at how to do it with FLV flash video.

Preparation
To be able to create the content type we are going to be working on, you'll need to have the following modules installed as well as the core Content CCK module. Text Number Options Widget File Field

Getting Started
You need set up a content type with 3 CCK fields one for the Video file you'll upload, another for Subtitle files (text), and one for the FLV video you'll get when you've transcoded the video. There are a few different possiblities for how to do this. You could set up a simple text field, in this way you could paste in the URL of the files. This would be useful if you were linking to external videos to save bandwidth for example. Although it's harder to set up the system to do it for the subtitle files. In this example we'll set up a content type with video file and subtitle files uploaded via the CCK file field module. To do this first create a new content type. Navigate to Administer Content management Content types /admin/content/types/ and click on the Add button.

Then enter the following data about the Video content file.

Creating a Video Content Type with CCK

33

We shouldn't need to change any of the other settings for this form. So you can click on Save Content Type when you have filled in the data. You'll then see your new content type appear in the list of existing ones. Click on the manage fields link.

Video Upload Field


We'll add the first field. This will be where the Video file from your computer gets uploaded to. Enter the following data.

Now click on Save On the next screen you need to decide what help text to show to users, what type of video files you let your users upload and the maximum size those videos are allowed to be. Do this by entering the following data or changing it if you know that you need to.

Getting Started

34

Now click on Save Field Settings We are going to repeat the process for two other file fields. One for Subtitle file which users will upload and another for the FLV video into which our video file will be converted.

Subtitle Upload Field


Let's add a field for the subtitle file. To do this repeat the steps above but enter the following information.

And on the following screen we are going to set the allowed subtitle types to only str files, as they are the ones that are compatible with the player we are going to use later (JW player).

Video Upload Field

35

FLV Video Field


Finally for our last video type for FLV repeat the same steps but put in the following information into the forms.

And you can add some help text and set the type of file to be uploaded to be only an flv file.

After adding these three fields, your settings should look something like this.

Subtitle Upload Field

36

This doesn't have to be the end of the fields you add to your Video with Subtitles content type, you can add other information like Name of Producer, Date Produced etc, but we are going to leave it there as this amount of information will do the trick for what we need.

FLV Video Field

37

Feeds Overview
Examples of Feeds are RSS and Atom feeds. Feeds are a compact way of exchanging latest content from one place to another. Most commonly people use RSS feeds to subscribe to the latest headlines or updates from websites in a feed reader or email client. Podcasts are also a type of RSS feed which contains details of a media file (you get audio and video podcasts). Some media players can read these feeds and automatically download any new media content that is published. Feeds like RSS and Atom can also be used to syndicate (push) and aggregate (pull) content from one site to another. This is the aspect we are really interested in here. We are going to try to pull as much information about published video files into our Drupal site so that our users can view the video, search for it and find it in the relevant parts of our site. This overview will give you a summary of how this is done and some of the issues involved.

What are the possibilities of Media Feeds


Media feeds give us a possibility to move beyond the ideas of separate websites linked by a search engine. They give us the ability to: Add media to your site, linking out to the original media. Embed the media from feeds so vistors don't have to leave your site. Search across a connected network of websites whose content has been edited and pulled together by people who share interests. So with these different elements in place we can imagine a networked community of video publishers that can aggregate, categorise and resyndicate video work with a minimum of effort. If you put file sharing into that mix we can see a far sounder alternative to the centralised video sharing websites that are currently popular.

Types of Feeds
There are a few types of feeds that we might run into when people are publishing their media. RSS 1.0: This is a simple feed, normally only containing the Title, Description and a link to the original source of the news / video. This kind of feed doesn't contain information about the video file itself. RSS 2.0: There are a few different types of video feed which use RSS 2.0. The most common is a standard 2.0 feed with an enclosure for the media file. The iTunes RSS feed extends this to add some some more information about how the file is categorised. RSS 2.0 with Media RSS information: There has been somework to include features like a media thumbnail image, bitrate information etc. This is quite widely used and when used well is a good way of exchanging metadata about the video file. ATOM: This feed can usually do the same work as an RSS 2.0 feed. Unfortunately is hasn't been taken up as much as the Media RSS standard.

Aggregating Feeds
Where Drupal really comes into its own is in its ability to aggregate feeds flexibly. There are a few new tools in Drupal to really allow us to do this in relation to media feeds.

Feeds Overview

38

One is the Embedded Media Field module. This allows us to store the URL of common video sharing site in the field (created using CCK). When we come to view the content as a page it pulls out the relevant embedding code to display a streaming video player. With a bit of adjusting you can add your own custom url processors to deal with Media 2.0 fields with enclosures. The other super useful tool is the combination of Feed API and the Feed API Element mapper. Feed API is the main contender for an aggregator tool and should become part of the core Drupal code soon. The Element mapper part of it allows us to point different parts of the feed to different fields in the content types we create.

Creating Feeds
RSS feeds are created automatically for some views in Drupal. If a media files is attached as a file attachment then the first of these is included in the feed as an enclosure. There is a module for creating ATOM feeds. There is another module, ffpc ( Field Field Pocaster module) which gives you more flexibility about creating RSS fields with media enclosures within the Views module. You can also create your own custom RSS feeds if the above solutions are not appropriate

Aggregating Feeds

39

Creating a Media Aggregation site


The process of creating a media aggregation site has various stages. Firstly you need to evaluate what kind of Media Feeds you want to pull into your site. Then you need to work out how you want to present them. Then you need to set up a series of content types to host the data that you are pulling in from. You'll then need to install and configure tools for reading the Media Feeds and parsing that data into the relevant parts of the custom content types you've set up. You may need to create some additions to the current tools to process some Media Feeds. After that you'll need to create content template alterations to display this metadata and to be able to wrap the media files in relavent players so that they'll stream from your site. You need to set up some custom views to display certain content types together and some separately and to be able to output some good aggregated Media Feeds yourself. Also you'll also probably want to create an intelligent search tool to allow users to search through the incoming content And let's no forget, if you want to allow your users to upload their own video onto the same site then you'll need to set up similar systems to deal with media uploaded to your site and to control how that is dislayed. A summary of these steps could be listed like this; Evaluate the kinds of Media Feeds you need to import Create a design for your site Set up relevant content types Install and configure FeedAPI and Embedded Media Field to parse feeds Add any additionally needed Processors to Embedded Media Field Create needed Views and RSS feeds Theme these Views altering the content templates Create a search tool

Evaluation of kinds of Media Feeds


Certain types of feeds are easier to import than others. A lot of work has been done on a module for CCK called Embedded Media Field. The following still shows the different providers that you can set to work in conjunction with this module.

Creating a Media Aggregation site

40

a If we aggregate feeds from these providers then the Embedded Media Field module can do a lot of hard work for us. The way this is done is by using the FeedAPI module. It allows us to map the Original URL of the video sharing website to the Embedded Media Field. When entering the content the module automatically determines which content provider is being used. When displaying the content, the proper embedding format is used. Or we can then present it to our users in flexible way when we theme our media aggregation site. What if the website that we want to import feeds from isn't in this list? Well we have different options in this situation. We could use the ability of the Feed API to map different part of the incoming feed to different CCK fields that we create. Or we could use the frame work of the Embedded Media Field to do achieve the same effect. What we would have to do is to write a Provider for the kind of feed we want to aggregate.

Evaluation of kinds of Media Feeds

41

Configuring Feed API and Emfield


This chapter tells you how to configure Feed API and Embedded Media Field with the aim of importing several types of Media Feeds. The process also uses a helper module called Feed API Element Mapper. If you want to include standard Media 2.0 podcasts you may need to install a patch if the host isn't one of the ones supported by the Embedded Media Field.

Embedded Media Field


To set up Embedded Media Field to only accept videos from the providers that you choose and to alter other settings then you should go to Home > Administer > Content management > Embedded Media Field Configuration Or you can set the settings for each content type that uses an Emfield. For example for the content type Video23 you should edit the settings here. Home > Administer > Content management > Video 23

Here we've chosen some of the more popular video sharing sites. We've also chosen Custom URL. This allows us to map feeds from outside of these sites. There's more on this later in the chapter. http://wiki.transmission.cc/index.php/Drupal_Video_documentation#Drupal_6_-_Feed_Api_and_Mapper_Dev

Configuring Feed API and Emfield

42

Configuring FeedAPI and Feed Element Mapper


Install required modules: FeedAPI FeedAPI Mapper Emfield CCK Add the SimplePie parser The simplepie parser needs to be downloaded also. Download and unzip simplepie_1.1.3.zip and copy the simplepie.inc file into the sites/default/modules/feedapi/parser_simplepie 4) Enable required modules: Enable Content module Enable Embedded Media Field Enable Embedded Video Field Enable feedapi Enable feedapi_node Enable simplepie Create new content type for the video items which contain an embedded_video field. There is help on this in another chapter. Enable all (required) providers: navigate to admin/content/emfield/media and enable all providers Create a YouTube test feed. Create content > feed: Title: YouTube G20 Feed URL: http://gdata.youtube.com/feeds/base/videos?q=g20&client=ytapi-youtube-search&alt=rss&v=2 (from a YouTube search for G20) Under "Processors > FeedAPI Node" For "Node type of feed items:" select "Video". Save We need to 'Map' the original url field. Select the 'Map' tab. options->original_url: to field_emvideo Save and refresh. Result: 25 feed items from YouTube with embedded video

Custom URL Media Feeds in Embedded Media Field


The Embedded Media Field module can also work with custom URL's. This lets videos hosted on another site, or on the local server, to be embedded. An editor simply pastes the link they wish embedded into the field's Configuring FeedAPI and Feed Element Mapper 43

textfield, or in our case for our aggregation site, we would be more likely to map an enclosed URL to the field. We can use the ability of the Custom URL field to map Video podcast feeds from independent Video sites to our the Embeded Media Field. However, not all video file types are supported at the moment, including avi files unfortunately. We'll need to install a patch to make this feature work with more files. http://wiki.transmission.cc/index.php/Quick_installation_of_FEM_and_patches

embedded_video_zz_custom_ur patch
Allows more metadata to be added the Custom URL array)) How it works in a nutshell If a URL based provider isn't found, then based the media enclosures of each feed item are parsed in to the Embedded media field. To set this up you need to, when mapping feeds set options > enclosure or options > raw > enclosure to map to the Embedded media field

What the patch will do is to go through the feed and create an array of information that it thinks will be useful. It will then store that data in the Embedded Media Field, as a Custom URL.

The kind of information that it will look for is Enclosed media file (mp4, avi, etc) Metadata in the enclosures, video length, file size, dimensions, codec

Section to add
Need to get the patch from ekes in a download link and do new screen shots with a feed from blip.tv with flv and with mp4 / avi enclosures http://wiki.transmission.cc/index.php/Drupal_aggregating_multiple_files_from_enclosures

How to aggregate a third party Media feed feed Step by Step


Import a feed from ifiwatch.tv Create content > feed: Custom URL Media Feeds in Embedded Media Field 44

Title: IFI Watch TV Feed URL: http://www.ifiwatch.tv/en/video/feed Under "Processors > FeedAPI Node" For "Node type of feed items:" select "Video". Save. Map options->original_url: to field_emvideo Save and refresh. Result: 10 feed items created from ifiwatch.tv but with NO embedded video 9) Solution: Apply patche written by ekes: ssh in the server cd sites/all/modules/ cd ../emfield patch -p0 < emfield.emvideo.zzz_custom_url.20090418.patch 10) edit the ifiwatch.tv feed, modify the mapped fields map "options > enclosures" to "emvideo field" Result: The first video file found in the enclosures from the ifiwatch.tv feed is now mapped to the emvideo field. If there are multiple video files found in the enclosures, and the embedded video field allows multiple values, the mapper will map multiple video files.

How to aggregate a third party Media feed feed Step by Step

45

Creating Feeds
This is an overview of creating feeds. Feeds that come out of your site are useful to other for aggregation puporses. This can be linked to from elsewhere some of the work done as part of the Transmission network. Feeds are created relatively easily in Drupal. But there are some complication with media feeds. For example - getting both Links to streaming videos for use in Embedded media fields and downloadable files.

Creating Feeds

46

Using File Field Podcaster


This chapter will tell you how to use use File Field podcaster to create a podcast with enclosures from files uploaded to CCK with the File Field module. The scenario we are working with is this. You have set up a custom content type where you upload video files with the File Field module (see File Field chapter), these videos are not showing up in your podcast as file enclosures. As you need file enclosures in your feed for them to work in Miro, iTunes and for other uses this is something that you need to address. We are going to do this using the File Field Podcaster module. The module also relies on Views 2 to make the RSS feed.

Installing the right modules


The module File Field Podcaster which can be downloaded from here. http://drupal.org/project/ffpc There are some dependancies for the module, so you will need to install these other dependancies before the module will work properly.

You may need to enable FileField Meta and the getID3() module - which needs a php library as well. This is a bit tricky but there are help files for how to install it at the home page of each module.

Setting up your Podcast View


Once File Field Podcast is installed, point your browser to /admin/build/views and create a new view by clicking on the Add tab.

Then fill out the details of the new name of your view. In this case we are calling the view name videorss and a human readable name of Video RSS feed

Using File Field Podcaster

47

Fill out the form with these details and then click Next . When you have filled out the overview information you'll see the starting screen for creating a View. This is relatively complicated. You may want to read the general chapter on working with Views. For our purposes we are going to only need a Feed view. So let's create a Feed display on the left and get straight to it. To do this select Feed from the drop down menu on the left of the interface.

Then click on Add Display. Some of the settings are self-explanitory some you'll need to have a look at the chapter on working with Views. However now that we have File Field module installed we have a new option under Style. We should change the Style. Click on the word style setting to Podcast feed at the bottom of the page.

Setting up your Podcast View

48

Select Podcast feed and click on Update Then underneath this setting you need to change the settings for Row style. To do this click on the text next to it on the right, in this default case on Missing style plugin.

When the options appear at the bottom of the screen you should then select Podcast Episode.

Setting up your Podcast View

49

Then you need to select the Fields that will be included as podcast enclosures in our Video feed.

Adding a Node Type Filter Don't for get to add a node type filter so that we only get certain types of nodes. In this case we will set it to Video with Subtitles which are published. Click on the + sign next to Filters.

Setting up your Podcast View

50

Then select 'Node : Published or admin' This filters out unpublished nodes if the user cannot view them.

Then click on 'Add'. We are going to add another filter to select the type. So repeat the above process make sure the 'Is one of' button is ticked and select the Video with Subtitles content type.

Then click on 'Update default display'. The last thing we need to do is to set a path for the feed as there is not one defined by default. To do this click on the text next to the 'Path:' option.

Setting up your Podcast View

51

Then enter a suitable name for the path of the video feed.

Click on 'Update'. Then your view is ready to save. Click on 'Save' at the bottom of the page.

You can now point your browser to the path where you have set your RSS feed - in this case http://potatopark.clearerchannel.org/videorss You should be able to see if the process of adding file attachments to the feed has worked. If it has the details of the file should show up as in the screenshot below.

Setting up your Podcast View

52

Setting up your Podcast View

53

Adding Feed with Feed API


How to add feeds with feed API Scope - User end documentation for non tech people doing admin on Drupal sites. Based on existing docs for D5 but screenshots on a d6 site. example - http://wiki.transmission.cc/index.php/Step_by_Step_Guide_to_Adding_a_Feed_to_IFIWatch.TV

Start
The above document is cut and pasted here as a good start.

click on create content click on Feed for Video, docs or news you don't need to enter the 'title' select the feed category This is usually Video but maybe Documents or Other for News This is only temporary as the developer is going to get rid of it when the old content that needed this category has been moved to the new system

enter some keywords that will be inherited by any feed items think about what tags/keywords the feed items will want, more than the feed itself. i.e. the content of the videos may be more interesting than the source of the feed they come in on.... tags are important since they will help users to find the material entering the database on the feed you add. so remember: if you add tags/keywords to the parent feed they will be inherited... if there are tags on a feed item they are inherited with the item... and if you want to manually add tags you can do so by going to the edit mode on each item and adding keywords in the specified field.. you don't need to enter anything in body, like 'title' it is filled automatically. (if title and body do NOT fill automatically when you have added the url and clicked on 'preview', it means there is something wrong with the feed. maybe go back and check the url..) now we're at Feed URL - here you enter the URL of the feed you want to add. This can be any feed for Video, documentation or news For example the results of a search of a video publishing site for IFI-relevant videos. click on the Processors to expand it If it's a video, choose video. likewise if it's a feed with documentation choose docs and a feed with news items choose news. Adding Feed with Feed API 54

then click preview at the bottom of the page at this point there should be the title filled in. if not there is probably a problem with the feed if it is filled in remember to hit submit

deep breaths, first part done once you hit submit you should be viewing the new page, across the top there are some tabs. click on map For most feeds you can just follow the instructions looking at only the \/ Edit mapping section of the form Title and Description are automatically mapped to Title and Body so you can ignore them. For video we can almost always say (except in special odd feeds) that you want to set: options->original url to field_embedded_video (video_cck_module) options->tags to keywords (just near top under map to taxonomy) normally you can also just go to options->raw->author and set that to field_author For news and docs for now you can just do the same, but leave out the video. Remember to hit update on this form

almost done Now run the feed for the first time by clicking on the tab Refresh

Start

55

Uploading Multimedia
Uploading Multimedia has come a long way in Drupal recently. Previously you would have probably tried to use the Audio or Video modules and be done with it. However now with CCK and Views modules and the Embed Media Modules you can have a more flexible approach. This outline goes over some of the issues associated with Multimedia and Drupal and later chapters show us one approach to doing it with an Hands on example.

What fields to choose for your Content Type


When creating your content type for your Multimedia file there are some decisions that you need to make. How much information are you going to ask your users to enter. You can take the approach of a Video sharing site like YouTube which only asks for minimal information, as it recognises that most people really don't like to fill out forms. Or you could take an approach like the Internet Archive (Archive.org) which presents you with a huge number of fields to fill in in forms allowing you to enter as much or as little as you want. This aspect of what Metadata (Metadata is data describing the media file) to collect If you want to look at an example for fields used for a video content type then you may want to look at a Metadata scheme used by the Transmission network http://wiki.transmission.cc/index.php/Metadata_Workspace

Create our Content Type in CCK


The reccomended way to create your content type is in CCK. There is a chapter in this manuals about the specifics of how to do this in general. Also there is a hands on example of how to create a video content type to the Transmission specification later in this manual.

Using External Media or Uploaded Media


One of the issues that you might come across is the issue of if you should only allow people to embed media (especially audio and video) from external media sharing sites, or if you should only allow people to upload their files to your Drupal installation, or if you should allow both.

Embedded Media module


If you want to only allow external media then you will find the Embedded Media module to be very useful. It allows you to enter the URL of the page or location where the audio or video is located into a field.

There is a chapter on using Embedded Media module elsewhere in this manuals.

File uploads and Media Mover


If you want to be able to upload files to your site and make them available for download and also make them available to be viewed as a click and play / streamable format. Uploading Multimedia 56

Streaming There are different ways that this can be done the most reccomended one currently is Media Mover. The the Media Mover module is a way of taking an uploaded file (say an avi, mp4, or wmv file) and transcoding it to a file that will stream. This may be an .flv file or an Ogg file. Media Mover is defined on it's home page as "a set of modules which allows website administrators to easily create complex file conversion processes". It's a very complex and hairy beast. What we likely to be using it for is relatively simple compared to all the things it can do. Media mover can be described as a big lump of code which you need to write bit of code in order for you to do what you need it to do. There are some people working to make Media Mover more user friendly as part of the forthcoming Media module, watch this space. A hands on guide of how to convert an uploaded video file to an flv file is included elsewhere. Downloading Creating a field to upload a video file for download is relatively easy. You can configure the CCK filefield to do this. One of the reasons for uploading files without converting them for streaming is to encourage people to subscribe to your media via a Podcast feed. And in fact there is a plugin module called Filefield Podcaster (FFPC) which helps you out by creating a podcast feed based on the files uploaded via filefield. There is a Hands On guide of how to set this up elsewhere in this manual.

Embedding or Uploading - Streaming and Downloading and Torrenting


Ok, so what if you want to get the best of both worlds. You want the choice of being able to upload a media file, or embed it from another site. You want your users to be able to clicka and play the file and you want them to be able to click on a link to download it. You also want a Podcast feed that is valid with all the podcast players and aggregators. Also last but not least you want to be able to network your files via bittorrent as well. This is all possible separately, see other chapters, but to do it all together may currently take quite a bit of customisation. We'll check back with a chapter soon on how to do this as a Hands On exercise.

File uploads and Media Mover

57

Flash Video Module


The Flash Video module is a way of working with different video files so that they can be displayed within flash video players on your Drupal website. To do this you'll need to set up a way of trancoding the video files that people upload to your website to a format that will work in a streaming player.

While you can use Ogg file format and certain players, we are going to use the flv file format and JW player for greater compatibility. The Flash Video module allows us to do this relatively easily.

External help on Flash Video


There is a good tutorial on installing, configuring and using Flash Video at the following page. http://www.travistidwell.com/flashvideo

Flash Video Module

58

Preparing Ffmpeg to convert Video


If you want to convert Video from one format to another then you can use the FFMPEG tool to do this. We are going to take the very common example of converting uploaded video files into FLV format. This allows us to use those videos in an open flash style player so our website visitors can click an view a video. The kind of tools we'll need to do this are. Ffmpeg Ffmpeg wrapper module Media Mover module This chapter covers the first part of this process, it the installing of the ffmpeg tools. There is a separate chapter on using Media Mover to control the process of the video convertion.

Installing Ffmpeg to work with Drupal


To convert video from attachments into flv format on your Drupal installation, you will need two extra elements; Ffmpeg is a standard open source package for multimedia handling available on many distributions so ask your host if you dont have it. Note it might be very tricky to make it running: Standard debian package is striped from proprietary formats so you will not be able to transcode from/to avi, mp4, rm flv or mp3 but developer of Media mover is providing static binary. You still need vhooks libs installed (part of ffmpeg) on system. Usually shared hosts don`t let your php files run shell commands. If you run into passthru limit or php error 127, it means you are in shell jail. Explain to your host what you are going to do and ask for a solution, this doesn't help, then you may need to change your host. If your test transcode is not running, try "flush all caches" from admin menu. This helped us when we ran into trouble.

Ffmpeg Wrapper
To transcode in drupal you need to install ffmpeg wraper module and test it via settings in admin menu. Best way to test is to trans code small video file with common extension like 3gp or avi and media encoded with popular codec. The Extension of the test file has to match one from list available formats of ffmpeg, other wise your test will fail (for example .mpg files may not work). What follows are the instructions from the README.txt file that comes with the Ffmpeg Wrapper module. CONFIGURATION Go to admin/settings/ffmpeg_wrapper Make sure you configure the path to FFmpeg. This is relative to the root of your server. If don't know where FFmpeg is installed and you have access to the command line of your server, you can run: $locate ffmpeg This should hopefully give you a path to ffmpeg. If you need install FFmpeg, there are instructions here for installing it on a debian/ubuntu environment: http://www.24b6.net/?p=188 If you need a compiled binary, check http://mediamover.24b6.net/ffmpeg Preparing Ffmpeg to convert Video 59

If you are having PHP issues with openbasedir, you may want to look at this page: http://drupal.org/node/82223 DEVELOPERS ffmpeg_wrapper supports defining configurations that set default values in forms that are built to support ffmpeg_wrapper. Look in the conf dir for an example of how these configurations can be built. This is helpful for constraining users from building configurations that ffmpeg will not function with. To enable the support in your forms, merely call this function: ffmpeg_wrapper_enable($prefix, $output_form_id); Here, $prefix is a prefix used in your forms (in standard drupal, this will be at least "edit-"). $output_form_id is the name of the output controler form element. Check out media mover API's mm_ffmpeg module for an example. The second piece that needs to be done is to name your form elements with the ffmpeg_wrapper convention. Any form element that controls an aspect of ffmpeg (eg, audio bit rate) needs to be named in a specific way: ffmpeg_audio_ab Where ffmpeg is always used, audio is for audio options (video is the other possibility) and ab is the ffmpeg command for setting the audio bit rate. Again, mm_ffmpeg offers a good example of how to do this. Alternatively, you can just use $form[] = ffmpeg_wrapper_configuration_form($prefix, $configuration) to build a form from ffmpeg_wrapper. You will need to handle your own validation and submission, but outside of handing the size:other options, this is very easy. Going this route gives you the ajax form configuration straight away.

Ffmpeg Wrapper

60

Media Mover
The media mover module is very flexible. It can be used to process files in many ways. In this example we are going to take a video file process it with ffmpeg and then reattach it to the mode as a CCK file.

Media Mover module


Media mover does the video conversion in a set of stages. Each stage processes new nodes with video attachments. Media mover rules should be weighted so that they run in order. This will allow nodes to be made public only when all content has been processed.

Pass 1: convert video to standard format Set up a media mover rule to do the following:

harvest nodes with attachments attachments should have allowed video extensions exactly which extensions are possible will depend on your ffmpeg setup Process your incoming attachments to transcode video to flv store transcoded video in a cck file field on the original node

Pass 2: Create a thumbnail

harvest nodes with video attachments - exactly as above process your video to create thumbnails store the thumbnail in a file field we had trouble adding to an image field !!! (current problem) Complete your processing by publishing your node and promoting to front page if you want

A screen shot of a completed template for Media mover is below.

Media Mover

61

There are setting by which you can alter the encoding of the files which are used by media mover.

The last stage is to reattach the processed video file back into the node. This is done with storage , below we are storing the end file in a CCK file field called Video (FLV format). This is then used as a base to diplay the video in a flash player on the page of the video.

Pass 1: convert video to standard format

62

Pass 1: convert video to standard format

63

Displaying Multimedia Overview


This chapter outlines some of the aspects of working with multimedia players in Drupal. Our mantra here is as always that there are a great many possibilities of how to do this. Some of the one that we are going to look at are JW player (video) 1 click out player (audio) SWF tools (integration of those players) Let's give an overview of the functionality of these players.

JW player
The JW player when used for video looks a bit like the screen shot below.

It's a player that can work with flv files, you can skip to any point in the file, adjust the volume etc. You can also use the player to dispay subtitle captions over the video. The other functionality which is really useful is the ability to use an RSS feed or xml file as a playlist for the layer and to display the items in the play list in a sidebar.

Displaying Multimedia Overview

64

If you set up this kind of player based on a playlist then clicking on any of the items will start that video playing. When the video episode has finished playing you can set it to return to the menu again. There is information about how to install JW player in the chapter Installing Multimedia players.

1 Pixel out player


The 1 pixel out player is a very simple but stylish player for audio. When it is not being played it looks liek the screen shot below.

When you click on the play icon, the player expands to give you more information about the file you are playing.

There is more information about how to install the player in the chapter Installing Multimedia players.

JW player

65

Theming Multimedia Content


This chapter deals with how to best present multimedia content using Drupal Themes. It will include A basic overview of why you need to theme multimedia content. An overview of the theming process with media especially video and images, linking out to more in depth help. A hands on section of dealing with Embeded Media player as well as a downloadable file. This resource should be hand for the hands on http://wiki.transmission.cc/index.php/Theme_multiple_items_in_embedded_video_field

Theming Multimedia Content

66

Bittorrent Module
The bittorrent module for Drupal creates a file type for you and also runs a bittorrent tracker as well.

Bittorrent Module

67

Using SWF Tools


This chapter will tell you how to use SWF tools to integrate different flash based players with your multimedia content. You should already be at the stage where you have Installed SWF tools and the JW player Created a Video Content type with accessible FLV file Uploaded some usable Video content Once this is in place you can user SWF to work in two ways by creating templates which display multimedia files ( by using theme templates or the content template tool) by setting the Display Field settings in the content type section so that SWF tools then automatically wraps your chosen player around the video file If you are new to this then that might not make a lot of sense. Not to worry we are going to build on the work we have done in previous chapters to go through this process step by step.

Using template files


http://mustardseedmedia.com/podcast/episode17 The syntax for using swf tool and a start on how to get the right variable, maybe by using swftools.

Using Display settings in Content type section


What is also possible with SWF tools is to use the file field settings to chose swftools to create a media player. /admin/content/node-type/audio/display

Using SWF Tools

68

Translation Overview
This chapter will be a quick overview of Translation Installing Locale, i18n, and getting the set up sorted for translation of Video Subtitle content type for a working example of a multlingual video set up.

Translation Overview

69

Multilingual Subtitles on Video Player


This Hands on Chapter will reference setting up Translation in other chapter, setting up a video content type with CCK, and complete the equation by setting up a node with a video player which can be translated to other languages to create a multilingual Video player. The aim is to get subtitle files to display over a video using JW player, and to be able to add translations so that the same video can be viewed with subtitle files of different languages. Thanks to Ben from anarcho.tv for help on how to do this.

Required modules
Contemplate http://drupal.org/project/contemplate JW player (installed on server) Content Translation (CORE) Locale (CORE) Internationiazion - http://drupal.org/project/i18n CCK

Create Content Type


You need set up a content type with 2 CCK fields one for the Video (which could be text or Embfield Media Field) - and another for Subtitle files (text). There are a few different possiblities for how to do this. You could set up a simple text field, in this way you could paste in the URL of the files. This would be useful if you were linking to external videos to save bandwidth for example. Although it's harder to set up the system to do it for the subtitle files. In this example we'll set up a content type with video file and subtitle files uploaded via the CCK file field module. To do this first create a new content type. Navigate to Administer Content management Content types /admin/content/types/add Then enter the following data.

Multilingual Subtitles on Video Player

70

Then we'll add field for the video file

On the following screen you can leave it unchanged and press submit, we don't need to do anything special here. The size of the text field only needs to be as long as the URL. Then add a field for the subtitle file.

Again the following page where you set the defaults doesn't need to be changed. Your settings should look something like this.

Create Content Type

71

Changing content template for the Content type


There are various ways this can be done we are going to use the Contemplate module as it's a quick way of doing it. You might want to build your own template files as a long term solution. It'll acheive the same ends. Got the the Administer menu and click on Content > Content Templates Next to the content type you created click create template. Select the Body and input the variables coming in from the video and subtitle fields you created. You do this by finding a suiteable reference in the variable box, and clicking on the link (the name of the variable) and this imports the variable into the body box. See below examples. Next you need to incorporate these variable in a Player. We are using the JW player, you can use this code as a template.

<script type="text/javascript"> var sa = new SWFObject('/sites/all/modules/swftools/shared/flash_media_player/player-viral.swf ','mpl','470','300','9'); sa.addParam("allowfullscreen","true"); sa.addParam("allowscriptaccess","always"); sa.addParam("seamlesstabbing","true"); sa.addParam("flashvars","file=/upload/corrie.flv&captions.file=/upload/corrie.xml&plugins=caption sa.write('video'); </script>

There are many different ways to do this. For my example I used filefield module to upload the flv file and the srt files. You can then use the filepath of the file field you created. ''print $node->field_subtitlefile2[0]['filepath']'' in the Body of you Content Template set up. This is a working example of the content of a contemplate Body.

<div id="video-player" align="center"><object id="flashvideo" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="450" height="337" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> <param name="movie" value="/sites/all/modules/swftools/shared/flash_media_player/player-viral.swf <param name="wmode" value="window" /> <param name="allowfullscreen" value="true" /> <param name="FlashVars" value="file=http://mule.clearerchannel.org/<?php print $node->field_videosub2[0]['filepath'] ?> &rotatetime=3&autostart=true&plugins=captions-1&captions.file=http://mule.clearerchannel.org/<?ph print $node->field_subtitlefile2[0]['filepath'] ?>" /> <param name="quality" value="high" /> <embed name="flashvideo" allowScriptAccess="always" src="/sites/all/modules/swftools/shared/flash_media_player/player-viral.swf" width="450" height="337" border="0" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="window" allowfullscreen="true" quality="high" flashvars="file=http://mule.clearerchannel.org/<?php print $node->field_videosub2[0]['filepath'] ?> &rotatetime=3&autostart=true&plugins=captions-1&captions.file=http://mule.clearerchannel.org/<?ph print $node->field_subtitlefile2[0]['filepath'] ?>" /> </object><br/></div> <?php print $node->content['body']['#value'] ?>

Changing content template for the Content type

72

Translating
There different aspects to doing translation for Drupal sites. What we need to do is to create a different version of the node for each language. Luckily in Drupal 6 there are good tools for this. To set up the content translation here's the process.

Install following modules


i18n content translation There is detailed help elsewhere for installing language support but here is a brief summary of some of the things you need to enable short form.

Change content type workflow settings


Once you have installed the following modules then make sure you change the following settings in your Content Type settings Workflow settings > Enabled, with translation

Add Languages
At the language page use the Add Lanuage tab to add the languages you need to your site Administer Site configuration >> Language /admin/settings/language Your page might end up looking a bit like this

Translating

73

On the Configure tab of the languages settings page you need to change the value in Language negotiation to ''Path prefix with language fallback''

Adding a new Video and Subtitle data and choosing your language
To add the inicial video and subtitle file click on Add Content in your drupal menu - /node/add . Select the Content type that has been set up to take Video and subtitle files. In this case it's named Video with subtitles

Add Languages

74

Then in your upload form, in the relevant fields, add metadata, upload your video and subtitle files. Make sure to select a language as well.

Click on Save. You should see a page with your published video. Notes: Your site may be set up in a different way, as if you have a link to the Video file (often in an flv format) then you could set up a simple text feed to link to that video file rather than uploading it.

File formats Video: Your video file should be an flv for this installation to make it easy to stream. Subtitle: Your subtitle file should be a in a time coded xml format, or a *.srt format also called SubRip. The file format is a TT Timed Text format. If you need to be able to create this files you may need to use a conversion tool like Subtitle Horse. You can use these files to test it if you need to. You will need to download the subtitle file and install it on your own site as the JW player will only play subtitle files which are on the same server as it. http://subtitle-horse.org/files/pedro3.flv http://subtitle-horse.org/files/example.xml Now when you create your content you need to choose the language from the drop down list next to Language. If you don't do that then the Translate tab won't appear when you have submitted your content, and you won't be able to translate it easily. Also there is the matter of permissions as well. You need to decide what user roles can edit these videos. You may want to set up a Translator role who are allowed to edit all the relevant CCK field you've created and to edit the Content type you've created for this video content type. You may want to look at help on permissions elsewhere. Ideally if your permissions are set up correctly your logged in translators should see a tab to Wiew, Edit or Translate at the top of the content page. Adding a new Video and Subtitle data and choosing your language 75

When clicking on Translate you'll see a list of languages and the option to translate languages that haven't been translated yet.

When you click on Add Translation you go to a page where you can edit the new page that been created. Then you can remove the existing subtitle file and upload a new one of the appropriate language.

File formats

76

Example: Site showing mulingual subtitle support working on Drupal


As part of Drupal_Transmission_Sprint_2009_uk#Subtitles_-_Documentation_and_the_future? the site below was set up to show multilungual subtitles in action Subtitles in Drupal in Action: http://mule.clearerchannel.org/node/279 This page shows an example of using the contemplate module to take a link to a subtitle file and a video file (stored as cck fields in the node) and plug the information from these fields in JWPlayer Using the Core Drupal Translation Module, copies of the original file links and info can then be made and then altered (alternative subtitles links, alternative video link with different audio dub, translated description) for each language selected by this module There is some more information on TT subtitles and how they work with players here. http://www.longtailvideo.com/support/tutorials/Making-Video-Accessible

Example: Site showing mulingual subtitle support working on Drupal

77

You might also like