The MU forums have moved to

1 2 3

WordPress Video Solution Framework for WPMU (78 posts)

  1. politicalbear
    Posted 14 years ago #

    This sounds like a great plugin:

    Has anyone implemented it? Can anyone post a screencast on how to implement?

    Here are the steps.... not exactly plug and play, but it could be a great feature.

    Create database and table named "videos", which is used to store individual video meta information.

    Videos table definition

    CREATE TABLE videos (
    guid varchar(32) NOT NULL default '',
    domain varchar(200) default NULL,
    blog_id bigint(20) NOT NULL default '0',
    post_id bigint(20) NOT NULL default '0',
    path varchar(255) NOT NULL default '',
    date_gmt datetime default '0000-00-00 00:00:00',
    finish_date_gmt varchar(24) default '0000-00-00 00:00:00' COMMENT 'job finish time',
    duration varchar(10) default NULL COMMENT 'video length',
    width int(11) default NULL COMMENT 'original width',
    height int(11) default NULL COMMENT 'original height',
    dc varchar(5) default 'dfw' COMMENT 'originating dc',
    flv varchar(50) default NULL COMMENT 'status of flv format',
    fmt_std varchar(50) default NULL,
    fmt_dvd varchar(50) default NULL,
    fmt_hd varchar(50) default NULL,
    display_embed tinyint(4) NOT NULL default '1',
    PRIMARY KEY (blog_id,post_id),
    UNIQUE KEY guid (guid),
    KEY date_gmt (date_gmt)

    Configure video transcoder with ffmpeg and other tools.
    A sample configuration script is attached (

    Figure out your file serving infrastructure and file serving url schemes,
    and modify the code to reflect that. The places where you need to modify are marked "CUSTOMIZE".

    Copy files in mu-plugins/ to wp-content/mu-plugins; and copy files in plugins/video/ to wp-content/ plugins/video/

    It is an entire video solution, and we've spent months developing it,
    so naturally it will take you some time to test and tailor it to your system.


  2. andrea_r
    Posted 14 years ago #

    Well, we're still figuring it out, if that gives you an idea of how complicated it is to setup. :D

  3. tdjcbe
    Posted 14 years ago #

    Could always roll your own if you have the processor power to spare:

  4. tdjcbe
    Posted 14 years ago #

    Also note that Andrea has a post about it on her tutorial site. Nothing major but just wanted to point out that it was being discussed:

  5. Trent
    Posted 14 years ago #

    I have phpmotion running now and tried another video solution successfully and still can't seem to figure this one out either. I had it to the point I thought it was working, but still failing. I would imagine it has something to do with either the way I setup the "file server" or the "transcoder" URL's. Not 100% sure what to do with it to be honest.

    If anyone wants to compare notes when they get it working, I would be glad to hear it as well! If I manage to stumble upon it, I will share for sure.

  6. politicalbear
    Posted 14 years ago #

    @andrea if you and your code monkey :) are still trying to figure it out.... then yes, I understand how hard it is.

  7. ddmitry
    Posted 14 years ago #

    Thanks for this framework. Can I ask some questions about it there (or please give me point where I can ask) ? :)
    So, after uploading media (videofile) we've see errors produced by function video_get_filesize from server/mu-plugins/video.php who looking for table 'file_log' with at least two colums - 'bytes' and 'md5_path'. I cannot find in code table definition nor who is inserting rows in this table. Who is writing to this table or this function can be rewritten (for singleserver installation) with just looking for size of file produced ffmpeg ?

  8. andrea_r
    Posted 14 years ago #

    we're still working on getting it running. there's no docs other that the code itself. a lot of it is dependent on your server setup.

    It really wasn't meant to be a fully functional system out of the box.

  9. ddmitry
    Posted 14 years ago #

    andrea_r: So, video framework code not so big, clean and readable and have comments.

    Btw - people from Automattic reading this ? As I googled, Barry Abrahamson probably can give us some answers :)

  10. ddmitry
    Posted 14 years ago #

    So, I have some progress - upload, transcoder and finaltouch works ok with minor code hacks. Only thing left to do - embedding player into page. Will keep you informed :)

  11. Trent
    Posted 14 years ago #

    Would love to hear how you configured things to work! I am a little stumped on it.


  12. ddmitry
    Posted 14 years ago #

    Trent: Now I'm working on code in "sandbox". I'm planned to cleanup code for singleserver configuration and publish it of course with little instructions.

    By the way - flash player also need to be recompiled because it have hardcoded urls and probably something else. So prepare your flash cs3 :)

  13. dada44
    Posted 14 years ago #

    Hi all,

    I will expend the time later to go through this wonderful solution but right now I just need it to play the videos and change the size of the player.
    Does anyone know where can I change the size of the player?
    And most important, it is playing the videos I've uploaded to the clips folder, but it is not playing (sorry, the video is not currently available) remote videos.
    I thought that entering the url to the remote video in the video.xml (in between <movie_file></movie_file>) would do, but it does not work.
    Then in I've found:
    public static var IS_LOCAL_MODE:Boolean = true;
    I've turned it into false but it does not work anyway ..

    Any ideas? Something I can do?

    Thanks in advance!

  14. ddmitry
    Posted 14 years ago #

    In local mode player looking for hardcoded directory "clips" and xml "clips/video.xml". So I'm not sure right now that you can play in "local mode" remotely located videos.

    If you looking for only for flash player for your wordpress, try other solutuins (for example - flash video player). It will be a much much easy way, trust me :)

    Video Framework is not "fire and forget" plugin like others WP plugins - its complex but not ready for production right now videohosting solution.

  15. lunabyte
    Posted 14 years ago #

    You may need to look into adobe flash and crossdomain access. Not sure if it would apply to your situation, but it may be worth a look.

  16. gpo1
    Posted 14 years ago #

    A bit confussed,what does it do? Is it like hosting videos like youtube or phpmotion for wordpress mu or what?

  17. ddmitry
    Posted 14 years ago #

    gpo1: yep, this is like youtube/phpmotion etc, but embedded to wordpress mu.

    Btw people: I have up and running it all - with trascoder and player ! :)

  18. gpo1
    Posted 14 years ago #

    ddmitry, can you to give step by step guide of how to install this?
    And can any user upload videos to your site like youtube.
    please show demo site?

  19. ddmitry
    Posted 14 years ago #

    gpo1: Yes, I will. Site with installed plugin can be viewed by clicking on my login at left (russian/ukrainian language site).

    Guide will be ready later (within day or two) - right now I'm goin to sleep, 0:30 in Kharkov Ukraine :)

  20. hailin
    Posted 14 years ago #

    Some updates on the plug-in:

    1. Merged in new video code.
    1. Added screenshot section that contains video architecture diagram.
    2. Added server/setup directory which contains detailed step-by-step instruction to set up video transcoder, and a test script to verify the setup.
    3. Extended the installation section.
    4. Added a new section “URL structure” which describes the details of URL transformation in step-by-step manner.
    5. Added FAQ section.

    Please check it out again and let us know if you have any question or feedback

  21. ddmitry
    Posted 14 years ago #

    hailin: As I see (I'm right ?) in "new" version is nothing important changed. Just more extended readme and so on.

    You do not specify in docs or I didn't find about player: player NEED to be recompiled. This is important step and without it player will be unusable.

  22. Trent
    Posted 14 years ago #

    Thanks Hailin. That might be enough to get me through to the next step on this one :)


  23. ddmitry
    Posted 14 years ago #

    Ok, here the tarball of modified framework (download over http/over ftp). Code modified for singleserver installation.

    NOTE: do not try it on production site - this is not release, even this is not regular plugin.

    Little guide:

    1) Compile/install ffmpeg with options (faac/faad/lame etc). This is easy step.
    2) Extract tarball to tmp directory. CHECK PATHNAMES (tmp directory specified in plugins/video/video-transcoder.php, ffmpeg binary and qt-faststart locations etc).
    3) Copy/move files to you wpmu directory. Copy crossdomain.xml to root of your webserver if you allow embedding player to other sites.
    4) Download original plugin, extract archive and look at player. You need to find (look at svn). Change XML_URL_BASE to your domain name (i.e. myblog.tld), rest of URL must be the same (http://myblog.tld/wp-content/plugins/video/video-xml.php), recompile player and copy wpp.swf to wp-content/plugins/video/. Player source is not included in my tar.gz.
    5) Place crossdomain.xml to your site root if you allow embedding your videos to other websites.

    Try to upload videofile and look what happend. Look at php's errorlog for some debug messages (I do not comment error_log calls in code and added some).

    This framework after little modification can work on not-mu wordpress and can work on windows with some limitations (major limitation that you will need proper ffmpeg build with all needed libs - its not easy :) )

    Ask me questions.


  24. gpo1
    Posted 14 years ago #

    ddmitry, Can you adapt it for a buddypress plugin?

  25. james4cees
    Posted 14 years ago #

    I went ahead and starting compiling the video framework and got as far as the last step in the transcoder section, when compiling qt-faststart I get the error

    make tools/qt-faststart
    mv tools/qt-faststart /usr/bin

    Error I get is
    tools/qt-faststart.c: In function ‘main’:
    tools/qt-faststart.c:133: warning: format ‘%llX’ expects type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’
    tools/qt-faststart.c:174: warning: format ‘%llX’ expects type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’

    I can run qt-faststart and asks for input out put etc... however when I run the test script it craps out with an error

    FFmpeg version SVN-r13780, Copyright (c) 2000-2008 Fabrice Bellard, et al.
    configuration: --enable-gpl --enable-postproc --enable-pthreads --enable-libvorbis --enable-liba52 --enable-libgsm --enable-libmp3lame --enable-libdc1394 --disable-debug --enable-shared --prefix=/usr --enable-libfaad --enable-libfaac --enable-libx264
    libavutil version: 49.7.0
    libavcodec version: 51.57.2
    libavformat version: 52.16.0
    libavdevice version: 52.0.0
    built on Feb 7 2009 19:32:14, gcc: 4.1.2 20071124 (Red Hat 4.1.2-42)

    Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 29.97 (30000/1001)
    Input #0, asf, from '/tmp/baby_1234':
    Duration: 00:00:07.70, start: 5.000000, bitrate: 369 kb/s
    Stream #0.0: Video: wmv3, yuv420p, 320x240, 198 kb/s, 29.97 tb(r)
    Stream #0.1: Audio: wmav2, 44100 Hz, stereo, 48 kb/s
    Output #0, mp4, to '/tmp/baby_1234_temp.mp4':
    Stream #0.0: Video: libx264, yuv420p, 400x300, q=5-51, 668 kb/s, 29.97 tb(c)
    Stream #0.1: Audio: libfaac, 48000 Hz, stereo, 64 kb/s
    Stream mapping:
    Stream #0.0 -> #0.0
    Stream #0.1 -> #0.1
    [libx264 @ 0x2b2d95245ae0]width or height not divisible by 16 (400x300), compression will suffer. can not be transcoded into h.264, ffmpeg issue???

    anyone offer any advice, I seem pretty close apart from this qt-faststart stumble... thanks in advance..

    I have tested ffmpeg and it transcodes the file fine, I didnt have errors in the other 7 steps...

    any guidance appreciated...

  26. hailin
    Posted 14 years ago #

    We added a few more functions in video.php and included support for video ratings.

    I just added trunk/server/plugin/video/flvplayer.swf to svn so that you don't need to copy the one (wpp.swf) from the player/ directory. (so please 'svn update' or download the pacakge again)

    You shouldn't need to recompile the player. However, if you want to change it, you can recompile it in player/ directory and copy wpp.swf to plugin/video/flvplayer.swf

  27. hailin
    Posted 14 years ago #

    qt-faststart is required to post-process h.264 video,
    it appears it is not compiled correctly on your system.
    You can try searching for hints given your error messgae on your system.

  28. hailin
    Posted 14 years ago #

    video_get_filesize() is tied to our internal system which keep track of how big a file is. You can safely ignore it.

    Regarding recompiling the player - current player takes in guid as parameter, and does all the magic internally by querying for video XML info. Currently you need to change that url in actionscript code to: (where that file is located in your system). Then recompile it to produce wpp.swf, then copy wpp.swf to wp-content/plugins/video/flvplayer.swf

    We will make this configurable soon.

  29. ddmitry
    Posted 14 years ago #

    hailin: Glad to see that you added readme with useful hints. Framework now (as I see) is more simple to install.

    Btw: do you remove from code multi-db functions (wpdb->send_reads_to_masters or similar call, that not exist in 'base' MU) ?

  30. ddmitry
    Posted 14 years ago #

    hailin: I know about player, have spent few hours with flash. You probaby can simply specify video-xml.php url in parameter in rewrite rule in your htaccess. (i.e. bla-bla/video-xml.php?guid=12345&

    Think you know it better than me :)

1 2 3

About this Topic

  • Started 14 years ago by politicalbear
  • Latest reply from dbcohen