Differences from version 2 to 19



@@ -1,148 +1,198 @@

 {maketoc}
-The flv plugin is a video handler for treasury. it will convert videos of various formats including avi, mpg, mov and more to flashvideo and allowing you to conveniently view the converted video from within your browser. A site that uses a similar process is [http://www.youtube.com|youtube].
 
+The flv plugin is a video handler for Liberty. It will convert videos of various formats including .avi, .mpg, .mov and more to flashvideo and allows you to conveniently view the converted video from within your browser. A site that uses a similar process is [http://www.youtube.com|youtube].
 
-! Installtion
-The flv plugin for treasury is quite sophisticated. You need to install software on the server (you might even have to compile some binaries yourself), optionally install some php extension and install or activate a few files in bitweaver. if you are not prepared to do this, there isn't much point in reading on.
 
-The conversion process can be lengthy and therefore it is possible to run the conversion using a cron job. The cron php file is already present and all that needs to be done is add the appropriate cron job to your cron file, set the cron option in treasury and everything is set. This plugin also requires a recent version of [http://ffmpeg.mplayerhq.hu|ffmpeg]. In fact, you need to compile the svn version of ffmpeg as other versions don't support conversion to .flv files (luckily, gentoo users only need to emerge --sync and compile the regular version of ffmpeg...).
+! Installation
+The flv plugin for Liberty is quite sophisticated. You need to install software on your server (you might even have to compile some binaries yourself), optionally install some PHP extension and install or activate a few files in bitweaver.
+
+The conversion process can be lengthy and therefore it is possible to run the conversion using a cron job. The cron PHP file is already present and all that needs to be done is add the appropriate cron job to your cron file, and set the cron option in Liberty. This plugin also requires a recent version of [http://ffmpeg.mplayerhq.hu|ffmpeg]. In fact, you need to compile the SVN version of ffmpeg as other versions don't support conversion to .flv files (luckily, gentoo users only need to emerge --sync and compile the regular version of ffmpeg).
 
 The plugin also supports the use of [http://ffmpeg-php.sourceforge.net/|ffmpeg-php]. This extension is __not__ required but will enable bitweaver to extract video information such as video duration and other useless but handy information to improve processing and therefor final result.
 
 Example of [http://fca.at/wiki/Grundkurs|serverside converted videos]
 
-{code source=PHP title="taken from treasury/cron.flv.php"}
-/* ================================= FFMPEG =================================
-If you want to make use of the flv plugin, you need to install the svn version
-of ffmpeg. only the latest version of ffmpeg supports the flv format.
+!! ffmpeg (required)
+You can find some more help in liberty/plugins/cron.flv.php
 
+If you want to make use of the flv plugin, you need to install the SVN version of ffmpeg. Only the latest version of ffmpeg supports the .flv format. Your distribution might already include a version that supports .flv.
 
---- INSTALL
-You will need the svn version of ffmpeg and you will have to compile this
-yourself:
+!!! Install
+You will need the SVN version of ffmpeg and you will have to compile this yourself:
 
-svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
-cd ffmpeg
-./configure --help | grep enable
-./configure --enable-mp3lame --enable-gpl
-make
-make install
+Some distros as examples:
+!!!! Gentoo
+ffmpeg and available USE flags
+X, a52, aac, altivec, amr, debug, doc, dts, encode, ieee1394, imlib, mmx, network, ogg, oss, sdl, test, theora, threads, truetype, v4l, vorbis, x264, xvid, zlib
+adjust USE flags as you wish. install using something like:
+{code}USE="a52 aac altivec amr dts encode mmx ogg oss theora vorbis x264 xvid"; emerge -av ffmpeg{/code}
+This will give you support for most audio and video codecs supported by the use flags. If the version of ffmpeg in portage is not recent enough for you, you can try installing ffmpeg from the berkano overlay.
 
+!!!! Ubuntu
+* [http://blogger.rukker.org/2007/01/29/enable-mp3-and-amr-support-in-ffmpeg-ubuntu-edgy-eft/|Ubuntu - ffmpeg install instructions]
 
---- NOTE
-Depending on the system, you might be able to support more formats. These are
-the configure flags i used:
-./configure --enable-mp3lame --enable-gpl --enable-a52 --enable-libogg \
---enable-vorbis --enable-xvid
+!!!! Fedora Core 6
+at the time of writing this, the version in livna was faulty - i used the one in freshrpms:
+{code source=Bash}
+# rpm -ihv http://ayo.freshrpms.net/fedora/linux/6/i386/RPMS.freshrpms/freshrpms-release-1.1-1.fc.noarch.rpm
+# yum install ffmpeg
+{/code}
 
+!!!! Generic instructions getting ffmpeg from svn for Linux
+{code source=Bash}
+$ svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
+$ cd ffmpeg
+$ ./configure --help | grep enable
+$ ./configure --enable-libmp3lame --enable-gpl
+$ make
+# make install
+{/code}
 
---- CRON
-Processing video files can take a while and this process is therefore designed
-as a cron job. Set up a cron job similar to the following. This will check for
-open conversion jobs every minute:
+^Depending on the system, you might be able to support more formats.
+./configure --enable-mp3lame --enable-gpl --enable-a52 --enable-libogg --enable-vorbis --enable-xvid^
+
+!!!! Windows using binary builds
+[http://ffmpeg.arrozcru.org/wiki/index.php?title=Links|Links to various pages relating to using ffmpeg on Windows] but it lacks information on use with php.
+[http://ffmpeg.arrozcru.org/builds|Unofficial Win32 Builds] provides a complete package that can be used with windows. It's not been fully tested as yet, but does seem to be functioning the same as the Linux builds.
+It seems that everybody is having problems with a windows binary for php, but a current set of notes can be [http://blog.halomede.com/2009/03/ffmpeg-php-installation-on-windows.html|found here]. This references a rather large download for the php_ffmpeg files, [http://sergey89.ru/files/ffmpeg-php/ffmpeg-php-win32-all.zip|but the relevant files are available here] and at some point, a package similar to the PEAR compilation is available on the bitweaver archive {attachment id=997}.
+Apart from the php_ffmpeg.dll, for convenience the rest of the files are best copied to \WINDOWS\System32\ directory. See the ((Windows installation notes)) page for more details of location files in Windows.
+
+!!! Setting up cron jobs
+Processing video files can take a while and this process is therefore designed as a cron job. Set up a cron job similar to the following. This will check for open conversion jobs every minute:
+{code source=Bash}
 * * * * * apache /path/to/php -q /path/to/cron.flv.php [number of videos to process] >> /path/to/log/file.log
-NOTE
-- make sure apache is your apache user - you can check the 'User' setting in
- your apache.conf file (usually located at /etc/apache2/httpd.conf)
-- [number of videos to process] is optional, default is 3
+{/code}
+* make sure apache is your apache user - you can check the 'User' setting in your apache.conf file (usually located at /etc/apache2/httpd.conf)
+* [number of videos to process] is optional, default is 3
 
+( ~~red:Need to add notes on handling cron jobs on windows~~ )
 
-================================= FFMPEG-PHP =================================
---- THIS EXTENSION IS NOT REQUIRED
-ffmpeg-php is a php extension that makes it possible to easily access video
-information from within php. Please view the official site on how to add
-ffmpeg-php to your php setup: http://ffmpeg-php.sourceforge.net
+!! ffmpeg-php (optional)
+ffmpeg-php is a php extension that makes it possible to easily access video information from within php. Please view the official site on how to add ffmpeg-php to your php setup: http://ffmpeg-php.sourceforge.net
 
-all it allows us to do is check the aspect ratio and video length. This allows
-us to extract more appropriate video images and make more accurate conversions.
+All it allows us to do is check the aspect ratio and video length. This allows us to extract more appropriate video images and make more accurate conversions.
 
-If you compile it as an extension, it should be recognised by this script. If
-you decide to compile it into your php, please modify the script below where it
-says:
+If you compile it as an extension, it should be recognised by this script. If you decide to compile it into your php, please modify the plugin where it says:
+{code source=PHP title="Modification required if ffmpeg has been compiled as part of PHP"}
 if( extension_loaded( 'ffmpeg' )) {
 }
-*/
 {/code}
 
 
 ! Plugins
-Once the software is in place you need to make sure the flv plugin is active in the treasury plugin admin screen. As soon as this is active some plugin specific options will appear. Please see [#PluginSettings|below] for details.
-To make full use of treasury related attachments in wiki pages in general, make sure you activate the __treasury storage plugin__ and the __flashvideo data plugin__ in the liberty plugins admin page as well.
+Once the software is in place you need to make sure the flv plugin is active in the Liberty plugin admin screen. Please make sure you visit the plugin settings screen by clicking on the edit icon.
 
 
 ! Plugin settings
-In the treasury plugin admin screen there are a few flv-specific options you can set. Please make sure that the suggested path to ffmpeg is correct. without this no videos will be converted. The video and audio settings are basically: the higher the better the quality but also the larger the download.
+In the Liberty plugin admin screen there are a few flv-specific options you can set. Please make sure that the suggested path to ffmpeg is correct. Without this no videos will be converted. The video and audio settings are basically: the higher the better the quality but also the larger the download.
 
 !! Video conversion results
-Here are some basic tests i made using a 600 second high quality divx film.
-||~ Video rate | Audio rate | Video size | File size | Encoding time | Recommended
-11025 | 16 | 240x136 | 16862250 (17M) | 76 |
-11025 | 16 | 320x180 | 16882052 (17M) | 95 |
-11025 | 16 | 480x270 | 17036850 (17M) | 134 |
-11025 | 16 | 640x360 | 23841898 (23M) | 189 |
-11025 | 32 | 240x136 | 18067121 (18M) | 77 |
-11025 | 32 | 320x180 | 18086923 (18M) | 99 |
-11025 | 32 | 480x270 | 18241721 (18M) | 139 |
-11025 | 32 | 640x360 | 25046769 (24M) | 195 |
-11025 | 64 | 240x136 | 20476865 (20M) | 73 |
-11025 | 64 | 320x180 | 20496667 (20M) | 90 |
-11025 | 64 | 480x270 | 20651465 (20M) | 130 |
-11025 | 64 | 640x360 | 27456513 (27M) | 191 |
-22050 | 16 | 240x136 | 17046610 (17M) | 81 |
-22050 | 16 | 320x180 | 17066412 (17M) | 99 |
-22050 | 16 | 480x270 | 17221210 (17M) | 139 |
-22050 | 16 | 640x360 | 24026258 (23M) | 214 |
-22050 | 32 | 240x136 | 18251377 (18M) | 91 |
-22050 | 32 | 320x180 | 18271179 (18M) | 106 | *****
-22050 | 32 | 480x270 | 18425977 (18M) | 151 | ****
-22050 | 32 | 640x360 | 25231025 (25M) | 202 |
-22050 | 64 | 240x136 | 20660911 (20M) | 86 |
-22050 | 64 | 320x180 | 20680713 (20M) | 101 |
-22050 | 64 | 480x270 | 20835511 (20M) | 142 |
-22050 | 64 | 640x360 | 27640559 (27M) | 200 |
-44100 | 16 | 240x136 | 0 ( 0) | 0 |
-44100 | 16 | 320x180 | 0 ( 0) | 0 |
-44100 | 16 | 480x270 | 0 ( 0) | 0 |
-44100 | 16 | 640x360 | 0 ( 0) | 0 |
-44100 | 32 | 240x136 | 18251256 (18M) | 100 |
-44100 | 32 | 320x180 | 18271058 (18M) | 114 |
-44100 | 32 | 480x270 | 18425856 (18M) | 156 |
-44100 | 32 | 640x360 | 25230904 (25M) | 213 |
-44100 | 64 | 240x136 | 20660686 (20M) | 110 |
-44100 | 64 | 320x180 | 20680488 (20M) | 127 | ****
-44100 | 64 | 480x270 | 20835286 (20M) | 174 | ***
-44100 | 64 | 640x360 | 27640334 (27M) | 234 | ||
+Here are some basic tests i made using a 60 second high quality divx film. I only include 2 bitrates and I've removed a few sizes to reduce table size.
+{| style="text-align:right;"
+|+ Video conversion results
+! Video bitrate (bits/s)
+! Audio bitrate (bits/s)
+! Audio samplerate (Hz)
+! Video size (pixel x pixel)
+! File size (bytes)
+! Encoding time (s)
+|-
+| 200 || 32 || 22050 || 320x180 || 1724 (1.7M) || 10
+|-
+| 200 || 32 || 22050 || 480x270 || 1820 (1.8M) || 15
+|-
+| 200 || 32 || 22050 || 640x360 || 2128 (2.1M) || 22
+|-
+| 200 || 32 || 44100 || 320x180 || 2148 (2.1M) || 13
+|-
+| 200 || 32 || 44100 || 480x270 || 2244 (2.2M) || 17
+|-
+| 200 || 32 || 44100 || 640x360 || 2552 (2.5M) || 22
+|- style="font-weight:bold; color:#331100; background:#ffffcc;"
+| 200 || 64 || 22050 || 320x180 || 1724 (1.7M) || 10
+|-
+| 200 || 64 || 22050 || 480x270 || 1820 (1.8M) || 16
+|-
+| 200 || 64 || 22050 || 640x360 || 2128 (2.1M) || 20
+|-
+| 200 || 64 || 44100 || 320x180 || 2148 (2.1M) || 12
+|-
+| 200 || 64 || 44100 || 480x270 || 2244 (2.2M) || 17
+|-
+| 200 || 64 || 44100 || 640x360 || 2552 (2.5M) || 23
+|-
+| 400 || 32 || 22050 || 320x180 || 2780 (2.8M) || 11
+|-
+| 400 || 32 || 22050 || 480x270 || 2844 (2.8M) || 16
+|-
+| 400 || 32 || 22050 || 640x360 || 2864 (2.8M) || 21
+|-
+| 400 || 32 || 44100 || 320x180 || 3204 (3.2M) || 17
+|-
+| 400 || 32 || 44100 || 480x270 || 3268 (3.2M) || 17
+|-
+| 400 || 32 || 44100 || 640x360 || 3288 (3.3M) || 23
+|- style="font-weight:bold; color:#331100; background:#ffffcc;"
+| 400 || 64 || 22050 || 320x180 || 2780 (2.8M) || 11
+|- style="font-weight:bold; color:#993300; background:#ffff66;"
+| 400 || 64 || 22050 || 480x270 || 2844 (2.8M) || 15
+|- style="font-weight:bold; color:#662200; background:#ffff99;"
+| 400 || 64 || 22050 || 640x360 || 2864 (2.8M) || 21
+|-
+| 400 || 64 || 44100 || 320x180 || 3204 (3.2M) || 13
+|-
+| 400 || 64 || 44100 || 480x270 || 3268 (3.2M) || 17
+|-
+| 400 || 64 || 44100 || 640x360 || 3288 (3.3M) || 26
+|-
+|}
 
 {code title="Video conversion test script" source=Bash}
-#!/bin/bash
+#!/bin/sh
 
-# path to video file to convert
+# Path to video file to convert
 videofile="video.avi"
 
-video="11025 22050 44100"
-audio="16 32 64"
+# Aspect ratio of the video
+aspect="16:9"
+
+# Various sizes bitweaver can create - width is set by bitweaver, calculate video hight as determined by the aspect ratio of the video
 size="240x136 320x180 480x270 640x360"
-echo "! Video conversion results" > results.wiki
-echo "||~ Video rate | Audio rate | Video size | File size | Encoding time" >> results.wiki
 
-for v in $video; do
- for a in $audio; do
- for z in $size; do
- begin=`date +%s`
- name="flv2-$v-$a-$z"
- ffmpeg -i $videofile -acodec mp3 -ar $v -ab $a -f flv -s $z -aspect 16:9 -y $name
- now=`date +%s`
- duration=$(($now - $begin))
- bytes=`ls -s $name | sed 's/ .*$//'`
- hbytes=`ls -sh $name | sed 's/ .*$//'`
- echo "$v | $a | $z | $bytes ($hbytes) | $duration" >> results.wiki
- mv $name "$name-$duration.flv"
- done
- done
+# Settings
+video_bitrate="160000 240000 320000 400000"
+audio_samplerate="11025 22050 44100"
+audio_bitrate="16 32 64 96"
+
+echo '{| style="text-align:right"
+|+ Full results table
+! Video bitrate (bits/s)
+! Audio samplerate (Hz)
+! Audio bitrate (bits/s)
+! Video size (pixel x pixel)
+! File size (bytes)
+! Encoding time (s)' > results.wiki
+
+for b in $video_bitrate; do
+ for ar in $audio_samplerate; do
+ for ab in $audio_bitrate; do
+ for z in $size; do
+ begin=`date +%s`
+ name="flv-$b-$ar-$ab-$z"
+ ffmpeg -i $videofile -acodec mp3 -b $b -ar $ar -ab $ab -f flv -s $z -aspect $aspect -y $name
+ now=`date +%s`
+ duration=$(($now - $begin))
+ bytes=`ls -s $name | sed 's/ .*$//'`
+ hbytes=`ls -sh $name | sed 's/ .*$//'`
+ echo "|-" >> results.wiki
+ echo "|$b || $ar || $ab || $z || $bytes ($hbytes) || $duration" >> results.wiki
+ mv $name "$name-$duration.flv"
+ done
+ done
+ done
 done
 
-echo "||" >> results.wiki
+echo "|}" >> results.wiki
 {/code}
 
-Feel free to run your own tests and post your results here or append them as a comment
-
+Feel free to run your own tests and post your results here or append them as a comment.
Page History
Date/CommentUserIPVersion
14 May 2009 (08:50 UTC)
Lester Caine81.138.11.13619
Current • Source
Lester Caine81.138.11.13618
View • Compare • Difference • Source
Lester Caine81.138.11.13617
View • Compare • Difference • Source
xing88.117.28.15616
View • Compare • Difference • Source
laetzer85.178.0.715
View • Compare • Difference • Source
Kozuch85.207.244.16014
View • Compare • Difference • Source
xing194.152.164.4512
View • Compare • Difference • Source
xing194.152.164.4511
View • Compare • Difference • Source
xing194.152.164.4510
View • Compare • Difference • Source
xing194.152.164.457
View • Compare • Difference • Source
xing194.152.164.456
View • Compare • Difference • Source
xing194.152.164.455
View • Compare • Difference • Source
xing194.152.164.454
View • Compare • Difference • Source
xing194.152.164.453
View • Compare • Difference • Source
xing194.152.164.452
View • Compare • Difference • Source
xing194.152.164.451
View • Compare • Difference • Source