<?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>Jeans Weblog &#187; jean</title>
	<atom:link href="http://jeanbruenn.info/author/admin/feed" rel="self" type="application/rss+xml" />
	<link>http://jeanbruenn.info</link>
	<description>a computer without windows is like a chocolatecake without mustard</description>
	<lastBuildDate>Fri, 03 Sep 2010 16:52:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Lunar Linux Boot in 5, 10 or 15 seconds</title>
		<link>http://jeanbruenn.info/linux_lunar-linux-boot-in-5-10-or-15-seconds.html</link>
		<comments>http://jeanbruenn.info/linux_lunar-linux-boot-in-5-10-or-15-seconds.html#comments</comments>
		<pubDate>Thu, 02 Sep 2010 07:34:52 +0000</pubDate>
		<dc:creator>jean</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Lunar Linux]]></category>

		<guid isPermaLink="false">http://jeanbruenn.info/?p=919</guid>
		<description><![CDATA[You might or might not remember that there have been posts about booting Linux in very short time (like 10 seconds or less) read the following Articles for example: LPC: Booting Linux in five seconds and Did Ubuntu 10.04 Achieve Its Ten Second Boot Goal? and Meego 1.0 Boot time especially the last one is [...]]]></description>
			<content:encoded><![CDATA[<p>You might or might not remember that there have been posts about booting Linux in very short time (like 10 seconds or less) read the following Articles for example: <a href="http://lwn.net/Articles/299483/">LPC: Booting Linux in five seconds</a> and <a href="http://www.phoronix.com/scan.php?page=article&#038;item=ubuntu_lucid_final&#038;num=1">Did Ubuntu 10.04 Achieve Its Ten Second Boot Goal?</a> and <a href="http://www.youtube.com/watch?v=c6VtDG2h2Tg">Meego 1.0 Boot time </a> especially the last one is very interesting. In this &#8220;Article&#8221; i wanna show how to boot a normal Desktop PC with Lunar Linux in less than 20 seconds &#8211; My original goal was 10 seconds, currently I&#8217;m at 15. It will take a few days till i get it to 10 seconds because the &#8220;easy&#8221; changes have been done already by me &#8211; To improve the boot-time of this box even more i need to configure the Kernel differently and hack some of the boot scripts.<br />
<span id="more-919"></span><br />
<strong>My Hardware</strong></p>
<ul>
<li>AMD Athlon(tm) 64 X2 Dual Core Processor 3800+</li>
<li>3 GB Ram</li>
<li>3x WDC WD5000AADS-00S9B0 (500 GB) in SW Raid 5</li>
<li>nVidia Corporation G98 [GeForce 8400 GS]</li>
<li>Conexant Systems, Inc. CX23885 PCI Video and Audio Decoder (DVB-T Card)</li>
<li>nVidia Corporation MCP61 High Definition Audio (snd-hda-intel)</li>
<li>LITE-ON DVDRW LH-20A1P, ATAPI CD/DVD-ROM drive</li>
</ul>
<p><strong>Linux Boot Step by Step</strong></p>
<p>To give you an idea how the boot-process works in Linux, here&#8217;s a little step by step overview about what happens when:</p>
<ol>
<li>Boot-loader</li>
<li>Kernel</li>
<li>Init</li>
<li>Services</li>
</ol>
<p>Before you start to tune the boot-time of your System you should set yourself some goals. Don&#8217;t set unrealistic goals. My goals are:</p>
<ul>
<li>Kernel max 3 seconds</li>
<li>Init-Scripts max 7 seconds</li>
</ul>
<p>(a bit later you will notice that i switch from sysvinit to runit &#8211; and thus the goals change to: one-time-scripts: max 3 seconds, rest max 4 seconds) &#8211; This way i should achieve a boot-time of 10 seconds.<br />
<br style="clear: both;"/><br />
<strong>Another note:</strong> I&#8217;ll write about the disk-throughput in my examples below, however i don&#8217;t think this is a helpful value as this might change from boot-to-boot.<br />
<br style="clear: both;"/><br />
<strong>Current &#8211; Sysvinit, default kernel</strong></p>
<p>
<a href="http://jeanbruenn.info/wp-content/gallery/bootchart/bootchart-001.png" title="" rel="lightbox[singlepic1]" >
	<img class="ngg-singlepic ngg-left" src="http://jeanbruenn.info/wp-content/gallery/cache/1__150x100_bootchart-001.png" alt="bootchart-001" title="bootchart-001" />
</a>

<p class="display: inline;">Alright, let&#8217;s take a look at the current boot time. As you can see in this graphic my current boot is 47 seconds. According to the graphic we have 9 seconds for the Kernel till init starts and 38 seconds till the system is &#8220;ready to use&#8221;. You can see easily that every service is started one-by-one so if you have 10 services, and each is taking 2 seconds, we&#8217;re talking about 2*10 seconds. Now take a look at the top of the graphic, you&#8217;ll see that the disk throughput (31 mb/s) is not very good and the system is more or less &#8220;bored&#8221; while booting (which simply means, the system could do a lot more in the same time)</p>
<p>This is a big problem with SysvInit &#8211; But gladly there are sysvinit replacements around. For example runit, upstart and systemd. I personally dislike systemd and upstart &#8211; Upstart because of its dependencies to python and dbus. Systemd because it seems to be really buggy at the moment and the on-demand feature is imho something which shouldn&#8217;t go into an init-system (and let&#8217;s be serious &#8211; re-inventing xinetd/inetd makes which sense?) plus the fact that systemd needs cgroupthingy and thus won&#8217;t run on non-linux-platforms.<br />
<br style="clear: both;"/><br />
<strong>sysvinit to runit &#8211; minimal migration</strong></p>
<p>
<a href="http://jeanbruenn.info/wp-content/gallery/bootchart/bootchart-002.png" title="" rel="lightbox[singlepic2]" >
	<img class="ngg-singlepic ngg-left" src="http://jeanbruenn.info/wp-content/gallery/cache/2__150x100_bootchart-002.png" alt="bootchart-002" title="bootchart-002" />
</a>

<p class="display: inline;">After switching sysvinit to runit, and doing minimal migration of the services (runit is sysv compatible &#8211; so i just wrote all the init scripts except for a few into /etc/runit/1) i got this graphic, on which you can see the boot-time is at 36 seconds (11 seconds won) and the throughput is at 38 MB/s (7 MB/s won). The  kernel takes only 7 seconds anymore (without doing anything to it &#8211; so no idea why this happened).</p>
<p><br style="clear: both;"/><br />
<strong>runit &#8211; fully migrated</strong></p>
<p>
<a href="http://jeanbruenn.info/wp-content/gallery/bootchart/bootchart-003.png" title="" rel="lightbox[singlepic3]" >
	<img class="ngg-singlepic ngg-left" src="http://jeanbruenn.info/wp-content/gallery/cache/3__150x100_bootchart-003.png" alt="bootchart-003" title="bootchart-003" />
</a>

<p class="display: inline;">After migrating everything possible (talking about the services from sysvinit scripts to runit-run-scripts) i got a screen with a boot time of 27 seconds (won another 9 seconds) and a throughput of 91 MB/s (which is near to the limit of my hard discs and an improvement of another 53 MB/s). Kernel time is still around 7 seconds.</p>
<p>So &#8211; the only thing we did was: Replacing SysVinit with Runit and migrating all services. Just by doing so we boot in 27 seconds of 47 (20 seconds less), and got a throughput of 91 MB/s instead of 31 (60 MB/s more). Of course, thats not all, and i still didn&#8217;t reached the goal of a 10 seconds boot. It&#8217;s time to take a look at the kernel.<br />
<br style="clear: both;"/><br />
<strong>modifying the kernel &#8211; remove not needed stuff</strong></p>
<p>
<a href="http://jeanbruenn.info/wp-content/gallery/bootchart/bootchart-004.png" title="" rel="lightbox[singlepic4]" >
	<img class="ngg-singlepic ngg-left" src="http://jeanbruenn.info/wp-content/gallery/cache/4__150x100_bootchart-004.png" alt="bootchart-004" title="bootchart-004" />
</a>

<p class="display: inline;">In this graphic you will see that i have a boot-time of 23 seconds (we won around 4 seconds) and a throughput of 68 MB/s (we lost around 23 MB/s). All i did was removing not needed modules and not needed stuff from the default Lunar Linux kernel, enabling preempt (low latency desktop). The kernel-time went down from ca 7 seconds to 5 seconds &#8211; so we won 2 seconds. However, the goal was 3 seconds &#8211; So i still need to do something with the Kernel. The easiest thing to have the Kernel at a 3 seconds boot is to just make everything which is not needed for a boot modularized. For example your USB-mouse and keyboard, your CD-ROM drive, your DVB-t card and similar stuff. That stuff doesn&#8217;t need to be available while booting the kernel, so make it a module&#8230;</p>
<p><br style="clear: both;"/><br />
<strong>make everything not important modular</strong></p>
<p>
<a href="http://jeanbruenn.info/wp-content/gallery/bootchart/bootchart-005.png" title="" rel="lightbox[singlepic5]" >
	<img class="ngg-singlepic ngg-left" src="http://jeanbruenn.info/wp-content/gallery/cache/5__150x100_bootchart-005.png" alt="bootchart-005" title="bootchart-005" />
</a>

<p class="display: inline;">&#8230;and i get this screen &#8211; which shows 24 seconds boot time (so we lost 1 second) and a throughput of 56mb/s (lost 12 MB/s) &#8211; However: The kernel-time is only around 3,2 up to 3,3 seconds instead of 5 seconds &#8211; So I&#8217;d say first goal achieved &#8211; Kernel needs only around 3 seconds. I&#8217;m sure it&#8217;s possible to boot the kernel in 2 seconds &#8211; do dmesg | less and enable kernel time display so that you can see what is &#8220;hanging&#8221; where &#8211; you can tune the time then by making things modular or by disabling them.</p>
<p><br style="clear: both;"/><br />
<strong>modify init/run scripts</strong></p>
<p>As you can see in the latest graphic the time from running rcS to start the services in parallel is about 13 seconds long. As you might remember the goal was to have the one-time-scripts done/started within 3 seconds. So we&#8217;ll tune this now by modifying rcS.</p>
<p>
<a href="http://jeanbruenn.info/wp-content/gallery/bootchart/bootchart-006.png" title="" rel="lightbox[singlepic6]" >
	<img class="ngg-singlepic ngg-left" src="http://jeanbruenn.info/wp-content/gallery/cache/6__150x100_bootchart-006.png" alt="bootchart-006" title="bootchart-006" />
</a>

<p class="display: inline;">Due to these changes the boot-time goes down from 24 seconds to 17 seconds &#8211; so we made it take 7 seconds less. And only 7 seconds to our &#8220;goal&#8221;. The time of the one-time-scripts went down to ca 5 seconds. So we need to get 2 more seconds out here. This means hacking the udev and mount script. Remember, we went down from 47 to 17 seconds already &#8211; and we didn&#8217;t touch mount, udev, x11 &#8211; So you&#8217;re booting Linux with x11 plus networking in 17 seconds.</p>
<p><br style="clear: both;"/><br />
<strong>hacking the udev and mount init script</strong></p>
<p>
<a href="http://jeanbruenn.info/wp-content/gallery/bootchart/bootchart-007.png" title="" rel="lightbox[singlepic7]" >
	<img class="ngg-singlepic ngg-left" src="http://jeanbruenn.info/wp-content/gallery/cache/7__150x100_bootchart-007.png" alt="bootchart-007" title="bootchart-007" />
</a>

<p class="display: inline;">For the mount script, which takes about 5 seconds, do the following: comment wait_some everywhere (except for the function at the start). Then remove the 2.4 kernel compatibility stuff and finally comment out LVM stuff (if you dont need it &#8211; i don&#8217;t).</p>
<p><em>Wow &#8211; Booting in 15 seconds. </em><br />
<br style="clear: both;"/><br />
<strong>To be continued&#8230; :)</strong></p>
<p><strong>Other Links</strong></p>
<ul>
<li><a href="http://www.lunar-linux.org">Lunar Linux</a></li>
<li><a href="http://www.ibm.com/developerworks/linux/library/l-boot.html">Boot Linux faster</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jeanbruenn.info/linux_lunar-linux-boot-in-5-10-or-15-seconds.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Runit &#8211; Scripts</title>
		<link>http://jeanbruenn.info/general_runit-scripts.html</link>
		<comments>http://jeanbruenn.info/general_runit-scripts.html#comments</comments>
		<pubDate>Tue, 17 Aug 2010 16:50:55 +0000</pubDate>
		<dc:creator>jean</dc:creator>
				<category><![CDATA[The daily insanity]]></category>

		<guid isPermaLink="false">http://jeanbruenn.info/?p=817</guid>
		<description><![CDATA[Here are some Scripts which i use with runit &#8211; I&#8217;ll update the list irregularly. Wondering why i&#8217;m using runit? See the following example: alia:~# killall -9 sshd Connection to XX.XXX.XX.X closed by remote host. Connection to XX.XXX.XX.X closed. wdp@localhost:~$ ssh XX.XXX.XX.X -l wdp -C wdp@XX.XXX.XX.X's password: So &#8211; Yes, a service is automatically restarted [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some Scripts which i use with runit &#8211; I&#8217;ll update the list irregularly. Wondering why i&#8217;m using runit? See the following example:<br />
<span id="more-817"></span></p>
<pre>
alia:~# killall -9 sshd
Connection to XX.XXX.XX.X closed by remote host.
Connection to XX.XXX.XX.X closed.
wdp@localhost:~$ ssh XX.XXX.XX.X -l wdp -C
wdp@XX.XXX.XX.X's password:
</pre>
<p>So &#8211; Yes, a service is automatically restarted if it crashes. Other nice things are service-dependecies as shown here:  <a href="http://smarden.org/runit/dependencies.html">http://smarden.org/runit/dependencies.html</a>. For more run-scripts check this url: <a href="http://smarden.org/runit/runscripts.html">http://smarden.org/runit/runscripts.html</a>.</p>
<p>By the way, here&#8217;s a pstree (yeah im not using pro-ftpd and ispcp_daemon with runit yet)</p>
<pre>
runit-+-ispcp_daemon
      |-proftpd
      `-runsvdir-+-runsv---xinetd
                 |-runsv---mysqld---18*[{mysqld}]
                 |-runsv-+-master-+-anvil
                 |       |        |-bounce
                 |       |        |-pickup
                 |       |        |-qmgr
                 |       |        `-smtp
                 |       `-svlogd
                 |-runsv---lard
                 |-runsv---cron
                 |-runsv-+-logger
                 |       `-sshd
                 |-runsv---dovecot-+-2*[dovecot-auth]
                 |                 |-9*[imap]
                 |                 |-3*[imap-login]
                 |                 `-3*[pop3-login]
                 |-runsv---nscd---8*[{nscd}]
                 |-runsv---named---6*[{named}]
                 |-runsv---apache2-+-apache2
                 |                 |-apache2---18*[php5-cgi---2*[php5-cgi]]
                 |                 |-apache2---11*[{apache2}]
                 |                 `-2*[ispcp-apache-lo]
                 |-runsv---postgrey
                 `-runsv---policyd-weight
</pre>
<ul>
<li>Lunar Linux
<ul>
<li><strong>acpid</strong><br />run:
<pre>
#!/bin/bash

# Enable IBM specific hotkeys by default
if [ -e /proc/acpi/ibm/hotkey ]; then
        echo enable,0xffff > /proc/acpi/ibm/hotkey
fi

# Start acpid in foreground
exec /usr/sbin/acpid -f
</pre>
</li>
<li><strong>agetty</strong><br />run:
<pre>
#!/bin/sh
exec /sbin/agetty 38400 tty1 linux
</pre>
<p>finish:</p>
<pre>
#!/bin/sh
exec utmpset -w tty1
</pre>
</li>
<li><strong>ConsoleKit</strong><br />run:
<pre>
#!/bin/sh
exec /usr/sbin/console-kit-daemon --no-daemon
</pre>
</li>
<li><strong>hald</strong><br />run:
<pre>
#!/bin/bash

# run hald
exec /usr/sbin/hald --daemon=no --use-syslog &#038;> /dev/null
</pre>
</li>
<li><strong>messagebus</strong><br />run:
<pre>
#!/bin/bash

if [ -x /usr/bin/dbus-uuidgen ] ; then
        /usr/bin/dbus-uuidgen --ensure
fi

exec dbus-daemon --system --nofork &#038;> /dev/null
</pre>
</li>
<li><strong>portmap</strong><br />run:
<pre>
#!/bin/bash

# run portmap
exec /sbin/portmap -f -l
</pre>
</li>
<li><strong>smartd</strong><br />run:
<pre>
#!/bin/sh
exec /usr/sbin/smartd -n
</pre>
</li>
<li><strong>sshd</strong><br />run:
<pre>
#!/bin/sh
exec 2>&#038;1
exec /usr/sbin/sshd -D -e
</pre>
</li>
<li><strong>udevd</strong><br />run:
<pre>
#!/bin/bash

rm -rf /dev/.udevdb
export ACTION=add
exec /sbin/udevd
/sbin/udevadm trigger
/sbin/udevadm settle
</pre>
</li>
<li><strong>wpa_supplicant</strong><br />run:
<pre>
#!/bin/bash

# Start only if wlan0 is there, if not
# wait 5 seconds and try again, still
# not there, disable this service for now
if /sbin/ifconfig | grep wlan0 ; then
        exec /usr/sbin/wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf
else
        # lets wait 5 seconds, maybe the device is coming up then
        sleep 5
        if /sbin/ifconfig | grep wlan0 ; then
                exec /usr/sbin/wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf
        else
                # still not there, probably disabled. let's
                # disable this service then.
                /usr/local/bin/sv stop wpa_supplicant
        fi
fi
</pre>
</li>
<li><strong>xinetd</strong><br />run:
<pre>
#!/bin/bash

# start xinetd
exec /usr/sbin/xinetd -dontfork
</pre>
</li>
</ul>
</li>
<li>Debian (Lenny)
<ul>
<li><strong>apache2</strong><br />run:
<pre>
#!/bin/sh
exec 2>&#038;1
exec chpst -P apache2 -DNO_DETACH -k start -DSSL -DFASTCGI -f /etc/apache2/apache2.conf
</pre>
</li>
<li><strong>cron</strong><br />run:
<pre>
#!/bin/sh
exec 2>&#038;1
exec cron -f -l
</pre>
</li>
<li><strong>dovecot</strong><br />run:
<pre>
#!/bin/sh
exec 2>&#038;1
# my dovecot setup needs mysql
svwaitup 3 /service/mysqld || exit 1
# start dovecot in foreground
exec /usr/sbin/dovecot -F
</pre>
</li>
<li><strong>lard</strong><br />run:
<pre>
#!/bin/sh
exec 2>&#038;1
exec lard -n
</pre>
</li>
<li><strong>mysqld</strong><br />run:
<pre>
#!/bin/sh
exec 2>&#038;1
exec /usr/sbin/mysqld                   \
        --basedir=/usr                  \
        --datadir=/var/lib/mysql        \
        --user=mysql                    \
        --pid-file=/var/run/mysqld/mysqld.pid \
        --skip-external-locking \
        --port=3306                     \
        --socket=/var/run/mysqld/mysqld.sock
</pre>
</li>
<li><strong>named (bind9)</strong><br />run:
<pre>
#!/bin/sh
exec 2>&#038;1
exec /usr/sbin/named -g -u bind 2>&#038;1
</pre>
</li>
<li><strong>nscd</strong><br />run:
<pre>
#!/bin/sh
secure=""
for table in passwd group
        do
                if egrep '^'$table':.*nisplus' /etc/nsswitch.conf >/dev/null
                then
                        nscd_nischeck $table || secure="$secure -S $table,yes"
                fi
        done
exec nscd -d -- $secure
</pre>
</li>
<li><strong>policyd-weight</strong><br />run:
<pre>
#!/bin/sh
exec 2>&#038;1
# policyd-weight wants postfix :)
svwaitup 3 /service/postfix || exit 1
exec /usr/sbin/policyd-weight -d start 2>&#038;1
</pre>
</li>
<li><strong>postfix</strong><br />run:
<pre>
#!/bin/sh
exec 2>&#038;1
# my postfix setup needs mysql
svwaitup 3 /service/mysqld || exit 1

daemon_directory=/usr/lib/postfix               \
command_directory=/usr/sbin                     \
config_directory=/etc/postfix                   \
queue_directory=/var/spool/postfix              \
mail_owner=postfix                              \
setgid_group=postdrop                           \
  /etc/postfix/postfix-script check || exit 1

exec /usr/lib/postfix/master 2>&#038;1
</pre>
</li>
<li><strong>postgrey</strong><br />run:
<pre>
#!/bin/sh
exec 2>&#038;1
# let's wait for postfix
svwaitup 3 /service/postfix || exit 1

exec /usr/sbin/postgrey --pidfile=/var/run/postgrey.pid --inet=127.0.0.1:60000 2>&#038;1
</pre>
</li>
<li><strong>sshd</strong><br />run:
<pre>
#!/bin/sh
exec 2>&#038;1
exec /usr/sbin/sshd -D -e
</pre>
</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jeanbruenn.info/general_runit-scripts.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ePost &#8211; Briefgeheimnis &#8211; Admin Sicht</title>
		<link>http://jeanbruenn.info/general_epost-briefgeheimnis-admin-sicht.html</link>
		<comments>http://jeanbruenn.info/general_epost-briefgeheimnis-admin-sicht.html#comments</comments>
		<pubDate>Sun, 01 Aug 2010 14:53:06 +0000</pubDate>
		<dc:creator>jean</dc:creator>
				<category><![CDATA[The daily insanity]]></category>

		<guid isPermaLink="false">http://jeanbruenn.info/?p=803</guid>
		<description><![CDATA[Hallo mal wieder, ich bin gerade über etwas interessantes gestolpert (und werde hier ein bisschen zitieren, ich hoffe das ist in Ordnung und erlaubt) &#8211; Im Artikel &#8220;Der E-Postbrief: Post Scriptum&#8221; auf http://gutjahr.biz/blog/2010/07/post-scriptum/ zeigt der Author einen Brief der Post, in welchem es mir um folgende Auszug geht: Zitat: Die Inhalte der Nachrichten werden verschlüsselt [...]]]></description>
			<content:encoded><![CDATA[<p>Hallo mal wieder,</p>
<p>ich bin gerade über etwas interessantes gestolpert (und werde hier ein bisschen zitieren, ich hoffe das ist in Ordnung und erlaubt) &#8211; Im Artikel &#8220;<strong>Der E-Postbrief: Post Scriptum</strong>&#8221; auf <a href="http://gutjahr.biz/blog/2010/07/post-scriptum/">http://gutjahr.biz/blog/2010/07/post-scriptum/</a> zeigt der Author einen Brief der Post, in welchem es mir um folgende Auszug geht:<br />
<span id="more-803"></span><br />
<b>Zitat:</b></p>
<pre>
Die Inhalte der Nachrichten werden verschlüsselt abgelegt. Es ist nicht möglich – auch nicht für die Systemadministratoren – die Inhalte einzusehen. Das gesamte technische und organisatorische Sicherheitssystem ist so aufgebaut, dass die Vertraulichkeit der Nachrichten gewährleistet ist.
</pre>
<p><em>Quelle: <a href="http://gutjahr.biz/blog/2010/07/post-scriptum/">http://gutjahr.biz/blog/2010/07/post-scriptum/</a></em></p>
<p>.</p>
<p>Hier musste ich etwas die Stirn runzeln. Diese Aussage &#8220;Es ist nicht möglich&#8221; brachte mich zu der Idee, mal zu überlegen wie man etwas solches realisieren könnte. Ich komme zu dem Schluß, mir wäre es nicht möglich. Eine eMail die ankommt oder ein Text der in einer Art Webmail gespeichert wird, könnte verschlüsselt auf einer Festplatte gespeichert werden &#8211; Die Daten die zum Entschlüsseln notwendig sind, müssen aber auch irgendwo gespeichert werden. Jeder der Zugriff auf diese Daten hat (Sei es bei einem Eingriff, oder sei es ein Systemadministrator), kann auch die eMails entschlüsseln und somit die Inhalte lesen. Wenn ich ganz viele Mitarbeiter habe, könnte ich vielleicht sagen das es Systemadministratoren gibt, die Zugriff auf die Entschlüsselungsdaten haben, aber keinen auf die Mails und umgekehrt. Aber das würde den administrativen Aufwand erheblich erhöhen und ich kann mir nicht vorstellen das es so in einem großen Unternehmen, gelöst werden würde (Ich kann mich hier aber irren). Wie auch immer &#8211; Spätestens wenn eine solche eMail ausgedruckt wird, muss sie entschlüsselt werden.</p>
<p><em>Weiter:</em> Dank des Mediums Internet, ist es möglich, Verbindungen zu &#8220;sniffen&#8221; das heisst, ein Systemadministrator der die Verbindung überwacht, und jeder der halbwegs fit im Internet ist und eine Verbindung mitsnifft, könnte an die Inhalte der Mail kommen (sofern es nicht über Techniken wie SSL läuft).</p>
<p><em>Weiter</em>: Würde ich eine solche Lösung bauen, und Postfix nutzen, würde ich eingehende eMails durch einen Filter laufen lassen, so wie amavisd, postgrey und ähnliches &#8211; Nur das dieser Filter die eMails vor der Zustellung an den naechsten Service (dovecot/lokale Zustellung (also Speicherung auf der Festplatte)), mit GPG verschlüsseln würde &#8211; Jeder Systemadministrator der dann in den Mailqueue schaut, kann an die Inhalte von diesen eMails kommen, bevor sie verschlüsselt werden. Mir ist kein Weg bekannt (es sei denn man nutzt ein eigens programmiertes Interface  ohne Umweg über einen Mailserver &#8211; Vielleicht fehlt mir hier aber auch das Wissen um andere Mailserver, ich kenn und kann ja nur Postfix &#8211; Vielleicht könnte man sich extra dafür auch einen eigenen programmieren) um sowas direkt verschlüsselt zu speichern.</p>
<p>Meiner persönlichen (eigenen freien) Meinung nach, vermittelt eine solche Aussage (Zitat: &#8220;Es ist nicht möglich – auch nicht für die Systemadministratoren – die Inhalte einzusehen&#8221;) ein Sicherheitsgefühl, wo keines sein sollte &#8211; Dafür sind die Faktoren einfach zu unbekannt. Aber das ist wie gesagt, nur meine eigene Meinung.</p>
<p>Hmhm. Ich muss sagen, ich find&#8217;s trotzdem interessant und überlege mir da nen Account anzulegen bzw eine &#8220;Reservierung&#8221; so das ich das mal antesten kann. Jedoch, würde ich bei Dingen die nicht jeder lesen soll, immernoch auf den alten Postweg zurückgreifen, oder lieber direkt meine eMail per GPG Verschlüsselung an den Empfänger senden (Clientseitige Verschlüsselung ist das einzig sichere im Netz, meiner persönlichen Meinung nach.)</p>
<p>So long,<br />
Jean</p>
]]></content:encoded>
			<wfw:commentRss>http://jeanbruenn.info/general_epost-briefgeheimnis-admin-sicht.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy Sysadmin Day</title>
		<link>http://jeanbruenn.info/general_happy-sysadmin-day.html</link>
		<comments>http://jeanbruenn.info/general_happy-sysadmin-day.html#comments</comments>
		<pubDate>Fri, 30 Jul 2010 18:12:54 +0000</pubDate>
		<dc:creator>jean</dc:creator>
				<category><![CDATA[The daily insanity]]></category>

		<guid isPermaLink="false">http://jeanbruenn.info/?p=800</guid>
		<description><![CDATA[Happy Sysadmin Day to all the various sysadmins around in the world :-) http://www.sysadminday.com/]]></description>
			<content:encoded><![CDATA[<p>Happy Sysadmin Day to all the various sysadmins around in the world :-)</p>
<p><a href="http://www.sysadminday.com">http://www.sysadminday.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jeanbruenn.info/general_happy-sysadmin-day.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bookmarks</title>
		<link>http://jeanbruenn.info/general_bookmarks.html</link>
		<comments>http://jeanbruenn.info/general_bookmarks.html#comments</comments>
		<pubDate>Mon, 21 Jun 2010 09:50:36 +0000</pubDate>
		<dc:creator>jean</dc:creator>
				<category><![CDATA[The daily insanity]]></category>

		<guid isPermaLink="false">http://jeanbruenn.info/?p=795</guid>
		<description><![CDATA[Sometimes i&#8217;m searching some old pages i&#8217;ve found, for example things about CSS3, etc. Then i remembered Sven was using some webservice for that, which is storing his bookmarks &#8211; After googleing a bit i decided to give google-bookmarks a try :) I don&#8217;t understand why there&#8217;s always &#8220;by Anonymous&#8221; but well, it seems to [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes i&#8217;m searching some old pages i&#8217;ve found, for example things about CSS3, etc. Then i remembered Sven was using some webservice for that, which is storing his bookmarks &#8211; After googleing a bit i decided to give google-bookmarks a try :) I don&#8217;t understand why there&#8217;s always &#8220;by Anonymous&#8221; but well, it seems to work fine, here&#8217;s the list:<br />
<span id="more-795"></span><br />
<a href="https://www.google.com/bookmarks/l#!threadID=GD9B3M9dE3bg%2FBDcl_3woQp4uhv5Ul">Link to my Google Bookmarks</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jeanbruenn.info/general_bookmarks.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>100% height, 100% width, floated divs in CSS :-)</title>
		<link>http://jeanbruenn.info/general_100-height-100-width-floated-divs-in-css.html</link>
		<comments>http://jeanbruenn.info/general_100-height-100-width-floated-divs-in-css.html#comments</comments>
		<pubDate>Wed, 09 Jun 2010 23:09:02 +0000</pubDate>
		<dc:creator>jean</dc:creator>
				<category><![CDATA[The daily insanity]]></category>

		<guid isPermaLink="false">http://jeanbruenn.info/?p=787</guid>
		<description><![CDATA[While browsing through the web, i saw a lot people asking how to make a 100% height and 100% width layout with floating div&#8217;s. Some people answered &#8220;it&#8217;s not possible&#8221; &#8211; Hehe. Yes, just because &#8220;one guy&#8221; doesn&#8217;t know how to do something, it&#8217;s impossible. Sometimes i&#8217;d wish such people wouldn&#8217;t answer such questions at [...]]]></description>
			<content:encoded><![CDATA[<p>While browsing through the web, i saw a lot people asking how to make a 100% height and 100% width layout with floating div&#8217;s. Some people answered &#8220;it&#8217;s not possible&#8221; &#8211; Hehe. Yes, just because &#8220;one guy&#8221; doesn&#8217;t know how to do something, it&#8217;s impossible. Sometimes i&#8217;d wish such people wouldn&#8217;t answer such questions at all :) However, back to topic: The Solution is quite easy. Take a look at the following page, and also keep a look at the sourcecode of it, i tried to format it well and easy to understand. </p>
<p><a href="http://www.jeanbruenn.info/test.html">Example</a></p>
<p>I tested it in Firefox 3 and Internet Explorer 8. Might be that it won&#8217;t run in every browser correctly. But thats a usual problem &#8211; By the way, in IE you might have a scrollbar cause of the height. There&#8217;s a fix for it but i don&#8217;t remember that one. That was setting a negative margin to the height or something. A shame that i forgot it. However, hopefully this snippet is helpful to someone :)</p>
]]></content:encoded>
			<wfw:commentRss>http://jeanbruenn.info/general_100-height-100-width-floated-divs-in-css.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Video Repairing and Re-Encoding in Linux</title>
		<link>http://jeanbruenn.info/video_video-repairing-and-re-encoding-in-linux.html</link>
		<comments>http://jeanbruenn.info/video_video-repairing-and-re-encoding-in-linux.html#comments</comments>
		<pubDate>Wed, 09 Jun 2010 09:13:49 +0000</pubDate>
		<dc:creator>jean</dc:creator>
				<category><![CDATA[Videos and more]]></category>

		<guid isPermaLink="false">http://jeanbruenn.info/?p=782</guid>
		<description><![CDATA[I think i wrote a few times how someone could do this, once in German, once in English and i never finished writing this Article because one could fill a book by just explaining and doing this. However, let&#8217;s try again, maybe I&#8217;m making this one public. I&#8217;m recording some movies over DVB-T, so that [...]]]></description>
			<content:encoded><![CDATA[<p>I think i wrote a few times how someone could do this, once in German, once in English and i never finished writing this Article because one could fill a book by just explaining and doing this. However, let&#8217;s try again, maybe I&#8217;m making this one public.<br />
<span id="more-782"></span><br />
I&#8217;m recording some movies over DVB-T, so that i can watch them after work or if i come back from school. However, due to the nature of DVB-T such recorded videos are a bit buggy. What do i mean by buggy? Well, sometimes there are some artifacts, sometimes for just a second the whole picture looks like a pixel-ate filter is gone over it, sometimes the sound is not correct, sometimes there&#8217;s a green box, and sometimes there are even more glitches. Usually if a train drives through .. :) Thus before i work on such a video, i need to try to repair this video. Right after i repaired such a video, i can cut the video, to remove advertisement &#8211; and as i want to store such videos and watch them again i can re-encode them using x264 (video) and aac (audio) within an mp4 (the container) -> By doing that i could also add some filters to make the video look a bit better.</p>
<p><strong>Side note</strong>: Adding filters might improve the look of your video, but it&#8217;s technically not improving the video, it&#8217;s making the video worse, as due to the filters, some information are lost &#8211; So this might not be what you want)</p>
<h2>Repairing</h2>
<p>I think there are a few ways to &#8220;repair&#8221; a video, however &#8211; It&#8217;s not possible to repair everything. Sometimes movies are shown two or three times on TV &#8211; If you store all two or three of them, you might average the 3 videos. So for example: Make sure all 2 or 3 (the more the better) videos start at the same, equal frame. Make sure you removed the advertisement, because this might change from video to video &#8211; The 3 videos needs to be equal in frames and length (that&#8217;s really important). Now you run all 2 or 3 videos through mplayer with -vo md5 and store those information in separate files &#8211; Now with a little bit bash experience you can compare those 3 files line by line to find frames which aren&#8217;t equal. If you have 3 videos this is quite cool, because you have just to look for the case, where 2 md5sums are equal and you might have a big chance that that is the &#8220;correct&#8221; frame &#8211; or it&#8217;s in both cases broken. You could also script some little gtk application which is showing you the frames so that you could compare<br />
them manually. All frames which needs to be corrected, you&#8217;ll write into another file. Now the fun begins &#8211; Go through that new file (by another bash script) and export the specific frame of all 2 or 3 or the specific video as pictures. Now use ImageMagick or something else to average the picture. The next steps should be clear, you just need to use your corrected image now. This could be done if you export one whole video to images &#8211; and then you just replace the specific image with the newly created one, or you use avisplit, avimerge and or mencoder to split the video into two parts, insert the image as frame, merge the second part again. Just as you like. </p>
<p><strong>Side note</strong>: If you have only two videos, and even with three or more videos, the problem with the &#8220;averaging&#8221; solution is, that you don&#8217;t know automatically which frame is the correct one and which is the broken one. So if you want to be sure, you need to check every frame manually. Which might be a lot of work &#8211; If you don&#8217;t and if the script detects a mismatching md5sum, you might average a correct frame with a broken frame. However, this is as far as i know the only thing you could do if you have artifacts or blocky parts in a video. By the way: I&#8217;m not using this. I was thinking about it but recording the same video three times is.. Well :)</p>
<p>Some other ways to repair such a video &#8220;stream&#8221; is the use of tools like ProjectX, which does a great job. In my humble opinion the most useful (at least for my videos) way of repairing such a video (or atleast trying to) is to run ProjectX onto the recorded mpeg. This will demux the video and try to repair a lot. After you did that, you&#8217;re using mplex to re-mux the video files. After doing that you use ffmpeg to convert your mpeg(mpeg1/2) to avi(mpeg4) by using <em>-sameq</em> and <em>-vsync 1</em> &#8211; This way green boxes gets removed, if there are any. Another approach which i found in some DVB Wiki is using mencoder in the following way: <em>mencoder -forceidx -lavdopts er=4 -vc ffmpeg12 -of mpeg -oac copy -ovc copy original_ps.mpeg -o cleaned_ps.mpeg</em> So this might help you, also.</p>
<p><strong>Side note</strong>: Do yourself a favour and don&#8217;t use this command &#8211; At least not without exactly knowing what it does. If you use it you&#8217;ll run into a few problems which have to do mostly with audio. Because: It seems to correct mpeg errors quite good, but if in your video someone is talking, and there&#8217;s some video glitch, though sound is okay, running this command will make the sound miss something. So &#8211; You might end up with someone talking in your video without finishing the sentence -<br />
Why? I don&#8217;t know. Another problem i run into using this mencoder thingy was a/v sync. It seems in some rare cases using this will result in terribly a/v sync. So.. This command won&#8217;t get my suggestion :)</p>
<p><em>Let&#8217;s put it altogether, my way to repair/clean a dvb-recorded mpeg file is:</em></p>
<pre>
java -jar ProjectX.jar -demux file.mpg
mplex -f 8 -o muxed.mpg file.m2v file.mp2
ffmpeg -i muxed.mpg -vcodec mjpeg -sameq -vsync 1 -acodec copy repaired.avi
</pre>
<p>Finally you can use avidemux to remove advertisement, do that manually, select copy for both audio and video, select avi, if it asks you whether to use smart-copy say yes, and let the quantizer at the default value of 4 &#8211; Just save it as cutted.avi. You might also skip the ffmpeg part and do the avidemux part right after mplex &#8211; use mpg then and save as mpeg ps a+v.</p>
<p>That&#8217;s all. Let&#8217;s look at the file sizes. The original video got a file size of 2,6 GB (2675976). The muxed.mpg got a file size of 2,6 GB (2672448) &#8211; The repaired avi is a lot bigger (why i don&#8217;t know) 4.2 GB &#8211; And the cutted variant got 1,7 GB. This is still much, for one video in my humble opinion &#8211; And exactly this, brings us to the next topic.</p>
<p><strong>Side note</strong>: To achieve the highest possible Quality, don&#8217;t do anything with your video, let it as it is. Probably just run it through projectx and mplex. And, if you want Quality, you shouldn&#8217;t care about file size. I&#8217;m a bit special, i want quality and a good file size, so i have to find a little compromise between both :)</p>
<h2>Re-Encoding / Filtering</h2>
<p>Right after a video is repaired/cleaned and cutted we can re-encode it to use another codec for video and audio and to find a nice home in some of the various container formats which are available. I don&#8217;t know why but i&#8217;m a big fan of h264, aac and mp4. Other people might like xvid, ogg and mkv (i don&#8217;t know whether that works together, never worked a lot with those) however &#8211; if you want to read more about the various codecs and containers, take a look at the mplayer documentation, there are a lot of codecs explained, more or less, i really like the mplayer documentation, probably a bit out of date, and sometimes not that easy to understand, but well &#8211; it&#8217;s good enough for what i need. However, when encoding a video we can do some<br />
filtering also, like cropping black borders, blurring a bit, scaling, etc. So we have to talk about a bit more than just the encoding<br />
process. Let&#8217;s start with the Aspect Ratio and Cropping. </p>
<h3>Aspect Ratio</h3>
<p>All movies I&#8217;m watching are recorded at a resolution of 720&#215;576. One of them gets scaled to 768&#215;576 (1.33:1) and thus is 4:3. Another one is scaled to 1024&#215;576 (1.78:1) and thus is 16:9. Now there&#8217;s something special: a) i want all videos at 16:9. b) some movies have black borders around them, if we remove those, we have a totally different aspect ratio. c) after the cutting, sometimes the movie is switching the aspect ratio because of the advertisement which was in. I have to remove this.</p>
<p>So let&#8217;s work through this one by one. First of all, a way to &#8220;force&#8221; the aspect ratio and height and width:</p>
<pre>-vf dsize=16/9,scale=720:576</pre>
<p>Now let&#8217;s detect whether we need to crop black borders out. You can do this with the cropdetect filter, just run <em>mplayer yourvideofile.avi -vf cropdetect</em>. It will give you some crop line &#8211; scroll to a scene which is quite bright, so that it detects the black borders correctly. if needed adjust the value but make sure height and width are multiples of 16.</p>
<p>For example, my first movie is in 16:9 format already, and got 720&#215;576. Cropdetect shows this line:</p>
<pre>-vf crop=720:560:0:10</pre>
<p>So it wants to remove 16px from the height &#8211; the 10 in the end just tells where the stuff is removed &#8211; 10 means, it&#8217;s picking 10 px from the top. so the last 6 px will be taken from the bottom. If we want it more in middle, you could use 8 instead of 10. So our whole line looks like:</p>
<pre>-vf crop=720:560:0:8,dsize=16/9,scale=720:576</pre>
<p>which will crop the video to 720x560px, set the aspect ratio to 16:9 and scale the video to 720&#215;576 (the original) &#8211; as we remove only 16px this scaling isn&#8217;t noticeable i&#8217;d say.</p>
<p>Now let&#8217;s take a look at 4:3 videos. The following line, will do what we want:</p>
<pre>-vf crop=704:464:10:32,dsize=16/9,scale=720:576</pre>
<p>We&#8217;re in simply just removing the black borders from left and right (16px) and then we&#8217;re cropping the height to 464 &#8211; then we change the aspect ratio and scale it to 720&#215;576 &#8211; voila&#8217;</p>
<p><strong>Side note</strong>: Changing the Aspect Ratio doesn&#8217;t work loss less as far as i know without having extremely &#8220;stretched&#8221; videos &#8211; You might add black borders, but black borders are bad for efficiency and compression of videos, so this is not what you want. It&#8217;s better to leave the aspect ratio as is, instead of changing from 4:3 to 16:9, however the opposite, changing from 16:9 to 4:3 is quite easier and not so problematic.</p>
<h3>Additional Filters</h3>
<p>Now we&#8217;re coming to the interesting part :) At least i think this topic is quite interesting. However, i don&#8217;t want to explain them here as you can watch what they&#8217;re doing by taking a look at the man page of mplayer. So I&#8217;ll just give an overview about which settings i use:</p>
<pre>-vf yadif=0,hqdn3d=4:3:4,pp=hb/vb/dr,harddup</pre>
<p>yadif is a de-interlacer, doesn&#8217;t seem to hurt if pictures aren&#8217;t interlaced, hqdn3d is a high quality denoiser (so it&#8217;s blurring the<br />
image), pp is a postprocessingfilter in this case using horizontal deblocking and vertical deblocking and deringing and harddup i just use so that a/v sync will be fine &#8211; The resulting video looks quite good. You could also give gradfun a try or use hqdn3d=6:4:6 though this is a bit much in some cases.</p>
<p><strong>Side note</strong>: I got sometimes good results when using automatic brightness using al:f of the pp filters, however &#8211; in other cases the video looks too bright or too dark, and on my TV it&#8217;s looking differently than on my computer, thus don&#8217;t play around with that one. Another thing: I used to use pullup and softskip as the first two options, but somehow i got a feeling that this isn&#8217;t needed.. Anyway. Now you know which filters might be useful to you.</p>
<p><strong>Another Side note about Re-Encoding</strong>: I used to download once a movie from a on-line recording site, because my local setup wasn&#8217;t working &#8211; The movie which i later downloaded had crappy quality. I was really disappointed about it &#8211; I already think i have bad quality if there are some glitches but that thing was just awful. While other people might<br />
like that and are fine with that, I&#8217;m not. So what did i do? I run the whole movie through: <em>mplayer movie.avi -sws 9 -vf<br />
yadif=0,crop=640:352:0:4,dsize=16/9,scale=720:576,hqdn3d=4:3:4,pp=hb/vb/dr/al:f</em> And voila&#8217; the video looked useful. It&#8217;s a) deinterlacing if needed.. b) up scaling, c) denoising, d) deblocking and deringing, e) automatic brightness and contrast.</p>
<h2>x264</h2>
<p>x264 offers a lot of settings and comes with presets, the only settings i use are:</p>
<pre>--preset slower --bframes 16 --ref 4 --crf 18</pre>
<p>Just to give you an example, how i use this:</p>
<pre>time x264 --preset medium --tune film --bframes 16 --ref 4 --crf 18 --output output.264 --no-fast-pskip video.y4m 2&#038;gt:x264.log &#038; mplayer cutted.avi -vo yuv4mpeg:file=video.y4m -benchmark -sws 10 -vf yadif=0,pp=ha/va/dr/al:f,crop=720:560:0:8,dsize=16/9,scale=720:576,hqdn3d=3:2:3,gradfun=1.2,harddup -nosound</pre>
<p><strong>Side note</strong>: You might want to tune those settings, it took 212 Minutes to encode a video using these settings (2x2GHz, 3GB Ram) i guess a lot of time is eaten due to the pp-filter (usually i use it without pp, depending on the video i use 3:2:3 or something else at hqdn3d and crf 16-20)</p>
<p><strong>Additional Side note</strong>: It seems that sometimes the fifo isn&#8217;t working, remove the fifo using rm, mkfifo it again, wait 3 seconds and try again. I don&#8217;t know whats causing this. Take also a look at the various settings for x264, you might achieve better results than i. Some pages also state you have to add &#8211;fps25 and the width/height of the video, which I&#8217;m not doing in x264 as you can see, because it seems to work without that.</p>
<h2>The Sound</h2>
<p>I wrote an article about sound recently, how to turn stereo sound into surround sound (of course this is technically not &#8220;exactly&#8221; working) however, for this videos i won&#8217;t make myself the work, i just want to have the sound as is in AAC format. So I&#8217;ll dump it first from the latest created video file (cutted.avi), normalize it and then I&#8217;ll convert it to AAC using the following commands:</p>
<pre>mplayer -ao pcm:fast -vc null -vo null -benchmark cutted.avi
normalize audiodump.wav
faac -q 100 -c 48000 --mpeg-vers 4 audiodump.wav</pre>
<p>There you go. Let&#8217;s take a look at the file size: </p>
<p>original mp2: 114 MB<br />
normalized pcm: 908 MB<br />
our new aac: 78 MB</p>
<p>So&#8230; And &#8211; it sounds like the same, the quality seems to be equal.</p>
<p><strong>Side note</strong>: Make sure your DVD player and/or equipment where you want to play the video later on, can do aac/x264. If your DVD player for example can&#8217;t you just wasted time :) You could also use ogg/vorbis, most players should be able to use that. To do so, do the same as above, except for the faac line, instead use: oggenc -R 48000 -q 10 -C 2 audiodump.ogg &#8211; Take also a look at the man page. :) Ah &#8211; And if you want to use ac3 instead of that, you might try: aften</p>
<h2>Creating the Container</h2>
<p>Now, as we good the sound and the video file processed, we should place them together into a little nice container. I&#8217;m using mp4 for that, someone else might want to use mkv or something else :)</p>
<pre>MP4Box -fps 25 -add output.264 -add audiodump.aac movie.mp4</pre>
<p>Yes! That&#8217;s all, that was it. :)</p>
<p><strong>Side note</strong>: Right after packing it into mp4 you noticed that there&#8217;s a delay of 200ms in audio/video? Allright: You can export the stuff from the mp4, and add them right again with -delay. For example: <em>MP4Box -raw 2 movie.mp4</em>. You will want to use 1 and 2 to get audio and video out of the mp4. There might be more. Right after exporting it, do: <em>MP4Box -add movie.h264 -add movie.aac -delay 2=200 test.mp4</em> and verify that test.mp4 works as expected.</p>
<p>File size of the mp4? 762 MB &#8211; Compared to the original 2,6 GB this is quite cool for a 90 Minutes video.</p>
<h2>Another variant in shortform</h2>
<p>The video from the online recorder. Cutted the video got a size of 170 MB. It&#8217;s 640x360px, divx (dx50, 25fps, 441.0 kbps) and mp3 with 128 kbit &#8211; So quite low quality. probably good for network streaming or some portable thingy.</p>
<p>I&#8217;m checking first using mplayer which filters might be useful to improve the quality and higher the resolution of that video. I came to the result that the following settings will do what i want:</p>
<pre>yadif=0,crop=640:352:0:4,dsize=16/9,scale=720:576</pre>
<p>this will deinterlace (doesnt hurt if not interlaced), scale it up to 720:576 and you will see some artifacts and blocky pictures. So the next step is to add some denoising, deblocking and deringing filters:</p>
<pre>-vf yadif=0,crop=640:352:0:4,dsize=16/9,scale=720:576,hqdn3d=3:2:3,gradfun=2,pp=ha/va/dr</pre>
<p>this does a quite good job. it will do the above explained things + denoise it, fix and dither banding artifacts, deblock and dering the video. Now we can do something with the brightness and contrast by adding al:f to the pp= list &#8211; This will make it a bit too dark for someones feeling but reduce additional &#8220;glitches&#8221; (let me use this word for blocky pixels, artifacts and similar stuff) and make the video look a bit more nicer compared to the original. Though the whole video looks a little bit unsharp now in some situations. So let&#8217;s add -sws 9 and change our -vf line to:</p>
<pre>-sws 9 -vf yadif=0,crop=640:352:0:4,dsize=16/9,scale=720:576,hqdn3d=3:2:3,gradfun=2,pp=ha/va/dr/al:f,unsharp=l3x3:0.7</pre>
<p>Of course.. The video doesn&#8217;t look like if it would have been recorded at that resolution but it looks similar and looks better than the original.</p>
<p><strong>Side note</strong>: Remember, everytime you&#8217;re re-encoding, you&#8217;re losing more information. And everytime youre using filtering like gradfun, denoise, deblock, etc &#8211; you&#8217;re stripping additional information from the video or you&#8217;re modifying (thus loseing) them. So, even if the movie looks now a lot better, technically the movie is worse than the original.</p>
<p><strong>So.. Step 1 &#8211; Create the fifo (1second?)</strong></p>
<pre>mkfifo video.y4m</pre>
<p><strong>Step 2 &#8211; Start the encoding (108 minutes)</strong></p>
<pre>time x264 --preset medium --tune film --bframes 16 --ref 4 --crf 20 --output output.264 video.y4m --no-fast-pskip 2&gt;x264.log &#038;  mplayer movie.avi -vo yuv4mpeg:file=video.y4m -benchmark -sws 10 -vf  yadif=0,pp=ha/va/dr/al:f,crop=640:352:0:4,dsize=16/9,scale=720:576,hqdn3d=3:2:3,gradfun=1.2,unsharp=l3x3:0.7,harddup -nosound</pre>
<p><strong>Step 3 &#8211; Dump the Audio ( a few seconds)</strong></p>
<pre>mplayer -ao pcm:fast -vc null -vo null -benchmark cutted.avi</pre>
<p><strong>Step 4 &#8211; Normalize the Audio ( a few seconds )</strong></p>
<pre>normalize audiodump.wav</pre>
<p><strong>Step 5 &#8211; Convert it to AAC (2 minutes, 56 seconds)</strong></p>
<pre>time faac -q 100 -c 48000 --mpeg-vers 4 audiodump.wav</pre>
<p><strong>Step 6 &#8211; Create the MP4 (a few seconds)</strong></p>
<pre>MP4Box -fps 25 -add output.264 -add audiodump.aac movie5.mp4</pre>
<h3>Result</h3>
<p>431 MB file size. Quality is okay, some artifacts if there is text, sometimes a bit dark. &#8211; at least it&#8217;s looking better than the original, if i watch it in fullscreen on my widescreen tft.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeanbruenn.info/video_video-repairing-and-re-encoding-in-linux.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Impressed (or not) by an iPhone (or by an iPhone App)</title>
		<link>http://jeanbruenn.info/general_impressed-or-not-by-an-iphone-or-by-an-iphone-app.html</link>
		<comments>http://jeanbruenn.info/general_impressed-or-not-by-an-iphone-or-by-an-iphone-app.html#comments</comments>
		<pubDate>Tue, 08 Jun 2010 10:02:51 +0000</pubDate>
		<dc:creator>jean</dc:creator>
				<category><![CDATA[The daily insanity]]></category>

		<guid isPermaLink="false">http://jeanbruenn.info/?p=775</guid>
		<description><![CDATA[I really really really love asian movies, so usually if they&#8217;re on TV, i record them. Recently there was a Movie which i somehow liked, sometimes a bit weird but overall i liked it, and the music in it is quite cool. I wanted to know from whom that music is so that i could [...]]]></description>
			<content:encoded><![CDATA[<p>I really really really love asian movies, so usually if they&#8217;re on TV, i record them. Recently there was a Movie which i somehow liked, sometimes a bit weird but overall i liked it, and the music in it is quite cool. I wanted to know from whom that music is so that i could get that. </p>
<p>Michael, a clanmate and friend told me that i could use an iPhone and Shazam to detect this song. So i exported some music from the movie, and let him try with his glory iPhone and shazam. The first result was something with japanese letters. The next one was &#8220;goodbyes by unknown&#8221; &#8211; However, the original title, it didn&#8217;t detect. Michael gave up with the comment &#8220;Well, probably too unknown&#8221; &#8211; Before this mess i told him &#8220;i bet this won&#8217;t work&#8221; &#8211; I won :)</p>
<p>However, i let him try three different songs, which are more known: Rise Against, Dancing for Rain || Pennywise, is anyone listening || Within Temptation, Our solemn Hour.</p>
<p>Shazam was able to detect all three. So this seems to be a quite good app for known songs which are in their database.</p>
<p>By the way, the song&#8217;s here: <a href="http://www.youtube.com/watch?v=yG8nOT_2i0Q"> out of the movie &#8220;Professional, Story of a Killer&#8221; original title &#8220;One last dance&#8221; or the Song title &#8220;Broken Orange&#8221;</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeanbruenn.info/general_impressed-or-not-by-an-iphone-or-by-an-iphone-app.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New old Layout, new plugin :)</title>
		<link>http://jeanbruenn.info/general_new-old-layout-new-plugin.html</link>
		<comments>http://jeanbruenn.info/general_new-old-layout-new-plugin.html#comments</comments>
		<pubDate>Sat, 22 May 2010 15:01:43 +0000</pubDate>
		<dc:creator>jean</dc:creator>
				<category><![CDATA[The daily insanity]]></category>

		<guid isPermaLink="false">http://jeanbruenn.info/?p=768</guid>
		<description><![CDATA[I just updated my blog a bit, removed not needed plugins, updated out-of-date plugins, installed a new plugin (which is by the way awesome, &#8220;Now Reading Reloaded&#8221; which was originally written by Rob Miller &#8211; This &#8220;reloaded&#8221; variant was written/rewritten by Ben Gunnink. I modified the templates a lot to fit into this blog, however [...]]]></description>
			<content:encoded><![CDATA[<p>I just updated my blog a bit, removed not needed plugins, updated out-of-date plugins, installed a new plugin (which is by the way awesome, &#8220;Now Reading Reloaded&#8221; which was originally written by <a href="http://robm.me.uk/">Rob Miller</a> &#8211; This &#8220;reloaded&#8221; variant was written/rewritten by <a href="http://heliologue.com/">Ben Gunnink</a>. I modified the templates a lot to fit into this blog, however i guess it was worth the work. I came to the idea of this plugin by just visiting <a href="http://tshw.de">Till&#8217;s Blog</a> who&#8217;s using this &#8220;library&#8221; for some time &#8211; And i always wanted to have something like that to write about the books i&#8217;m reading.</p>
<p>I also switched back from my green layout (which i still like) to this lighty layout &#8211; I really really like this one, the only disadvantage is, if you show a lot of code like i, there&#8217;s not enough place. You got only like 330 px width for your code.. Anyhow. I also played a bit around with the Amazon Partner Net Widget&#8217;s and added the mp3 widget to my blog. Pity that it&#8217;s just a preview of 30 seconds, however it&#8217;s looking nice :)</p>
]]></content:encoded>
			<wfw:commentRss>http://jeanbruenn.info/general_new-old-layout-new-plugin.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Göttin auf Zeit. Amitas Kindheit als Kumari in Kathmandu</title>
		<link>http://jeanbruenn.info/books_gottin-auf-zeit-amitas-kindheit-als-kumari-in-kathmandu.html</link>
		<comments>http://jeanbruenn.info/books_gottin-auf-zeit-amitas-kindheit-als-kumari-in-kathmandu.html#comments</comments>
		<pubDate>Fri, 21 May 2010 09:18:09 +0000</pubDate>
		<dc:creator>jean</dc:creator>
				<category><![CDATA[Books]]></category>

		<guid isPermaLink="false">http://jeanbruenn.info/?p=747</guid>
		<description><![CDATA[Sehr interessantes Buch, wenn auch nicht das, was ich normalerweise lesen würde. Mir gefiel das Cover und ich fand die Beschreibung bei Amazon recht interessant, also dachte ich mir warum nicht, fuer 5,20 (gebraucht, wie neu) inkl. Versandkosten war das ja nun auch nich so teuer. Das Buch hat definitiv meine Kaufempfehlung und ich finde [...]]]></description>
			<content:encoded><![CDATA[<p>Sehr interessantes Buch, wenn auch nicht das, was ich normalerweise lesen würde. Mir gefiel das Cover und ich fand die Beschreibung bei Amazon recht interessant, also dachte ich mir warum nicht, fuer 5,20 (gebraucht, wie neu) inkl. Versandkosten war das ja nun auch nich so teuer. Das Buch hat definitiv meine Kaufempfehlung und ich finde es schade, das es nur noch als &#8220;Restexemplar&#8221; zu haben ist &#8211; Allerdings kaufen es sich vielleicht gerade deswegen noch ein paar Menschen so wie ich &#8211; Es ist das Geld wert :-)<br />
<span id="more-747"></span><br />
<strong>Göttin auf Zeit.</strong> <i>Amitas Kindheit als Kumari in Kathmandu</i></p>
<p style="margin: 0pt 10px 10px; padding: 0pt 5px 5px; float: right; display: inline"><a href="http://www.amazon.de/gp/product/3453120337?ie=UTF8&#038;tag=jeanwebl-21&#038;linkCode=as2&#038;camp=1638&#038;creative=6742&#038;creativeASIN=3453120337"><img border="0" src="http://www.jeanbruenn.info/book_amita_goettinaufzeit.jpg" style="border: 1px solid #000000; width: 105px; height: 160px" border="0"/></a><img src="http://www.assoc-amazon.de/e/ir?t=jeanwebl-21&#038;l=as2&#038;o=3&#038;a=3453120337" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p>
<p><em>In dem Buch &#8220;Göttin auf Zeit&#8221; von G. Haase-Hindenberg geht es um Amita, welche als Kind im Alter von 3 Jahren förmlich aus dem vertrauten Elternhaus gerissen wurde um als Gottheit für einen festgelegten Zeitraum, für die dortigen Menschen, zu leben.</p>
<p>Mir ist unklar ob das Buch fröhlich/glücklich oder traurig ist; Eigentlich ist es sehr traurig weil das Mädchen aus der gewohnten Umgebung gerissen wird, nur um ein paar Jahre später in dieselbe, dann total fremde Umgebung zurückgeschubst zu werden, quasi fallen gelassen wie eine heiße Kartoffel. Auf der anderen Seite erlebt das Kind auch viele schöne Dinge und manchmal kann man beim Lesen gar nicht anders als sich zu denken &#8220;Ach wie Süss&#8221; &#8211; Und alles in allem geht es der Kleinen ja auch nicht &#8220;so schlecht&#8221;.</em></p>
<p><br style="clear: both;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://jeanbruenn.info/books_gottin-auf-zeit-amitas-kindheit-als-kumari-in-kathmandu.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
