aboutsummaryrefslogtreecommitdiff
path: root/libraries/phpvideotoolkit/adapters/ffmpeg-php/gifencoder/Example.php
diff options
context:
space:
mode:
authorDalyn Cessac <dalyn.cessac@1214036.no-reply.drupal.org>2011-03-16 11:06:40 -0500
committerDalyn Cessac <dalyn.cessac@1214036.no-reply.drupal.org>2011-03-16 11:06:40 -0500
commita435de089da4dd37c3c183f633a49107c720dd95 (patch)
tree5f92decbf2d4bb27f85c49bfc5b4fcaf938b58b4 /libraries/phpvideotoolkit/adapters/ffmpeg-php/gifencoder/Example.php
parenta31b9883849b0a04420ee1d476fbe08c87bc5d53 (diff)
downloadvideo-a435de089da4dd37c3c183f633a49107c720dd95.tar.gz
video-a435de089da4dd37c3c183f633a49107c720dd95.tar.bz2
Added phpvideotoolkit transcoder and updates to the preset ui
Diffstat (limited to 'libraries/phpvideotoolkit/adapters/ffmpeg-php/gifencoder/Example.php')
-rw-r--r--libraries/phpvideotoolkit/adapters/ffmpeg-php/gifencoder/Example.php50
1 files changed, 50 insertions, 0 deletions
diff --git a/libraries/phpvideotoolkit/adapters/ffmpeg-php/gifencoder/Example.php b/libraries/phpvideotoolkit/adapters/ffmpeg-php/gifencoder/Example.php
new file mode 100644
index 0000000..1223002
--- /dev/null
+++ b/libraries/phpvideotoolkit/adapters/ffmpeg-php/gifencoder/Example.php
@@ -0,0 +1,50 @@
+<?php
+include "GIFEncoder.class.php";
+/*
+ Build a frames array from sources...
+*/
+if ( $dh = opendir ( "frames/" ) ) {
+ while ( false !== ( $dat = readdir ( $dh ) ) ) {
+ if ( $dat != "." && $dat != ".." ) {
+ $frames [ ] = "frames/$dat";
+ $framed [ ] = 5;
+ }
+ }
+ closedir ( $dh );
+}
+/*
+ GIFEncoder constructor:
+ =======================
+
+ image_stream = new GIFEncoder (
+ URL or Binary data 'Sources'
+ int 'Delay times'
+ int 'Animation loops'
+ int 'Disposal'
+ int 'Transparent red, green, blue colors'
+ int 'Source type'
+ );
+*/
+$gif = new GIFEncoder (
+ $frames,
+ $framed,
+ 0,
+ 2,
+ 0, 0, 0,
+ 0,
+ "url"
+ );
+/*
+ Possibles outputs:
+ ==================
+
+ Output as GIF for browsers :
+ - Header ( 'Content-type:image/gif' );
+ Output as GIF for browsers with filename:
+ - Header ( 'Content-disposition:Attachment;filename=myanimation.gif');
+ Output as file to store into a specified file:
+ - FWrite ( FOpen ( "myanimation.gif", "wb" ), $gif->GetAnimation ( ) );
+*/
+Header ( 'Content-type:image/gif' );
+echo $gif->GetAnimation ( );
+?>