Professional Documents
Culture Documents
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.
When you have registered and have been approved (if this is how the site is set up) then you are free to add 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.
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.
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.
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.
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
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.
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.
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.
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).
15
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.
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.
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.
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.
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.
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
20
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.
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
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.
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
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.
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.
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.
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.
28
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
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.
30
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'.
32
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.
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.
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.
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).
35
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.
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.
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.
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
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.
41
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
42
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
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.
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
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.
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
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.
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.
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.
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.
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.
52
53
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.
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.
57
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.
58
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.
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
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
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.
62
63
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.
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.
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
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
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
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
70
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.
71
<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'] ?>
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.
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
77