Video contents with Drupal: my analysis

fax8's picture

Hello everybody,

I thank you for subscribing to this group.
I hope it could be a positive means to share ideas and coordinating
efforts between various people involved in video content modules
development.

Even if I'm one of the most involved people in video development
(with my video module) I'm currently not satisfied by video content
approach used by Drupal.

There are too many modules related to videos which does not share
anything between them. This is bad because we all work again and
again on the same problems: how should I create the correct object
tag? How can I create/add a thumbnails? How can I store metadata with
this video? And so on...

This obviously generate a lot of unnecessary efforts because every
video related module developer has to reinvent the wheel again and
again.

So.. I think we need a shared and accepted approach with videos.
Something which any people involved in video management development
could rely on separating and isolating different pieces of the video
content submission process. This is the main goal of this group which
could define some standardized and shared APIs or approach in
managing video content.

Obviously the first thing to do is analyze and collecting ideas on
how video submission process is made up, in order to get ideas on how
this could be separated.

So.. I start with my analysis trying to put each module I know in
the correct layer. I see three layers of possibly video related
modules:

  1. Low: those are module which manages different low level aspects such as video storing on hd, thumbnailing, automatic metadata reading, etc..
    • video_ffmpeg_helper (Video module package), flashvideo (converting and storing component), media mover, etc..
  2. Interface: modules which are able to understand the informations provided by lower level modules getting data provided, formatting videos (create object tags) and let them available to higer level modules

  • video module ?
  • Presentation: this modules manage interactions with the users, collecting videos and displaying thiem to the end user.
    • videofield (CCK), AcidFree, coolfilter, embed filter, flash filter, flashvideo (filter component), googtube

    My architecture is depicted in the following image:

    Eventually another higer module level is present: Collection. This are module involved in create collections of videos: AcidFree, Playlists etc..

    Ok.. so.. what do you think about this? It is an reasonable analysis?

    Thanks for your inputs,

    Fabio

    www.varesano.net - Fabio Varesano Personal Homepage

  • Groups:
    Login to post comments

    Maybe you can add SWF Tools

    sime's picture
    sime - Fri, 2007-02-16 12:32

    Maybe you can add SWF Tools in there somewhere. SWF Tools is like an API for Flash players and flash replacement.


    That sounds nice.

    ardas - Fri, 2007-02-16 14:48

    That sounds nice.

    I also did a little analysis here http://groups.drupal.org/node/2795 and like your one. You tried to draw almost what I was describing in the article.

    I proposed video thumbnailer and converter can be based on transformer API module and implemented just like imagecache.

    Video filters also sounds clear for me.

    I'm not sure about Video CCK and video node should be presentation layer. Both of them look like video core and will define the way video should be stored.

    By the way, don't you think your approach can be used for audio data as well, not only video? We can expand to "media" instead of just "video".

    Regards,
    Dmitry Kresin, ARDAS group (ARDAS group)


    I think image, audio and

    jbrown's picture
    jbrown - Mon, 2007-02-19 21:51

    I think image, audio and video should all be separate modules. However they should all be able to plug into the media mover module if it is present.

    Perhaps there should be an uber media module that would allow user to [attach / put in a CCK field] media files. The module would then determine which module - image, audio, video or whatever is the correct module to handle each file.


    Media Mover

    arthurf's picture
    arthurf - Fri, 2007-02-16 18:59

    I created Media Mover (which is still in progress, but somewhat functional). It's intention was to cover some of these aspects, but also slightly different ones. In a nutshell, it provides a hook framework to write modules which do some of the following:

    • harvest files (could be from drupal's files table, could be an ftp server, could be email, etc)
    • process files (could be ffmpeg, could be something else)
    • store files (could be s3, could be something else)
    • post process (set a flag, action, etc)

    From doing this work, what I personally think is critical for the drupal video (and audio and images!) community is writing a driver for ffmpeg and having a distribution of ffmpeg that people can easily download that allows for all kinds of process type modules to access. For example, ffmpeg can be used to process audio- useful for creating audio thumbnails, etc. I'm really excited about the ffmpeg helper module and would be great to use this as a basis for all kinds of file processing. Whatever api gets worked out for this module should also be extensible for repurposing.

    In my module, I have options to use ffmpeg's watermarking, file truncation, etc to do some of this work, but this largely duplicates some of the video module's functionality- again, joining forces here is super important!

    Secondarily, there are questions about storage which are perhaps going to be answered by the drupal file system work that has been on going. I'm pretty sure that answers that are relevant for video storage are also going to be useful for other aspects of drupal.

    Additionally, I think the one thing that your (great!) diagram is missing is the harvest aspect- how does video module find its files? Having the ability to integrate ftp servers, email boxes and other content types which may have uploaded content could really make the module have a larger potential usage. This was my intention with having a "harvest" process as part of my module. Of course, this is something that has been important for my projects, so it may or may not be interesting to other people.

    Finally, I think having actions integration is going to be really important so that video files can be processed post upload and/or by different servers. This would help reduce potential load on large video sites.


    Using ffmpeg is a great

    ardas - Sat, 2007-02-17 16:44

    Using ffmpeg is a great idea. I think that the video transformer module which will be a plugin for transformer module should use it for all video transformations. Transformer module isn't completed yet but already working and I saw there were some image transformations already written.

    Regards,
    Dmitry Kresin, ARDAS group (ARDAS group)


    I'm not sure about video

    ardas - Mon, 2007-02-19 15:24

    I'm not sure about video node. Do you think it is required since almost every site needs to extend video node with some fields. The situation looks like in e-commerce package, they created Product type and noone is using it, instead people use CCK to create nodes with various fields and then make a product of them. Nevertheless, ecom guys still support Product node just as a default product - to make e-com package work correctly when there is no CCK installed.

    The problem is CCK isn't still a core:)

    So, probably video node is required...

    Regards,
    Dmitry Kresin, ARDAS group (ARDAS group)


    I think a CCK video field

    jbrown's picture
    jbrown - Mon, 2007-02-19 21:46

    I think a CCK video field should be an unpublished node internally, so the admin can browse them - check for inappropriate content etc.

    When a video that is a field is being viewed as a node it should have a link to the node that the field instance is in.


    This is an interesting idea.

    ardas - Tue, 2007-02-20 12:26

    This is an interesting idea. I would like to understand all advantages and disadvantages of such approach. May be this means that every CCK field (which is not as simple as text or integer) should create an unpublished node for it.

    If it is necessary only for admins to review new content it is better to use any search to get them. For instance CCK can propose a special search for admins to search CCK nodes by fields or something like that.

    Regards,
    Dmitry Kresin, ARDAS group (ARDAS group)


    Sweet Jesus, No.

    eaton's picture
    eaton - Thu, 2007-02-22 16:42

    May be this means that every CCK field (which is not as simple as text or integer) should create an unpublished node for it.

    No, it doesn't.

    The idea of creating invisble nodes in the background to store information has been tried, and doesn't work. Period. The advantage of CCK is that data can be integrated into nodes and stored in a normalized fashion without resorting to ugly hacks like that.

    What you need is a central 'video' module that handles nothing but conversion of/metadata extraction from/formatting of video data. Formatting a video as a flash player, or a clickable link, or a still image taken from its key frame? That's what it can do. A CCK field would expose those various ways of presenting it as formatters. A text filter might expose them as different options, like [video http://www.mysite.com/video.mov flash-player]. An existing module like the current "video" module might simply use one of those formatters as its default presentation.

    That's how APIs work. They do only what they need to do, and other modules can rely on them. The 'make a cloud of nodes' approach is indicative of using an old (but very functional) 4.6 or 4.7 module to do the heavy lifting rather than making an actual API.


    I basically agree with

    mfredrickson - Thu, 2007-02-22 16:50

    I basically agree with Eaton.

    However, if your business rules dictate that you have videos segregated away within their own nodes, you have the tools to do that today:

    Create a node type (e.g. video) that has only 1 field: a video field.
    Add a nodereference field that links to video nodes in any content type that should link to, but not include, a video.

    Drupal offers a lot of flexibility, use it. Let's not force silent, programmatic node creation on people who don't want to go down that route.

    Cheers,
    -M


    I still don't know how I

    fax8's picture
    fax8 - Tue, 2007-02-20 01:31

    I still don't know how I will implement it.... however I'm going to fully support CCK for Drupal 6 when we probably will have it in core.

    www.varesano.net - Fabio Varesano Personal Homepage


    Ber Kessels who is

    ardas - Tue, 2007-02-20 12:23

    Ber Kessels who is supporting flexinode said that Dries still thinks CCK isn't in the state to be taken into core now ... may be later. I don't think it will be a core in Drupal 6 but I hope it will get into the core as soon as possible :)

    Fabio, don't you think we need to build an architecture for all video ideas we have now and draw some kind of road map to understand which modules should be developed and what exactly they should do?

    For instance, I've got a request from other people to insert a flash player they've got from your video.module into my videofield module:) This is of course not a good idea because all video related modules should not do that on their own...

    Regards,
    Dmitry Kresin, ARDAS group (ARDAS group)


    Yes, we should. This is why

    fax8's picture
    fax8 - Wed, 2007-02-21 10:55

    Yes, we should. This is why I started this group... So if you already have ideas on an architecture please explain it to us.

    www.varesano.net - Fabio Varesano Personal Homepage


    I'm working now on

    ardas - Wed, 2007-02-21 12:33

    I'm working now on collecting my thoughts. Unfortunatly, I did see all video related modules in action yet so I need some time to study them and then I'll be able to propose something.

    Regards,
    Dmitry Kresin, ARDAS group (ARDAS group)


    Scalability, Files, Directories, Media and Token Support

    schaub123's picture
    schaub123 - Mon, 2007-03-12 16:54

    One of my major complaints with Drupal and file handling is scalability. Very few of the media upload modules support user based directories for files. Imagefield has some recent support for this. If every module developer could get on board with supporting the token module as an option then we'd be all set. It's very easy to include and would allow things like making sub directories with a uid or maybe the first letter of the username. Then these directories could be spread across different mounted disks/arrays for scalability and performance. There are inode limitations to the number of files in a directory (varies by operating system). Also, a large number of files will greatly reduce performance on file read operations. If you want to run a big media site via drupal, you really can't without hacks because the single folder approach (even divided by three image/audio/video) is not scalable. Also, if you want to see all of one users files you have to do some db hunting or maybe a view. It's very nice to be able to just blow away a user and directory to get rid of offensive content.

    So, how about a standard "best practice" of looking for the "token module" for file uploads? I really wish the core maintainers could get this into upload. It's been hacked in the past and never made it into core. I don't see why, it's pretty basic and necessary if drupal is going to get real with scalability.


    With regard to the

    jbrown's picture
    jbrown - Mon, 2007-03-12 19:22

    With regard to the performance problems of having a large number of files in a directory, creating lots of subdirectories is just a dirty hack. You should use a high performance fileystem like reiserfs, JFS or XFS if you need scalability.

    Of course it does make sense to put files on different disks / servers. In the case of servers you would probably want to generate a url directly to that server as opposed to a local url pointing to a file on an nfs mount.

    Amazon s3 is also very good if you want to outsource it.

    I do agree with having subdirectories for organisational purposes.


    i agree, but ...

    schaub123's picture
    schaub123 - Mon, 2007-03-12 20:23

    I agree that you should go with the best FS for the job. But, 50-100K files in a directory of any sort is tough to debug, manage and will hurt performance at some point (not always immediately obvious). In my experience, a less-than-organized filesystem with thousands of top-level nodes always bites you at somewhere.

    I saw that there were some efforts to add an additional option to the admin/settings page to allow for a "custom" file storage, not just public or private. This would be very cool and allow for things like Amazon S3 etc. I really think this problem should be solved in core somehow, but in the meantime, a module like "token" could do wonders.


    media in general

    schaub123's picture
    schaub123 - Wed, 2007-03-14 13:35

    The mediafield cck module is interesting because it tries to reuse code that is shared between audio and video files. Video and audio share many of the same problems and transformation issues. Flash players etc. It seems to me that CCK will at some point get fully integrated into core, the process has begun. So, why not start your presentation layer with something like mediafield which is quite a bit of the way there as a simple field type for CCK to read getid3 etc. This module could easily support other modules to allow for transformations into other formats like flash. That way these transformations are just plugins. Some folks will want real-time transformation, others will need batch due to volume. The code handlilng the submitted data needs to know whether to call a real-time or batch process. This could be done via a plugin module. Have a default behaviour which saves the file, no transformation which can be extended via modules. The mediafield settings page could allow options for tranformation plugins. Also for display plugins. Should this data be displayed using the "acmeflash player" or whatever. Hey, i like acmeflash! Anyway ...

    I like media mover and think it could be broken into a smaller plugin module for large sites that need batch processing. I'd still separate out the storage into a more general feature for Drupal as a whole. Maybe this storage issue needs to be started like CCK -- get it working as a module and then impress the core developers to integrate it into core? Storage is such a basic function that I think many are scared to use a custom solution outside of core since it could go unmaintained and then you're left on an island in terms of fixes, upgrades etc. There are a number of storage mechanisms that have come and gone, sadly.


    Drupal 6 and file storage

    arthurf's picture
    arthurf - Wed, 2007-06-06 04:59

    There are some improvements as to how files are handled in Drupal 6 which may address some of these concerns. In the meantime, I'm trying to make some improvements to media mover so that it is more useful for more people. I should be releasing an email harvesting module that was recently written by another person and a save as a node storage option in the near future.

    Big picture, i think the major thing is that everybody who is developing video stuff ultimately runs into is needing FFmpeg. I think if other people are interested, we should work on developing a FFmpeg module which provides an API that all the developers can use. I know that media mover doesn't meet everybody's need (heck, it barely meets mine) but I do know that it sure would have been easier to write if the basic FFmpeg functionality was already written. I've recently written some functions that check what codecs are installed, what file types are supported, etc.

    Would anybody else be interested in this? I could abstract out some of the stuff from my work if other people are interested in collaborating.


    I'm not strong in the

    sime's picture
    sime - Wed, 2007-06-06 11:41

    I'm not strong in the ffmpeg/filesystem way, so these questions arise out of a desire to be less ignorant.

    I think if other people are interested, we should work on developing a FFmpeg module which provides an API that all the developers can use

    I've always assumed the video module did this.

    Would anybody else be interested in this? I could abstract out some of the stuff from my work if other people are interested in collaborating.

    Have you had a look at Transformer? I'm interested in people's experience with that module.