<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>马丁博客 &#187; ffmpeg</title>
	<atom:link href="http://www.blags.org/tags/ffmpeg/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blags.org</link>
	<description>专注lamp的技术博客</description>
	<lastBuildDate>Sat, 05 Nov 2011 02:25:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		
<!-- Start Of Script Generated By WP-PostViews Plus -->
<script type='text/javascript' src='http://www.blags.org/wp-includes/js/jquery/jquery.js?ver=1.3.2'></script>
<script type="text/javascript">
/* <![CDATA[ */
jQuery.ajax({type:'GET',url:'http://www.blags.org/wp-content/plugins/wp-postviews-plus/postviews_plus.php',data:'todowppvp=add&type=tag&id=170_1',cache:false,dataType:'script'});
/* ]]> */
</script>
<!-- End Of Script Generated By WP-PostViews Plus -->
	<item>
		<title>ubuntu 安装 ffmpeg php-ffmpeg</title>
		<link>http://www.blags.org/ubuntu-install-ffmpeg-php-ffmpeg/</link>
		<comments>http://www.blags.org/ubuntu-install-ffmpeg-php-ffmpeg/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 16:23:06 +0000</pubDate>
		<dc:creator>马丁博客</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Unix&Linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[lame]]></category>
		<category><![CDATA[mencoder]]></category>
		<category><![CDATA[php-ffmpeg]]></category>

		<guid isPermaLink="false">http://www.blags.org/?p=622</guid>
		<description><![CDATA[&#160;&#160;&#160;&#160;最近在做一个视频网站安装本地环境费了不少时间。本地是ubuntu 9.10 而服务器是redhat as4 所以到时候本人会把服务器安装过程和大家分享出来。
本人环境如下

php &#8212;- 5.210
apache 2.2
ubuntu 9.10


ffmpeg 功能很强大包括视频抓图，视频信息，视频转换，在线视频录制，而且是免费的。所有一般的视频网站都会采用他。
本人首先是采用编译安装，但是一直都没有成功。编译过程中出现了很多问题。安装要使用ffmpeg往往需要编译很多包。感觉很麻烦。这些包又依赖于很多其他包。安装顺序也有要求。所以放弃了。
最终采用ubuntu 强大的 apt-get (使用dpkg进行安装) 进行安装（当然cenos,red hat这类使用rpm的系统都可以使用yum进行安装,具体的安装方法可以在本站进行查找）.
apt-get 安装步骤如下:
sudo apt-get update ##更新以下源
sudo apt-get install ffmpeg
sudo apt-get install php5-ffmpeg
sudo apt-get install mencoder
sudo apt-get install flvtool2 ##视频转换flv
sudo apt-get install lame ##音频
sudo apt-get install yasm
编译安装ffmpeg 如下:
从 http://ffmpeg.mplayerhq.hu 下载
./configure &#8211;help ##查看有那些参数
./configure&#8211;prefix=/usr&#8211;enable-gpl&#8211;enable-shared&#8211;enable-libmp3lame&#8211;enable-libamr_nb&#8211;enable-libogg&#8211;enable-libvorbis&#8211;enable-libxvid&#8211;enable-liba52&#8211;enable-liba52bin&#8211;enable-pp&#8211;enable-libfaad&#8211;enable-libfaadbin&#8211;enable-libfaac&#8211;enable-pthreads&#8211;disable-ffserver&#8211;enable-x11grab
如果报错则安装该包，或者直接去掉该参数，只需要配置自己使用过程中需要使用到的就行了。
make &#38; make install
其他的则一个一个的下载解压在编译就是了。
具体参考本文：centos+zendce+red5+ffmpeg安装配置


下面是php-ffmpeg 使用的api。功能是很少了。
如果需要给视频抓图择需要使用shell脚本。也就是用到php当中的(system,exec,passthru)这类执行外部命令函数。
往往很多服务器都将种类函数视为危险函数屏蔽掉了。所以想做视频网站对服务器的配置要求比较高。
当然最好是自己的独立服务器。vps 也可以。随便你怎么整都可以。


View Code PHP$movie = new ffmpeg_movie&#40;String path_to_media, <a href="http://www.blags.org/ubuntu-install-ffmpeg-php-ffmpeg/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp;最近在做一个视频网站安装本地环境费了不少时间。本地是<a href="http://www.blags.org/tags/ubuntu/"title="ubuntu" >ubuntu</a> 9.10 而服务器是redhat as4 所以到时候本人会把服务器安装过程和大家分享出来。</p>
<p>本人环境如下</p>
<ul>
<li>php &#8212;- 5.210</li>
<li>apache 2.2</li>
<li>ubuntu 9.10</li>
</ul>
<ol>
<li><a href="http://www.blags.org/tags/ffmpeg/"title="ffmpeg" >ffmpeg</a> 功能很强大包括视频抓图，视频信息，视频转换，在线视频录制，而且是免费的。所有一般的视频网站都会采用他。</li>
<li>本人首先是采用编译安装，但是一直都没有成功。编译过程中出现了很多问题。安装要使用ffmpeg往往需要编译很多包。感觉很麻烦。这些包又依赖于很多其他包。安装顺序也有要求。所以放弃了。</li>
<li>最终采用ubuntu 强大的 apt-get (使用dpkg进行安装) 进行安装（当然cenos,red hat这类使用rpm的系统都可以使用yum进行安装,具体的安装方法可以在本站进行查找）.</li>
<li>apt-get 安装步骤如下:<br />
sudo apt-get update ##更新以下源<br />
sudo apt-get install ffmpeg<br />
sudo apt-get install php5-ffmpeg<br />
sudo apt-get install mencoder<br />
sudo apt-get install flvtool2 ##视频转换flv<br />
sudo apt-get install lame ##音频<br />
sudo apt-get install yasm</li>
<li>编译安装ffmpeg 如下:<br />
从 http://ffmpeg.mplayerhq.hu 下载<br />
./configure &#8211;help ##查看有那些参数<br />
./configure&#8211;prefix=/usr&#8211;enable-gpl&#8211;enable-shared&#8211;enable-libmp3lame&#8211;enable-libamr_nb&#8211;enable-libogg&#8211;enable-libvorbis&#8211;enable-libxvid&#8211;enable-liba52&#8211;enable-liba52bin&#8211;enable-pp&#8211;enable-libfaad&#8211;enable-libfaadbin&#8211;enable-libfaac&#8211;enable-pthreads&#8211;disable-ffserver&#8211;enable-x11grab<br />
如果报错则安装该包，或者直接去掉该参数，只需要配置自己使用过程中需要使用到的就行了。<br />
make &amp; make install<br />
其他的则一个一个的下载解压在编译就是了。</li>
<li>具体参考本文：<a href="http://www.blags.org/centos_zendce_red5_ffmpeg/">centos+zendce+red5+ffmpeg安装配置</a></li>
</ol>
<ul>
<li>下面是php-ffmpeg 使用的api。功能是很少了。</li>
<li>如果需要给视频抓图择需要使用shell脚本。也就是用到php当中的(system,exec,passthru)这类执行外部命令函数。<br />
往往很多服务器都将种类函数视为危险函数屏蔽掉了。所以想做视频网站对服务器的配置要求比较高。<br />
当然最好是自己的独立服务器。vps 也可以。随便你怎么整都可以。</li>
</ul>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p622code2'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6222"><td class="code" id="p622code2"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$movie</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ffmpeg_movie<span style="color: #009900;">&#40;</span>String path_to_media<span style="color: #339933;">,</span> boolean persistent<span style="color: #009900;">&#41;</span>	Open a video or audio <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a> and <span style="color: #b1b100;">return</span> it <span style="color: #b1b100;">as</span> an object<span style="color: #339933;">.</span>
path_to_media <span style="color: #339933;">-</span> <a href="http://www.php.net/file"><span style="color: #990000;">File</span></a> path of video or audio <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a> to open<span style="color: #339933;">.</span>
persistent <span style="color: #339933;">-</span> Whether to open this media <span style="color: #b1b100;">as</span> a persistent resource<span style="color: #339933;">.</span> See the PHP documentation <span style="color: #b1b100;">for</span> more info about persistent resources
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDuration</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the duration of a movie or audio <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a> in seconds<span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFrameCount</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the number of frames in a movie or audio <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFrameRate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the frame rate of a movie in fps<span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFilename</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the path and name of the movie <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a> or audio <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getComment</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the comment field from the movie or audio <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getTitle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the title field from the movie or audio <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAuthor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> alias <span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getArtist</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the author field from the movie or the artist ID3 field from an mp3 <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCopyright</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the copyright field from the movie or audio <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getArtist</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the artist ID3 field from an mp3 <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getGenre</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the genre ID3 field from an mp3 <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getTrackNumber</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the track ID3 field from an mp3 <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getYear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the year ID3 field from an mp3 <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFrameHeight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the height of the movie in pixels<span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFrameWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the width of the movie in pixels<span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPixelFormat</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the pixel format of the movie<span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getBitRate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the bit rate of the movie or audio <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a> in bits per second<span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getVideoBitRate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the bit rate of the video in bits per second<span style="color: #339933;">.</span>
NOTE<span style="color: #339933;">:</span> This only works <span style="color: #b1b100;">for</span> files with <a href="http://www.php.net/constant"><span style="color: #990000;">constant</span></a> bit rate<span style="color: #339933;">.</span>
&nbsp;
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAudioBitRate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the audio bit rate of the media <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a> in bits per second<span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAudioSampleRate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the audio sample rate of the media <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a> in bits per second<span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFrameNumber</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the <a href="http://www.php.net/current"><span style="color: #990000;">current</span></a> frame index<span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getVideoCodec</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the name of the video codec used to encode this movie <span style="color: #b1b100;">as</span> a string<span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAudioCodec</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the name of the audio codec used to encode this movie <span style="color: #b1b100;">as</span> a string<span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAudioChannels</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> the number of audio channels in this movie <span style="color: #b1b100;">as</span> an integer<span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">hasAudio</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> boolean value indicating whether the movie has an audio stream<span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">hasVideo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	<span style="color: #b1b100;">Return</span> boolean value indicating whether the movie has a video stream<span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFrame</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>Integer framenumber<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>	Returns a frame from the movie <span style="color: #b1b100;">as</span> an ffmpeg_frame object<span style="color: #339933;">.</span> Returns <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #b1b100;">if</span> the frame was not found<span style="color: #339933;">.</span>
framenumber <span style="color: #339933;">-</span> Frame from the movie to <span style="color: #b1b100;">return</span><span style="color: #339933;">.</span> <span style="color: #b1b100;">If</span> no framenumber is specified<span style="color: #339933;">,</span> returns the <a href="http://www.php.net/next"><span style="color: #990000;">next</span></a> frame of the movie<span style="color: #339933;">.</span>
<span style="color: #000088;">$movie</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getNextKeyFrame</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>	Returns the <a href="http://www.php.net/next"><span style="color: #990000;">next</span></a> <a href="http://www.php.net/key"><span style="color: #990000;">key</span></a> frame from the movie <span style="color: #b1b100;">as</span> an ffmpeg_frame object<span style="color: #339933;">.</span> Returns <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #b1b100;">if</span> the frame was not found<span style="color: #339933;">.</span></pre></td></tr></table></div>

<p>测试用例：<a href="http://www.blags.org/wp-content/Upload/ffmpeg-execute.php_.zip">ffmpeg-execute.php</a></p>
<p>安装过程出现错误解决:</p>
<ol>
<li>make: *** [<em>ffmpeg-php.lo</em>] <em>Error 1<br />
解决:.编译时加上 （php-config）路径：<br />
<code>--with-php-config=/usr/</code><code>local</code><code>/php/bin/php-config</code> </em></li>
<li>make: *** [ffmpeg_frame.lo] Error 1<br />
解决:mv ffmpeg_frame.loT ffmpeg_frame.lo</li>
<li>其他问题请检查自己的php版本。和php-ffmpeg是否一致。</li>
<li>还有其他问题可以在下面留言。</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.blags.org/ubuntu-install-ffmpeg-php-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>centos+zendce+red5+ffmpeg安装配置</title>
		<link>http://www.blags.org/centos_zendce_red5_ffmpeg/</link>
		<comments>http://www.blags.org/centos_zendce_red5_ffmpeg/#comments</comments>
		<pubDate>Sun, 16 May 2010 01:16:51 +0000</pubDate>
		<dc:creator>huzhi</dc:creator>
				<category><![CDATA[Unix&Linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[MYSQL]]></category>
		<category><![CDATA[red5]]></category>
		<category><![CDATA[zendce]]></category>

		<guid isPermaLink="false">http://www.blags.org/?p=605</guid>
		<description><![CDATA[本文主要是讲叙在centos服务器下如何快速的搭建AMP环境和流媒体服务器。至于性能测试和调优暂不涉及。
首先假设服务器已经安装了centos系统。推荐一款小软件。nmon for linux 服务器系统监测工具: wget http://sourceforge.net/projects/nmon/files/download/nmon_mainframe_12a_v2.zip/download
第一步，AMP环境采用Zend server 社区班Zend CE。
1.首先你要在建立Zend CE的下载库路径
vi /etc/yum.repos.d/zend.repo
添加的内容如下：

View Code ZEND[Zend]
name=Zend CE $releasever - $basearch - Released Updates
baseurl=http://repos.zend.com/rpm/ce/$basearch/
enabled=1
gpgcheck=0
[Zendce-noarch]
name=Zend CE - noarch
baseurl=http://repos.zend.com/rpm/ce/noarch
enabled=1
gpgcheck=0

2.开始安装如果服务器没有安装svn则需
yum install svn
如果服务器svn版本比较老。可以先删除在从yum安装。
# rpm -qa &#124; grep -i subversion
subversion-1.4.2-2.el5
subversion-1.4.2-2.el5
rpm -evf &#8211;allmatches subversion-1.4.2-2.el5
3.yum install zend-ce
yum clean all//清楚缓存
4.让linux自动加载zend库文件
vim /etc/profile
在最后面添加内容：
PATH=$PATH:/usr/local/zend/bin
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/zend/lib
保存退出
source /etc/profile   //生效
zendtpl.sh status //查看Zend server运行状态
zendtpl.sh start  //apache start
zendtpl.sh stop
zendtpl.sh restart  等同于 /etc/init.d/httpd restart 和 service <a href="http://www.blags.org/centos_zendce_red5_ffmpeg/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>本文主要是讲叙在<a href="http://www.blags.org/tags/centos/"title="centos 系统" >centos</a>服务器下如何快速的搭建AMP环境和流媒体服务器。至于性能测试和调优暂不涉及。<br />
首先假设服务器已经安装了centos系统。推荐一款小软件。nmon for <a href="http://www.blags.org/tags/linux/"target="_self"title="linux" >linux</a> 服务器系统监测工具: wget <a href="http://sourceforge.net/projects/nmon/files/download/nmon_mainframe_12a_v2.zip/download">http://sourceforge.net/projects/nmon/files/download/nmon_mainframe_12a_v2.zip/download</a></p>
<p>第一步，AMP环境采用Zend server 社区班Zend CE。<br />
1.首先你要在建立Zend CE的下载库路径<br />
vi /etc/yum.repos.d/zend.repo<br />
添加的内容如下：</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p605code5'); return false;">View Code</a> ZEND</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6055"><td class="code" id="p605code5"><pre class="zend" style="font-family:monospace;">[Zend]
name=Zend CE $releasever - $basearch - Released Updates
baseurl=http://repos.zend.com/rpm/ce/$basearch/
enabled=1
gpgcheck=0
[Zendce-noarch]
name=Zend CE - noarch
baseurl=http://repos.zend.com/rpm/ce/noarch
enabled=1
gpgcheck=0</pre></td></tr></table></div>

<p>2.开始安装如果服务器没有安装svn则需<br />
yum install svn<br />
如果服务器svn版本比较老。可以先删除在从yum安装。<br />
# rpm -qa | grep -i subversion<br />
subversion-1.4.2-2.el5<br />
subversion-1.4.2-2.el5<br />
rpm -evf &#8211;allmatches subversion-1.4.2-2.el5<br />
3.yum install zend-ce<br />
yum clean all//清楚缓存<br />
4.让linux自动加载zend库文件<br />
<a href="http://www.blags.org/tags/vim/"title="vim" >vim</a> /etc/profile<br />
在最后面添加内容：<br />
PATH=$PATH:/usr/local/zend/bin<br />
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/zend/lib<br />
保存退出<br />
source /etc/profile   //生效<br />
zendtpl.sh status //查看Zend server运行状态<br />
zendtpl.sh start  //apache start<br />
zendtpl.sh stop<br />
zendtpl.sh restart  等同于 /etc/init.d/httpd restart 和 service httpd restart<br />
5.查看80端口是否打开！<br />
这个时候你可以通过netstat -an | grep 端口号来检验下是不是已经打开了某某服务<br />
6 查看zend  server的网页的方法 http://IP(或域名):10081/ZendServer/Login#1263971368039<br />
密码 test<br />
邮箱 test@test.com<br />
7 Zend CE没有安装msyql数据库。需要手动安装msyql。<br />
yum install <a href="http://www.blags.org/tags/mysql/"title="mysql" >mysql</a>-server<br />
yum install mysql<br />
mysqladmin -u root password &#8216;****&#8217; //设置root密码<br />
service mysqld start/stop/restart 开启/停止/重启mysql<br />
8 开启apache mod_rewriete;<br />
vim /etc/httpd/conf/httpd.conf 修改 AllowOverride All (默认为None);<br />
9 主要配置文件<br />
php /usr/local/zend/etc/php.ini<br />
apache /etc/httpd/conf/httpd.conf<br />
mysql /etc/my.conf</p>
<p>第二步， centos下安装red5的安装<br />
1 安装<a href="http://www.blags.org/tags/java/"title="java" >java</a>.red5是用户java语言写的一款开源流媒体服务器。<br />
yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel<br />
如果java版本低于1.5.下载新版jdk后安装。<br />
wget http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u16-linux-i586-rpm.bin?BundledLineItemUUID=om5IBe.ovo4AAAEkbKsxcJo0&amp;OrderID=BlRIBe.oOxwAAAEkXqsxcJo0&amp;ProductID=Dx1IBe.prBgAAAEirRcTvuC_&amp;FileName=/jdk-6u16-linux-i586-rpm.bink<br />
解压 ./jdk-6u16-linux-i586-rpm.bink<br />
安装 rpm -ivh jdk-6u16-linux-i586-rpm<br />
注意:如果服务器上有两种不同的java版本。需做如下操作：<br />
alternatives &#8211;install /usr/bin/java java /usr/java/jdk1.6.0_16/bin/java 2<br />
再选择版本。<br />
update-alternatives &#8211;config java<br />
2 安装apache-ant<br />
wget http://labs.xiaonei.com/apache-mirror/ant/binaries/apache-ant-1.7.1-bin.tar.gz<br />
tar -xzvf<br />
export ANT_HOME=/usr/local/apache-ant/<br />
sudo ln -s /usr/local/apache-ant/bin/ant /usr/bin/ant<br />
3 安装red5.<br />
从svn仓库中牵出red5的代码。<br />
svn co http://red5.googlecode.com/svn/java/server/trunk red5<br />
如果服务器没有安装svn则需<br />
yum install svn<br />
如果服务器svn版本比较老。可以先删除在从yum安装。<br />
rpm -qa | grep -i subversion<br />
subversion-1.4.2-2.el5<br />
subversion-1.4.2-2.el5<br />
rpm -evf &#8211;allmatches subversion-1.4.2-2.el5<br />
cd /usr/local/red5<br />
/usr/local/apache-ant/bin/ant prepare<br />
/usr/local/apache-ant/bin/ant dist<br />
cd disk<br />
./red.sh //启动red5服务器。常使用不挂断的启动：nohup ./red5.sh &amp;</p>
<p>第三步 <a href="http://www.blags.org/tags/ffmpeg/"title="ffmpeg" >ffmpeg</a>以及ffmpeg-php的安装。<br />
1 编译安装ffmpeg非常麻烦，yum可以方便的安装ffmpeg以及ffmpeg-dev，<br />
vim /etc/yum.repos.d/dag.repo<br />
输入：<br />
[dag]<br />
name=Dag RPM Repository for Red Hat Enterprise Linux<br />
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag<br />
gpgcheck=1<br />
enabled=1</p>
<p><span style="color: #ff0000;">Mark:以上源现在更新了,正确的如下:</span></p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p605code6'); return false;">View Code</a> YUM</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6056"><td class="code" id="p605code6"><pre class="yum" style="font-family:monospace;">[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el5/en/$basearch/dag
gpgcheck=1
enabled=1</pre></td></tr></table></div>

<p>&#8220;el5&#8243; 值得注意。看清楚自己的版本。<span style="color: #ff0000;">cat /etc/redhat-release，否则无法安装.</span></p>
<p>导入Dag的RPM_GPG_KEY,否则提示没有key无法安装<br />
wget http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt<br />
rpm -import RPM-GPG-KEY.dag.txt<br />
安装ffmpeg&amp;ffmpeg-php<br />
yum install ffmpeg ffmpeg-devel<br />
2 ffmpeg-php的安装<br />
wget http://sourceforge.net/projects/ffmpeg-php/files/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2/download<br />
cd 进入php源码目录<br />
tar -xjf ffmpeg-php-0.6.0.tbz2<br />
phpize<br />
./configure &#8211;with-php-config=/usr/local/php/bin/php-config<br />
make<br />
make test<br />
make install<br />
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/<br />
php.ini配置文件里面增加 extensions=/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg-php.so<br />
重启apache /etc/init.d/httpd retart 。 使用 php -r &#8220;phpinfo();&#8221; 查看ffmpeg-php模块是否安装成功;<br />
安装完毕。欢迎指正。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blags.org/centos_zendce_red5_ffmpeg/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

