<?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; ffmpeg</title>
	<atom:link href="http://dipplum.com/tag/ffmpeg/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.2</generator>
		<item>
		<title>生成兼容 iPhone 和 PSP 的视频</title>
		<link>http://dipplum.com/2009/06/17/psp-iphone-compatible-mp4/</link>
		<comments>http://dipplum.com/2009/06/17/psp-iphone-compatible-mp4/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 05:36:24 +0000</pubDate>
		<dc:creator>li</dc:creator>
				<category><![CDATA[开源软件]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod]]></category>
		<category><![CDATA[MP4]]></category>
		<category><![CDATA[PSP]]></category>

		<guid isPermaLink="false">http://dipplum.com/2009/06/17/psp-iphone-compatible-mp4/</guid>
		<description><![CDATA[iPhone 和 PSP 都支持播放 MP4 格式的视频。MP4 基于 Apple 的 QuickTime MOV 视频格式标准，是目前支持度最高的一种视频格式，多数的手机和移动设备，在播放 MP4 视频的时候都具有硬件优化。 但 iPhone 和 PSP 支持的视频要求略有不同。在视频转换的时候，如果不加以注意，生成的视频往往只能在一种设备上播放。 这给同时具有PSP、iPod Touch 和 PC 机的我带来很大的视频管理难题：同样一部影片，需要下载、保存三份：PSP、iPhone，再加上 PC。不但浪费空间，浪费下载带宽和时间，而且考虑到现在 MP4 视频的下载没有像 HDTV、DVDRip 那样成熟的下载渠道，更是加剧了这方面的困难。 如果可以生成 MP4 视频，使得 PSP，iPhone/iPod Touch，还有电脑（显然）都可以播放，就可以一举解决这个问题。 为了完成上述目标，我用 ffmpeg 写了一个转换脚本(用文件名替换%1)。生成的 MP4 文件属性如下 分辨率：480&#215;272。这是 PSP 和 iPhone 都能播放的最高分辨率。（其实两种设备都支持 640&#215;480 分辨率，但该分辨率下，无法保证 PSP 和 iPhone 都兼容） 视频编码：420kbps H.264。 音频编码：16位双声道，64kbps PSP 兼容参数：refs=2 [...]]]></description>
			<content:encoded><![CDATA[<p>iPhone 和 PSP 都支持播放 MP4 格式的视频。MP4 基于 Apple 的 QuickTime MOV 视频格式标准，是目前支持度最高的一种视频格式，多数的手机和移动设备，在播放 MP4 视频的时候都具有硬件优化。</p>
<p>但 iPhone 和 PSP 支持的视频要求略有不同。在视频转换的时候，如果不加以注意，生成的视频往往只能在一种设备上播放。</p>
<p>这给同时具有PSP、iPod Touch 和 PC 机的我带来很大的视频管理难题：同样一部影片，需要下载、保存三份：PSP、iPhone，再加上 PC。不但浪费空间，浪费下载带宽和时间，而且考虑到现在 MP4 视频的下载没有像 HDTV、DVDRip 那样成熟的下载渠道，更是加剧了这方面的困难。</p>
<p>如果可以生成 MP4 视频，使得 PSP，iPhone/iPod Touch，还有电脑（显然）都可以播放，就可以一举解决这个问题。</p>
<p>为了完成上述目标，我用 ffmpeg 写了一个转换脚本(用文件名替换%1)。生成的 MP4 文件属性如下</p>
<ul>
<li>分辨率：480&#215;272。这是 PSP 和 iPhone 都能播放的最高分辨率。（其实两种设备都支持 640&#215;480 分辨率，但该分辨率下，无法保证 PSP 和 iPhone 都兼容） </li>
<li>视频编码：420kbps H.264。 </li>
<li>音频编码：16位双声道，64kbps </li>
<li>PSP 兼容参数：refs=2 （PSP 最多支持两个参考帧） </li>
<li>iPhone 兼容参数：coder=0 bf=0 flags2=-wpred-dct8x8 （iPhone 不支持熵编码，不支持 B 帧） </li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ffmpeg</span> <span style="color: #660033;">-i</span> <span style="color: #000000; font-weight: bold;">%</span>1 <span style="color: #660033;">-r</span> <span style="color: #000000;">25</span> <span style="color: #660033;">-threads</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-s</span> 480x272 <span style="color: #660033;">-y</span> <span style="color: #660033;">-vcodec</span> libx264 <span style="color: #660033;">-an</span> <span style="color: #660033;">-pass</span> <span style="color: #000000;">1</span>  <span style="color: #660033;">-flags</span> +loop <span style="color: #660033;">-cmp</span> +chroma <span style="color: #660033;">-partitions</span> <span style="color: #660033;">-parti8x8-parti4x4-partp8x8-partp4x4-partb8x8</span> -me_method dia <span style="color: #660033;">-subq</span> <span style="color: #000000;">1</span> -me_range <span style="color: #000000;">16</span> <span style="color: #660033;">-g</span> <span style="color: #000000;">250</span> -keyint_min <span style="color: #000000;">25</span> -sc_threshold <span style="color: #000000;">40</span> -i_qfactor <span style="color: #000000;">0.71</span> -b_strategy <span style="color: #000000;">1</span> <span style="color: #660033;">-qcomp</span> <span style="color: #000000;">0.6</span> <span style="color: #660033;">-qmin</span> <span style="color: #000000;">10</span> <span style="color: #660033;">-qmax</span> <span style="color: #000000;">51</span> <span style="color: #660033;">-qdiff</span> <span style="color: #000000;">4</span> <span style="color: #660033;">-directpred</span> auto <span style="color: #660033;">-trellis</span> <span style="color: #000000;">0</span> <span style="color: #660033;">-level</span> <span style="color: #000000;">21</span> <span style="color: #660033;">-coder</span> <span style="color: #000000;">0</span> <span style="color: #660033;">-bf</span> <span style="color: #000000;">0</span> <span style="color: #660033;">-flags2</span> <span style="color: #660033;">-wpred-dct8x8</span> <span style="color: #660033;">-refs</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-b</span> 420k <span style="color: #660033;">-bt</span> 420k <span style="color: #660033;">-ab</span> 64k <span style="color: #660033;">-ar</span> <span style="color: #000000;">48000</span> <span style="color: #660033;">-ac</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-f</span> mp4 pass1.tmp
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">ffmpeg</span> <span style="color: #660033;">-i</span> <span style="color: #000000; font-weight: bold;">%</span>1 <span style="color: #660033;">-r</span> <span style="color: #000000;">25</span> <span style="color: #660033;">-threads</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-s</span> 480x272 <span style="color: #660033;">-y</span> <span style="color: #660033;">-vcodec</span> libx264 <span style="color: #660033;">-acodec</span> libfaac <span style="color: #660033;">-pass</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-flags</span> +loop <span style="color: #660033;">-cmp</span> +chroma <span style="color: #660033;">-partitions</span> +parti8x8+parti4x4+partp8x8+partb8x8 -me_method umh <span style="color: #660033;">-subq</span> <span style="color: #000000;">8</span> -me_range <span style="color: #000000;">16</span> <span style="color: #660033;">-g</span> <span style="color: #000000;">250</span> -keyint_min <span style="color: #000000;">25</span> -sc_threshold <span style="color: #000000;">40</span> -i_qfactor <span style="color: #000000;">0.71</span> -b_strategy <span style="color: #000000;">2</span> <span style="color: #660033;">-qcomp</span> <span style="color: #000000;">0.6</span> <span style="color: #660033;">-qmin</span> <span style="color: #000000;">10</span> <span style="color: #660033;">-qmax</span> <span style="color: #000000;">51</span> <span style="color: #660033;">-qdiff</span> <span style="color: #000000;">4</span> <span style="color: #660033;">-directpred</span> <span style="color: #000000;">3</span> <span style="color: #660033;">-trellis</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-level</span> <span style="color: #000000;">21</span> <span style="color: #660033;">-coder</span> <span style="color: #000000;">0</span> <span style="color: #660033;">-bf</span> <span style="color: #000000;">0</span> <span style="color: #660033;">-flags2</span> <span style="color: #660033;">-wpred-dct8x8</span> <span style="color: #660033;">-refs</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-b</span> 420k <span style="color: #660033;">-bt</span> 420k <span style="color: #660033;">-ab</span> 64k <span style="color: #660033;">-ar</span> <span style="color: #000000;">48000</span> <span style="color: #660033;">-ac</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-f</span> mp4 <span style="color: #000000; font-weight: bold;">%</span>1.mp4</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://dipplum.com/2009/06/17/psp-iphone-compatible-mp4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>

