<?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>dipplum.com &#187; compile</title>
	<atom:link href="http://dipplum.com/tag/compile/feed/" rel="self" type="application/rss+xml" />
	<link>http://dipplum.com</link>
	<description>Be  the change you wanna see in the world</description>
	<lastBuildDate>Sat, 12 Nov 2011 07:38:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Debian 下编译静态链接的 ffmpeg 版本</title>
		<link>http://dipplum.com/2009/03/24/debian-static-ffmpeg/</link>
		<comments>http://dipplum.com/2009/03/24/debian-static-ffmpeg/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 19:39:35 +0000</pubDate>
		<dc:creator>li</dc:creator>
				<category><![CDATA[开源软件]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[ffmpeg]]></category>

		<guid isPermaLink="false">http://dipplum.com/2009/03/24/debian-%e4%b8%8b%e7%bc%96%e8%af%91%e9%9d%99%e6%80%81%e9%93%be%e6%8e%a5%e7%9a%84-ffmpeg-%e7%89%88%e6%9c%ac/</guid>
		<description><![CDATA[ffmpeg 是一款开源视频编码转换工具，最近刚刚发布 0.5 版本。ffmpeg 支持 h264，mpeg4，aac，mp3，等多种视频音频编码格式，同时支持 avi，mp4，mov，flv 等多种 container 格式。 Debian 中源中自带 ffmpeg，由于版权问题，只支持很少的几种编解码器，功能非常弱，可用性比较差。Debian Multimedia 项目弥补了这一缺陷，提供了预编译好的支持各种常用格式的 ffmpeg。 由于 Linux 发行版对于动态链接库的使用情有独钟，喜欢用链接到 Shared Object（so）库的方式编译各种软件，Debian 自然也不例外。而 ffmpeg 这款博览各家之长的软件拥有众多的库依赖关系，因此不能单独安装。不同发行版之间，甚至相同发行版的不同版本号之间，ffmpeg 的安装包都是不兼容的。安装起来非常不方便。 花了一周末的时间，使用 Debian 成功编译出静态链接的 ffmpeg 版本，得到脚本如下。下载后在 Debian 中直接运行即可。我在当前 Debian Multimedia 的 ffmpeg-0.5.svn20090318，和 Sid，Squeeze，Lenny 上测试该脚本成功。如果软件下载速度太慢，请自行修改脚本中的 Debian 源 URL。 另外，我用 Intel C Compiler 编译了 ffmpeg 的静态版本，只能运行在 Cuo 2 Duo 之后的芯片上。简单测试了一下，mpeg4 编码大概能比 gcc 版本快 [...]]]></description>
			<content:encoded><![CDATA[<p>ffmpeg 是一款开源视频编码转换工具，最近刚刚发布 0.5 版本。ffmpeg 支持 h264，mpeg4，aac，mp3，等多种视频音频编码格式，同时支持 avi，mp4，mov，flv 等多种 container 格式。</p>
<p>Debian 中源中自带 ffmpeg，由于版权问题，只支持很少的几种编解码器，功能非常弱，可用性比较差。<a href="http://debian-multimedia.org">Debian Multimedia 项目</a>弥补了这一缺陷，提供了预编译好的支持各种常用格式的 ffmpeg。</p>
<p>由于 Linux 发行版对于动态链接库的使用情有独钟，喜欢用链接到 Shared Object（so）库的方式编译各种软件，Debian 自然也不例外。而 ffmpeg 这款博览各家之长的软件拥有众多的库依赖关系，因此不能单独安装。不同发行版之间，甚至相同发行版的不同版本号之间，ffmpeg 的安装包都是不兼容的。安装起来非常不方便。</p>
<p>花了一周末的时间，使用 Debian 成功编译出静态链接的 ffmpeg 版本，得到脚本如下。下载后在 Debian 中直接运行即可。我在当前 Debian Multimedia 的 ffmpeg-0.5.svn20090318，和 Sid，Squeeze，Lenny 上测试该脚本成功。如果软件下载速度太慢，请自行修改脚本中的 Debian 源 URL。</p>
<p>另外，我用 Intel C Compiler 编译了 <a href="http://ivic.org.cn/~dipplum/pub/ffmpeg.icc.ssse3">ffmpeg 的静态版本</a>，只能运行在 Cuo 2 Duo 之后的芯片上。简单测试了一下，mpeg4 编码大概能比 gcc 版本快 10% 左右。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#/bin/sh</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>sources.list.d<span style="color: #000000; font-weight: bold;">/</span>build-static-ffmpeg.list <span style="color: #cc0000; font-style: italic;">&lt;&lt;EOF
deb http://debian.ustc.edu.cn/debian sid main contrib non-free
deb-src http://debian.ustc.edu.cn/debian sid main contrib non-free
&nbsp;
deb http://debian.ustc.edu.cn/debian-multimedia sid main
deb-src http://debian.ustc.edu.cn/debian-multimedia sid main
EOF</span>
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #660033;">-t</span> sid <span style="color: #c20cb9; font-weight: bold;">install</span> debian-multimedia-keyring debian-archive-keyring
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> nvidia-glx-dev<span style="color: #000000; font-weight: bold;">/</span>DEBIAN
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&gt;</span> nvidia-glx-dev<span style="color: #000000; font-weight: bold;">/</span>DEBIAN<span style="color: #000000; font-weight: bold;">/</span>control <span style="color: #cc0000; font-style: italic;">&lt;&lt;EOF
Package: nvidia-glx-dev
Priority: optional
Maintainer: nobody@example.com
Architecture: all
Version: 180.29
Description: dummy package for nvidia-glx-dev
 dummy package for nvidia-glx-dev
EOF</span>
&nbsp;
dpkg-deb <span style="color: #660033;">-b</span> nvidia-glx-dev
<span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">-i</span> nvidia-glx-dev.deb 
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #660033;">-t</span> sid build-dep <span style="color: #c20cb9; font-weight: bold;">ffmpeg</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #660033;">-t</span> sid <span style="color: #c20cb9; font-weight: bold;">install</span> libsdl1.2-dev <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #660033;">-t</span> sid build-dep <span style="color: #c20cb9; font-weight: bold;">ffmpeg</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #660033;">-t</span> sid <span style="color: #c20cb9; font-weight: bold;">install</span> libusb-<span style="color: #000000;">1.0</span>-<span style="color: #000000;">0</span>-dev
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #660033;">-t</span> sid <span style="color: #7a0874; font-weight: bold;">source</span> <span style="color: #c20cb9; font-weight: bold;">ffmpeg</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> ffmpeg-<span style="color: #000000; font-weight: bold;">*/</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&gt;</span> static_build <span style="color: #cc0000; font-style: italic;">&lt;&lt;EOF
debian/rules clean
debian/rules patch
&nbsp;
CFLAGS=&quot;-Wall -g&quot;
CC=&quot;ccache gcc&quot;
NCPUS=\$(getconf _NPROCESSORS_ONLN 2&gt;/dev/null || echo 1)
&nbsp;
./configure \
	--disable-ffplay --disable-ffserver --disable-shared --enable-static \
	--extra-libs=&quot;-static -ldirac_encoder -ldirac_decoder -lstdc++ -lspeex -lvorbis -lxvidcore -ldc1394 -lraw1394 -lusb-1.0 -lm -lasound -ldl&quot; \
	--prefix=/usr --extra-cflags=&quot;\$CFLAGS&quot; --cc=&quot;\$CC&quot; \
	--libdir=\\\${prefix}/lib --shlibdir=\\\${prefix}/lib --bindir=\\\${prefix}/bin \
	--incdir=\\\${prefix}/include/ffmpeg --enable-libmp3lame \
	--enable-gpl --enable-libfaad --mandir=\\\${prefix}/share/man --enable-libvorbis \
	--enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc \
	--enable-libamr-nb --enable-libamr-wb --enable-x11grab --enable-libgsm \
	--enable-libx264 --enable-libtheora --enable-libdc1394 \
	--enable-nonfree --disable-stripping --enable-avfilter --enable-libdirac \
	--disable-decoder=libdirac --enable-libschroedinger --disable-encoder=libschroedinger \
	--enable-libspeex --enable-avfilter-lavf --disable-mmx \
	--disable-altivec --disable-armv5te --disable-armv6 --disable-vis
&nbsp;
echo &quot;#define FFMPEG_VERSION \&quot;SVN-r18029-static\&quot;&quot; &gt; version.h
&nbsp;
make -j \$NCPUS &amp;&amp; echo Build success || echo build failed
strip ffmpeg
&nbsp;
./ffmpeg -version
cp ffmpeg ..
EOF</span>
&nbsp;
. static_build 
<span style="color: #7a0874; font-weight: bold;">echo</span> Type <span style="color: #ff0000;">&quot;. static_build&quot;</span> under <span style="color: #7a0874; font-weight: bold;">source</span> code <span style="color: #c20cb9; font-weight: bold;">dir</span> to rebuild</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://dipplum.com/2009/03/24/debian-static-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

