wget http://www.mplayerhq.hu/MPlayer/releases/codecs/mplayer-codecs-20061022-1.i386.rpm
wget http://www.mplayerhq.hu/MPlayer/releases/codecs/mplayer-codecs-extra-20061022-1.i386.rpm
rpm -ivh mplayer-codecs-*
rpm -ivh /home/distr/CentOS/automake-1.9.6-2.1.noarch.rpm
rpm -ivh /home/distr/CentOS/libtool-1.5.22-6.1.i386.rpm
yum install -y flvtool2 lame lame-devel libogg libogg-devel libvorbis libvorbis-devel ffmpeg ffmpeg-devel mplayer mencoder
wget http://dfn.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.3.1.tbz2
bunzip2 ffmpeg-php-0.5.3.1.tbz2
tar xvf ffmpeg-php-0.5.3.1.tar
cd ffmpeg-php-0.5.3.1
phpize
./configure
make && make test && make install

Скрипт проверки:

< ?php
$extension = "ffmpeg";
$extension_soname = $extension . "." . PHP_SHLIB_SUFFIX;
$extension_fullname = PHP_EXTENSION_DIR . "/" . $extension_soname;

if(!extension_loaded($extension)) {
    dl($extension_soname) or die("Can't load extension $extension_fullnamen");
}

$frame = 6;
$time  = time();
$movie = new ffmpeg_movie('/usr/local/apache2/htdocs/clock.avi', 1);

$duration = $movie->getDuration();

if ( $duration > 6 ){
        $minutes = floor($movie -> getDuration ()/ 60);
        $seconds  =  $movie -> getDuration ()% 60 ;
}

echo  'File: <font color="red">' . $_SERVER[ 'DOCUMENT_ROOT' ]. '/clock.avi</font> longs ' . $duration . ' seconds
' ;

$img  =  $_SERVER['DOCUMENT_ROOT' ]. '/' . $time . '_' . $frame . '.jpg' ;

$ff_frame  =  $movie -> getFrame ( $frame );
if ( $ff_frame ){
       $gd_image  =  $ff_frame -> toGDImage ();
       if ( $gd_image ) {
                  imagepng ( $gd_image ,  $img );
                  imagedestroy ( $gd_image );
       }
}

echo  $minutes . ' min ' . $seconds . ' sec.
' ;

echo  '<img src="' . $time . '_' . $frame . '.jpg" />' ;

$franecount = $movie->getFrameCount();
$framerate = $movie->getFrameRate();
$filename = $movie->getFilename();
$comment = $movie->getComment();

echo "

number of frames in a movie or audio file.".$franecount."
";
echo "frame rate of a movie in fps".$framerate."
";
echo "path and name of the movie file or audio file.".$filename."
";
echo "comment field from the movie or audio file.".$comment."
";
?>



Постоянные ссылки

При копировании ссылка на TeaM RSN обязательна!

URI

Html (ЖЖ)

BB-код (Для форумов)