As most of you know, Wordpress released the video framework plugin that powers their new Videopress website. I’ve used the installation instructions on a server running CentOS and also on a server running Ubuntu. Below are the steps I took to get the awesome plugin implemented. However, your installation of FFMPEG may be different according to what kind of Linux Distro you are using.
To install FFMPEG on CentOS, you will need to follow the instructions posted here: http://www.php-architect.com/blog/2008/07/01/installing-ffmpeg-php-on-centos-5/
To install FFMPEG on Ubuntu, you can follow the installation instructions found in the wordpress video framework package or follow the installation instructions above. Either way, I suggest installing the ffmpeg and ffmpeg-php packages from above, as well as the current snapshot of x264.
However, there is one caveat. You can follow both the instructions above up until you get to the x264 and FFMPEG install. In order to get it working on my servers, I had to make some adjustments. In the installation instructions, you are supposed to configure x264 and FFMPEG with –enable-shared. By doing so, you will need to run the command /sbin/ldconfig, which is stated in the instructions. However, for my installs, that doesn’t work. So what I did is use the following config without the –enable-shared:
For x264, I used: ./configure –enable-pthread –prefix=/usr && make && make install
For ffmpeg, I used: ./configure –enable-gpl –enable-postproc –enable-nonfree –enable-postproc –enable-libfaad –enable-avfilter –enable-pthreads –enable-libx264 –enable-libmp3lame –enable-libfaac –disable-ffserver –disable-ffplay –enable-libtheora –prefix=/usr && make && make install
Then I did the following from the instructions without the /sbin/fdconfig command.
echo “/usr/local/lib” >> /etc/ld.so.conf
make tools/qt-faststart
mv tools/qt-faststart /usr/bin
Now, because I am using WPMU, the files as is do not work for me. I needed to figure out a way for other users to basically have their own transcoding and file servers because when users tried to upload a video file, they were denied because of permissions. So, I had to change some things so that subdomain.example.com would be the beginning url for the user’s file server and transcoding server. In video-lib.php, I had to change this:
/** * choose a file server that is live * CUSTOMIZE: add your own logic if there are multiple file servers */ function pick_fileserver( $dc = 'your_data_center' ) { return 'http://myfileserver.com'; } /** * choose a transcoder that is live * CUSTOMIZE: add your own logic if there are multiple transcoders */ function pick_transcoder( $dc = 'your_data_center' ) { return 'http://mytranscoder.com'; }
to this:
/** * choose a file server that is live * CUSTOMIZE: add your own logic if there are multiple file servers */ function pick_fileserver( $dc = 'your_data_center' ) { $fileserver = get_option('siteurl'); return $fileserver; } /** * choose a transcoder that is live * CUSTOMIZE: add your own logic if there are multiple transcoders */ function pick_transcoder( $dc = 'your_data_center') { $transcoder = WP_PLUGIN_URL . "/video/video-transcoder.php"; return $transcoder; }
Then at the of that file, I place a require line like so: require(‘/var/www/example.com/web/wp-config.php’);. Lastly, I needed some changes done to the video-xml.php file, so that the video information can be retrieved from each user’s blog. Instead of posting the changes, I have included the file for download (the code above and this file was contributed by ddmitry at the WPMU forums. Once you do the above as well as make the necessary changes in the files, then you and your users should be all set with uploaded videos to be transcoded. As mentioned by Hailin, this is not a regular plugin, so there is no backend. Just upload the video and that is it.
One more thing I should mention. When you use the command “php php video-verify-ffmpeg.php,” there is a line that you must pay particular issue to when the command runs. The line that I am speaking of is
Stream #0.0(eng): Video: wmv3, yuv420p, 320x240, 198 kb/s, 29.97 tbr, 1k tbn, 1k tbc
My server setup is different, and the above line does not match what video-transcoder.php is looking. This file is looking for “tb/r” or something like that, but my line output is “tbr”. So, in that file, I had to change this line:
if ( preg_match( '/Stream.*Video:.* (\d+)x(\d+).* (\d+\.\d+) tb\(r\)$/', $line, $matches ) ) {
to this:
if ( preg_match( '/Stream.*Video:.* (\d+)x(\d+).* (\d+\.\d+) tbr/', $line, $matches ) ) {
If you don’t change the line to match the output, then you will get a transcoding error. I hope that this will help you. Please excuse the way that things are written. I promised a couple of people that I would get this up as soon as possible, so this is a working document, which means, things will need to be changed and or updated according to what questions people may have. When writing a post like this, you always miss a step or two. If you have any questions, please feel free to comment below; I will be checking often. Also, this is a new server, if you have any issues with accessing my site or it seems slow, please let me know.
Need help installing the Wordpress Video Solution Framework plugin, hire me?
Tags: ffmpeg, videopress, x264
September 1st, 2009 @ 2:43 pm
Thank you for the writeup it is very clear and concise. It will be interesting to follow this framework to see if automatic extends it to utilize flash comm servers for true streaming.
The fact that they are not using flash servers to stream the video’s really surprises me especially for a company the size of wordpress. I do understand that it would require a lot of work to utilize flash comm for the output, but the benefits are far superior to progressive streaming.
1. The user can ff/rw to any part of the video instantly. No more waiting for the entire video to load. = Vastly improved user experience
2. It saves huge amounts of bandwidth for the provider as most people don’t want the entire video’s. Only has to stream what is being requested. = We currently serve up thousands of 1-2 hour video’s and by utilizing the flash comm servers our bw bills have dropped significantly mainly because the viewer seems to skip around a lot most of the time not viewing the entire video, with progressive the entire file has to be sent
3. It allows bit level transfer monitoring. Means we can provide incredibly advanced stats to the user. Meaning we can tell the site owner not only how many views, but total bw used, and exactly how long each video is watched on avg.
4. Allows the customer the ability to pre/mid/post insert either txt/jpg/flv video adds with complete tracking.
Really I could go on and on about the benefits of using flash comm for the output. Here’s hoping that they see the light and add this capability
September 1st, 2009 @ 3:05 pm
Thanks shawn for the comments. I am sure that they are working on extending the plugins functionality. As with all of their babies (akismet, poll daddy, etc), they always make it better over time. Moreover, the great thing about this framework is that it can be extended.
September 2nd, 2009 @ 9:45 pm
Hi Josh,
I don’t know if you remember me or not but I spoke with you in this wpmu premium thread: http://premium.wpmudev.org/forums/topic/help-installing-wordpress-video-solution-framework
We have managed to fully install the multiple servers with 1 serving as the video transcoder. What we need help with is simply editing the plugin files to work with our system. We have some money set aside to finish this project and would appreciate your paid help to finish it.
if you can contact us at tech-n-design@hpcareer.net or admin@idwellness.com or me directly at rohan@rohan-kapoor.com it would be appreciated.
Thanks,
Rohan Kapoor,
On behalf of hpcareer.net
September 12th, 2009 @ 7:19 pm
I posted my build notes for the new 1.0 release and in particular building FFMPEG:
http://randomsilicon.blogspot.com
(I know, embarrassing that it’s not on WP yet)
Also, I am interested in what other enhancements people want:
http://randomsilicon.blogspot.com/2009/09/vote-on-wordpress-video-features.html
Robert´s last blog ..Vote on Wordpress Video features
September 14th, 2009 @ 6:58 am
Thanks, Robert.
November 23rd, 2009 @ 9:29 am
Hi Josh, how are you? I need some help with Wordpress Video Solution Framewkr, you can help-me? How much you need to install that on my server? The ffmpeg and the other server stuffs are alredy installed. The problem is with the integration with Wordpress MU.
P.S: The comments of your site is not working well.
November 30th, 2009 @ 12:00 am
Thank you for sharing.. I will be downloading this cool plug in.. sure it will be usefull for my sites..
Thanks!
December 1st, 2009 @ 6:33 pm
[...] the near future, I plan to implement a more complete video blogging solution- but for now, it’s good to have the ability in [...]
December 14th, 2009 @ 11:22 pm
Hello, Marcos. Let me know if you still need help with the plugin.
February 11th, 2010 @ 5:47 pm
Yes. I really need your help. Plese, send-me a e-mail.