tags: Fedora

Elastic movie encoding farm backed by AWS EC2 SpotFleet

Background: How do you keep your recordings ?

Recording TV into HDD is common use today. In addition to tech-savvies, many non-professional people always uses hdd recording. In Japan, almost all TV programs provided with MPEG2-TS. With Full HD qualiy, its bandwidth is going to be 12-20 Mbps. It seats roughly 20GB disk space when you are going to save 2 hours movie or sports program. As a result, many people suffer from a lot of occupied space in home’s hdd space. Including me. Some broadcast company may deny, but it is definitely true that stored movie is the part of his memory. He wants to keep them as long as possible. Saving them to HDD or cloud: seems straight forward, but not works.

Most easy and straight forward solution is move your recordings into another bulk HDD or cloud storage. But as a result of a few years activity, data size of your recordings may grow 10-50 TB. Many people are going to offload their recordings into monthly fixed rate cloud storage, so customer who do not pay much consumes a large part of storage capacity. It greatly exceeds cloud vendor’s forecast. I’ve heard that some user ware going to save 70TB data into cloud storage. Today, almost all cloud vendor declines monthly fixed rate cloud backup solutions and offers only “pay as you go” plans. Storing your recordings into bulk hdd is more reasonable from viewpoint of cost. But your huge recordings wastes your time so much. When you are going to move some “old” recordings into bulk hdd, it consomes a lot of time (It sometimes takes several days). When you’ve completed to move your old recordings, you may start to think about how to keep your backup healthy and can be read everytime. You may take a few hdd up into RAID in order to avoid data lost in case of HDD failure. As a result, you have to run several hdd 24365 in addition to main disks. These disks looks ugly, makes some noise in your home, and make your home some geeky(Your friends may put off from you !).

Motivation: Heuristic Compression

Movie compression is one of hot topic among tech domain. Recentry, they have released cutting-edge H.265 compression codec it archivess rouchly 90% compression rate compaired with MPEG2-TS. If you have 20TB movie archive, it gonna be 2TB ! Disadvantage about H.265 is extraordinary long compression time. When you’re going to compress 2h movie, it will take about 50-80 hours. Fortunately, almost all movie compression task can be separated and run in parallel and can takes your compression time shorter. So here comes a need for multicore and multinode processing environment. As you know, heuristic compression is quite efficient, but it requires a lot computing resources. Its hard to estimate how much computing resources are required to do it done, but I think that you can make sense about you need for elastic computing cluster to do that. (My estimation is written below of this article.)

Torque and AWS EC2 Spot Fleet

Adaptive computing is long providing TORQUE batch scheduler which make each single computer up as cluster computer, and provides user aggregated computing resources. You can find TORQUE can do for at http://www.adaptivecomputing.com/products/open-source/torque/ . AWS EC2 Spot Fleet is capable for taking several EC2 Spot Instance into elastic cluster. You may know that EC2 Spot Instance is provided as “spare” AWS’s computing capacity, so it is provided at discounted pricing. You can use relatively higher computing resource with reasonable cost. You can see about AWS EC2 Spot Fleet here http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet.html . I gonna mix them up.

The picture

Here is a picture I’ve compiled. Upper side show AWS. It consists from “API server” and “Encoding instances”. API Server acts as administrator of encoding servers and delivers certificate for each encoding instance in order to make VPN connection into my home. Lower side shows my home. TORQUE server and the data source is here. Nas provides source file to each encoding instance via VPN and receives compressed movie.

REST is modern RPC

When you’re going to take several instances properly configured, you have to communicate with each servers with proper manner, but your time is limited to develop actual code. You cannot choose complicated framework to do so. I believe that you want to make it easy about framework. Today, I think that REST API is most easy solution to communicate among each servers. REST uses http to communicate and you can call API with curl command. It’s super easy. On the server side, I use Flask( http://flask.pocoo.org/ ) to build API server. Flask is python library which can make api server so easy. You can write just 5 lines code and can work as http api server. I write two types of api server. 2. VPN certificate administrator I uses OpenVPN as VPS software. OpenVPN requires that each client should have unique certificate to make unique connection between server. So I have to manage which certificate is paid to instance, and which certificate has returned along with instance termination. 4. TORQUE computing node registrer TORQUE only has CLI interface to register/unregister incoming computing node for now. I’ve tweaked some REST api which receives http message from encoding instance and translate into CLI command to TORQUE server. I’ve successfully glued them up, and finally EC2 Spot instances starts working as a part of existing my home’s TORQUE cluster ! I’ve taken about 50 man hours at this point.

First run: take base info for estimation

I select AWS Ohio region as a place to expand spot instances. The reason is that Ohio region offers most cheap price about 4-core instance. AWS almost alway offers more cheap price against “previous generation” instance. At the first, I’ve played at North Virginia region, but it doesn’t offers previous generation 4-core instances and the price has frequentry changed. So I understand that N.Virginia region is so crowded and I cannot run computing jobs over 24 hours at there. Ohio region offers stable previous generation 4-core instances with cheap price and bidding price is more stable than N.Virginia. So I decide to play around at Ohio region. I decided to pay $0.03/hour per instance. Then, I’ve configured Spot Fleet and launched just one instance. I want to measure how long my computing task takes in order to estimate my budget to complete mission. Here is my first job execution time detail. This is the result of encoding roughly 2 hours movie.

  • Input Data Transfer: 18GB, 9 hours
  • Compression: roughly 30 hours
  • Output Data Transfer: up to 2.5GB, 1 hour

And Here is billing snapshot from AWS. * Data Transfer: $0.46 + $0.000 per GB - data transfer in per month: $0.00(45.294GB) + $0.000 per GB - first 1 GB of data transferred out per month: $0.00(1GB) + $0.090 per GB - first 10 TB / month data transfer out beyond the global free tier: $0.45(5.048GB)

  • Elastic Computing Cloud: $2.19

    • $0.0116 per On Demand Linux t2.micro Instance Hour: $0.58(50.254hrs)
    • c4.xlarge Linux/UNIX Spot Instance-hour in US East (Ohio): $1.19(45hrs)
    • EBS: $0.05 per 1 million I/O requests: $0.04(860,000IOs)
    • EBS: $0.05 per GB-month of Magnetic provisioned storage: $0.33(6.5GB-Mo)
  • Total: $2.68

Cost Estimation #1

So I can say that AWS costs about $3.00 per 2 hours encodings. Next, I gonna examine how many movies I have to compress. Along with my rough examination, I realised that I have roughly 1500 movies which have about 840 hours. So I can calcurate like this.

  • Total encoding time: 840 x (40(hrs) /2) = 16800 (hrs)

When I going to encode all of movies in reasonable time window, I should prepare like this.

  • Case1) 10 servers: 16800(hrs) / 10(svrs) = 1680(hrs) = 70 days
  • Case2) 20 servers: 16800(hrs) / 20(svrs) = 840(hrs) = 35 days

Hmm… 35 days encoding time(Case2) looks nice from my viewpoint. How much does it costs ? like this.

  • Case1): (70(days) * 24(hrs)) * ($3.00 / 2(hrs)) * 10(svr) = $25200.0
  • Case2): (35(days) * 24(hrs)) * ($3.00 / 2(hrs)) * 20(svr) = $25200.0

Damn. This cost is too huge to take for me.

Cost Estimations #2

Previous estimation is based on that encoding server have 4 vCPU(core). When I increased the number of vCPUs, I’ll not need a lot of servers. Ohaio Region also offers i2.8xlarge instance which have 32 vCPU and it can take 8 server’s task in 1 server. The price of i2.8xlarge is $0.83 per hour. Then, how much does it change costs ?

  • Encoding cost: 0.83 x 45(hrs) = $37.35 / 8(parallel) = $4.66 /cost per 2hours movie

Unfortunatelly, large size instance seems not help me so much.

Consequence

This trial shows possibilities for distributed computing cluster will help your piled-up recorded movies which sits in your storage. Unfortunately, heuristic compression on public cloud environment costs so much and your budget will not meet. I’ll try different approach and write about later. Stay tuned !

Fedora + XBMC = perfect media player and connected tv

I had used Boxee Box nearly one year and more, and it is so-so for my daily entertainment. I couldn’t enjoy Pandra and Netflix because I live in Japan, but it is acceptable for me. In any way, I feel that Boxee box is not a crap and useful for many person, but I’ll try to write down some reason why I’ve decide to walk away from Boxee box and started to seek alternative for those who seeks good connected media player like me.

1. Unstable web browser

Browser is most part I feel Boxee box needs to improve. When I enjoy 2 hours uStream programme, the browser of Boxee box never came back from the page of programme to home screen. I suspect that Boxee run out of its memory. I had to turn box off and on by hand to get it back to online. As my experience, the web page of Vimeo causes same problem.

The version of flash sometimes old to see some movie in web page. I cannot find how to update it to current version.

2. Not maintained community plug in

Some plugins are not maintained and don’t work with Boxee box. Plugin for Vimeo is one of example, but it is not special. Plugin for TuneIn radio had been able to work and fixed a few months later, but this case is one of fortunate example.

I don’t know why plugin doesn’t work is not maintained and still remains in their repository. I can suspect a few, for example “I had made this plugin but already not maintained for some reason(busy for work).”, “This plugin works well in my environment(sometimes development environment is different from others).”, and so on. Happy plugin sometimes find new maintainer who is different from original author and works it useful for many person, but this is not very common. When original author stops to improve plugin (or some software), it is abandoned in repository or author’s web page in many case…

I have to say again that Boxee box is good and remarkable product in connected TV world where some giant like Apple TV, Google TV, and Roku are playing. Giants have huge number of developer works inside, developer works outside for commercial(and sells their plugin for a few dollars or free). Their development kit is correctly maintained and plugin must go through their authorization process before it comes into market place. This is exact same QA process which they take it for smart phone in order for customer to experience perfect entertainment experience.

Boxee box and other boxee product try completely different environment for developer and consumer. Everyone can write their own plugin using Python and Boxee api. Consumer can add everywhere(URL) as third party repository and can install plugin which made by others. As a result, nobody can guarantee its quality of product.

Linux and some major linux distribution seems keeping good product quality, because they have some maintainer who works at near side of their repository and developer of each software , and finally decides which software should be included or not into their repository. I seem that Boxee lacks this administrative process(, but I don’t know their QA has improved or not now)…

OK. Here is the time to wipe tears and step forward. There is some product which works as media player in linux universe, but XMBC is most useful and highly comfortable as connected TV and media player for your own videos, musics, and sometimes pictures. Fortunately, XMBC is supported in most major linux distributions. I seems that XBMC development team works with Ubuntu distribution, but I decided to deploy XMBC with Fedora bacause I haven’t familiar with Ubuntu. For the Fedora and CentOS, RPMfusion supplies XBMC. So, you can add RPMfusion repository and hit “yum install xbmc”. This is super easy !

You can feel almost same experience with XBMC if you had used Boxee box. You can connect to your nas and play videos, musics, and pictures. You can add some plugins and enjoy network radio, YouTube, Vimeo, and Niconico Doga. If your box has HDMI output, you can connect into your tv in living room(I do.) and enjoy your videos in big screen like home theater.

When you want to see some web site, just launch Firefox or Chromium. It’s really easy. You can enjoy your favorite uStream programme with latest flash player.

You may think about some good remote control for XBMC like me. I’ve tried some remote keyboard and control gadget and uses Logitec K400R. Its weight is light enough and can controll XBMC function perfectly.

Enjoy your Sunday.

Make your own script with systemd

Recent linux system uses systemd instead of SysV init. So you cannot use /etc/rc.local for your housekeeping script with systemd, I’ve tried to migrate my own script with systemd environment. Here is my example which works one time per system startup.

1. make your own script(example: /root/synchome.sh

 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
#!/bin/sh
#
# my home directory
#
DAT=`date`
echo "script start $DAT" > /root/log
BKF=`find /mnt/nfs/flyback/flyback -mindepth 1 -maxdepth 1|grep -v lock|sort|tail -1`
# wait until autofs mount is ready
while [ "$BKF" = "" ]; do
   BKF=`find /mnt/nfs/flyback/flyback -mindepth 1 -maxdepth 1|grep -v lock|sort|tail -1`
done
if [ -d $BKF ] ; then
   DIRPRFX="/home/mkiuchi/"
   BKF=$BKF$DIRPRFX
   echo "source directory $BKF" >> /root/log
   rsync -auvz --delete --ignore-errors $BKF $DIRPRFX >> /root/log 2>&1
   # clean chromium lock file
   if [ -L "/home/mkiuchi/.config/chromium/SingletonLock" ]; then
     echo "found chromium lockfile" >> /root/log
     rm -f /home/mkiuchi/.config/chromium/SingletonLock
   fi
else
   echo "backupfile not found. aborted." >> /root/log
   exit
fi

DAT=`date`
echo "script end $DAT" >> /root/log

2. make configuration file for systemd(example: /root/synchome.service)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
[Unit]
Description=Home Directory Synchronization
Require=autofs.service
After=autofs.service

[Service]
Type=oneshot
ExecStart=/root/synchome.sh
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

3. chmod 755 /root/synchome.sh

4. cd /etc/systemd/system ; ln -s /root/synchome.service .

5. systemctl daemon-reload

I cannot determine how to identify the work of systemd, so my own script writes own log.

Remote desktop trial using SPICE protocol via mobile broadband connection

This post is continued story from these posts ( 1, 2, 3 ).

Previously I tried SPICE protocol as alternative of Microsoft’s RDP, but at that time SPICE protocol was very early development so I could not satisfy my needs to use in daily use. But situation has changed. RHEL 6 has included SPICE protocol for VDI, so I’ve tried once again.

1. Environment

  • Physical Host: Scientific Linux 6
  • kernel: 2.6.32-71.el6.x86_64
  • qemu-kvm-0.12.1.2-2.160.el6_1.2.x86_64
  • spice-server-0.8.0-1.el6.x86_64

  • Virtual Desktop: Fedora 15(i686)

  • kernel: 2.6.38.8-35.fc15.i686.PAE

  • xorg-x11-drv-qxl-0.0.21-3.fc15.i686

I’ve also used DNS, ddclient, and some router for this trial.(not written in this post)

2. Create Physical host

First, I’ve created normal kvm host. After the installation, I’ve also installed spice-server via yum.

3. Create Virtual Desktop

This procedure is just a little bit complex. First, I’ve created virtual machine using virt-manager and installed Fedora 15. But virt-manager only treat with VNC connection, so I’ve changed the configuration of virtual machine to work with SPICE.

4. Modify configuration to work with SPICE

After the installation, I’ve dumped configuration of virtual machine to XML file.

1
2
3
4
5
(at Guest OS)
# halt -p
(at Host OS)
# virsh dumpxml <virtual machine name> > <XML filename>
# virsh undefine <virtual machine name>

and edit XML file. Red charactor shows changes from original XML file.

 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
<domain type='kvm'>
  <name>f15</name>
  <uuid>4845a1da-cf61-62dc-783c-d0bff899b68e</uuid>
  <memory>786432</memory>
  <currentMemory>786432</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='i686' machine='rhel6.1.0'>hvm</type>
    <boot dev='hd'/>
    <boot dev='cdrom'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/storage/cdimg/fedora/Fedora-15-i386-netinst.iso'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/home/vm/f15.img'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:c1:29:97'/>
      <source bridge='br0'/>
      <target dev='vnet4'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target port='0'/>
    </console>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='spice' port='5930' autoport='no' listen='0.0.0.0'/>
    <sound model='ac97'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='qxl' vram='32768' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
</domain>

After the edit I defined virtual machine again.

1
# virsh define /home/vm/f15.xml

After definition, I cannot see console in virt-manager anymore. The reason is that virt-manager doesn’t support SPICE. So I issued virsh command to boot virtual machine.

1
# virsh start f15

5. Connect virtual machine from Windows client

Windows client bianry can be downloded from spice-space.org. I’ve downloaded spice-client-win32-0.6.3.zip and spice_libs_win32_063_and_earlier.zip.

After download, I unzipped both package and moved spicec.exe to libs directory for spicec.exe works with some libraries.

6. User Experience

I’ve tried. See movie.

7. Conclusion

SPICE protocol works good with mobile broadband and LAN connection, but you will feel some stress about some multimedia experience. SPICE connection via mobile broadband will consume about 800kbps bandwidth from my experience.

Enjoy.

そして今日はFedora14インストール祭りでした

仮想サーバの親、子、Macbookのvirtualboxの子、と3つ。Spiceがリポジトリに入ってるのでとても楽です。xrog-x11-drv-qxlがバージョンアップして1280x800に対応するようになって嬉しいです。でもspicecで仮想サーバの子に接続するとXがバコバコ落ちるのはなぜなんだぜ!?

今日はKVM+SPICE環境で仮想デスクトップごっこをしてみた

http://www.spice-space.org/

環境

  • 物理サーバ
    • Fedora 14 alpha
    • KVM環境、xorg-x11-drv-qxl, tunctl
  • 仮想デスクトップ
    • Fedora 13
    • xorg-x11-drv-qxl
  • クライアント環境

1.物理サーバ(1)

  1. 普通にFedora 14 alphaを入れる。KVMグループを入れておくと楽なのかも。
  2. インストール後ブリッジ接続ができるように設定変更して再起動。(インストール後1回目の再起動はrebootしても反応がないので強制リセットした)
  3. xorg-x11-drv-qxl, tunctlをインストールする

2.仮想デスクトップ(1)

  1. 物理サーバのvirt-managerで普通にFedora 13を入れる
  2. インストール後とりあえずvirt-managerからForce Offして落としておく

3.クライアント(1)

  1. Fedora 13用のSPICEリポジトリを追加して、yum install spicecする。

4.物理サーバ(2)

  1. 以下のスクリプトを/etc/qemu-ifupとして保存。
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#!/bin/sh
set -x

switch=br0

if [ -n "$1" ];then
 /usr/bin/sudo /usr/sbin/tunctl -u `whoami` -t $1
 /usr/bin/sudo /sbin/ip link set $1 up
 sleep 0.5s
 /usr/bin/sudo /usr/sbin/brctl addif $switch $1
 exit 0
else
 echo "Error: no interface specified"
 exit 1
fi
  1. さっきShutdownした仮想サーバを以下のようにコマンドラインから起動
1
2
3
4
5
6
qemu-kvm -hda /root/f13.img -enable-kvm -m 768 -vga qxl ¥
-spice port=5930,disable-ticketing -name f13 ¥
-uuid XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX -rtc base=localtime ¥
-device virtio-net-pci,vlan=0,id=net0,mac=XX:XX:XX:XX:XX:XX,bus=pci.0 ¥
-net tap,vlan=0,name=hostnet0 -usb -device usb-tablet,id=input0 ¥
-device AC97,id=sound0

5.クライアント(3)

  1. 以下のコマンドでデスクトップに接続。接続時はまだ最大800x600の解像度しか出ない。
    1
    
    $ spicec --host <物理サーバのアドレス> --port <さっき指定したポート番号>
  2. ログインしたらrootになって、xorg-x11-drv-qxlをインストールして仮想デスクトップを再起動する
  3. 再起動後、画面が大きくなる。試したときは1024x768まで出せた。

で、やってみてどうだったか

  • いい感じだと思う。RDPのようなサクサク感がある。LAN環境であれば十分デスクトップとして使える。日本語入力も含めキー入力も問題なし(でも今回クライアント環境をVirtualBox上のFedora13でやったので[Ctrl]+[Alt]+[F2]とかがVirtualBox側に取られて結構なんだかであった。やっぱり仮想環境上でクライアントするのはいろいろ面倒くさいかもしれない)。
  • ムービーを流しながらウィンドウをドラッグすると少しもっさりする
  • 使用する帯域は大体目測で10KB/s〜2MB/s(80Kbps〜16Mbps)
  • 音も出てる。でも今回クライアント環境をVirtualBox上のFedora13でやったのでピッチが落ちててがっかりであった。Windowsクライアントでやればもっと幸せになれるかもしれない
  • USBリダイレクションはSPICEの仕様にはあるが、まだ実装されていないようだ あまりHOWTO的な文書がなくて環境を作るのに苦労したが結構満足度が高いのでこれからどんどん使ってみようかな!

今日はMacbookにUSB外付けHDDをつけてそこにFedora13入れようとしたらrEFItがうまく認識してくれない

確信が持てないのだけど、たぶん古いMacbookでは外付けUSB HDDからブートできないのでは。grub2であればEFI対応なのでMac標準のEFIに合わせられるみたい。だけどanacondaで入らないから入れるのしんどい。ちょっと断念。

今日はVirtualBox上のFedoraでトラックパッド指二本でやるスクロールが横スクロールにも対応していることを知り驚いた

これが以外と便利なんだよね

今日はFedora 13のlameでエンコードしたら謎の無音ができて困ったので結局iTunes LAMEにした

Fedora 12でも同現象だった。前はできたような気もするけど気のせいかもしれない。最近iTunes Music Storeで買ったものが結構あることに気がつきAndroidに行くと全部使えないよなあとヘコんだ。iTuneで取り込むと曲名にアクサンテギュが反映されない。アーティスト名には入ってるのでGracenote側で落としているのだろうか。ちゃんとi18n(l10n?)してほしいなあ・・・。

今回はBitTorrentでisoゲットしてみたけど、JAISTの公開と数時間しか差がないのでやっぱりBitTorrentを使うインセンティブはあまりないなあと

これも日本に大きなキャパシティを持つFTP Serverがあるおかげ。やっぱり日本は幸せな国だ。

今日はMacとFedoraを再インストールした

再インストールするだけで10GBもHDD容量が減るのが納得行かない・・・。 そういえば最近使いやすいって長期的には問題があるような気がしてきた。改善する意欲をなくすので。Fedoraでこれそれできないって時に近くにMacがあって、Macでちょっとソフトをインストールするとできてしまうと、何か作ろうって気もなくなる。ただ昔それやったら結局作る時間も無かった、ということになったんだが。GWのノリに慣れてくるとずっとそれが続くような感覚で物事を考えてしまうからダメだな・・・。

今日は遅ればせながらffmpegからlibfaacが呼び出せないことを知った

でもそんなに生きる気力はなくなってないです。どうやらこうなってこうなってこうなった、感じなのか?iPhone用動画変換スクリプトを久しぶりに実行して気づいた。以下のように修正。

[修正前]

1
system("/bin/nice -n19 /usr/bin/ffmpeg -threads 4 -i \"$infile\" -r 29.97 -vcodec libx264 -s ${owidth}x${oheight} -flags \+loop -cmp \+chroma -deblockalpha 0 -deblockbeta 0 -crf 24 -b 256k -refs 1 -coder 0 -me\_method hex -me\_range 16 -subq 5 -partitions \+parti4x4\+parti8x8\+partp8x8 -g 250 -keyint\_min 25 -level 30 -qmin 10 -qmax 51 -trellis 2 -sc\_threshold 40 -i\_qfactor 0.71 -acodec libfaac -ab 128k -ar 48000 -ac 2 \"$outfile\"");

[修正後]

1
2
 system("/bin/nice -n19 /usr/bin/ffmpeg -threads 4 -i \"$infile\" -r 29.97 -vcodec libx264 -s ${owidth}x${oheight} -flags \+loop -cmp \+chroma -deblockalpha 0 -deblockbeta 0 -crf 24 -b 256k -refs 1 -coder 0 -me\_method hex -me\_range 16 -subq 5 -partitions \+parti4x4\+parti8x8\+partp8x8 -g 250 -keyint\_min 25 -level 30 -qmin 10 -qmax 51 -trellis 2 -sc\_threshold 40 -i\_qfactor 0.71 -acodec aac -ab 128k -ar 48000 -ac 2 \"$outfile\"");
 

できたもの(映画)を聞いてみるとそんなに悪くなかったので、これでいっかと。 なに変換したかというと、これ。デンゼル・ワシントン最高だろ。

謎な挙動をしている

smbでマウントしたディレクトリでlameでmp3変換スクリプト流してると、単独ファイルのはずが同じ名前で全部ディレクトリに変化したり、全然違うディレクトリの内容を表示したりする。一回いっこ上のディレクトリに上がって戻ってくると正しく表示されるようになる。おかしいけど再現条件がよくわからず。なんかこう、少し不安になる。 ・・・と思ったら再現条件わかったっぽい。別のターミナルで同じディレクトリに移動してlsするとそうなるっぽい。っぽいが、わからん。

今日はMediaWiki, MHonArc, Mailmanに取り組んだ

初めてやるやつだからいろいろ試行錯誤した。MHonArcは手っ取り早くていいけど月ごとのインデックスができない。Mailmanはいろいろできるけどスイートなので、アーカイブだけしたいとかの小回りが利かない(できるのかもしれないけどよくわかんねえしマンドクセ)。Mediawikiはまあこんなもんか、と。VirtualBox上の仮想サーバでやったのでいろいろいじったあとに最初からもう一度、というのもささっとできて超便利。 本当は今日はもっと違うことをしたかったんだけど・・・。

今日はbonnie++でファイルシステムのベンチマークをしてみた

bonnie++の勉強をかねて。0.8.13やってるときに、OpensolarisのファイルIOが妙に速いなぁと思っていたので具体的に何がどれだけのものなのかをやってみた。対象はFedora10, FreeBSD7.1, Opensolaris200811。 結果はこんな感じだった。(PDFファイル)元のExcelファイル。 特にZFS最強伝説というわけでもなく。Fedora(ext3)が特に遅いというわけでもなく。う〜ん。まあいいか。ファイルシステムに萌えるって難しいな・・・。

F10+pulseaudio on vmware fusionで音が鳴った

こんな感じに変更して再起動。

/etc/pulse/default.pa

(変更前)

1
2
3
4
5
6
7
8
### Automatically load driver modules depending on the hardware available
.ifexists module-hal-detect.so
load-module module-hal-detect
.else
### Alternatively use the static hardware detection module (for systems that
### lack HAL support)
load-module module-detect
.endif

(変更後)

1
2
3
4
5
6
7
8
### Automatically load driver modules depending on the hardware available
.ifexists module-hal-detect.so
load-module module-hal-detect tsched=0
.else
### Alternatively use the static hardware detection module (for systems that
### lack HAL support)
load-module module-detect tsched=0
.endif

で、再起動すればなった。詳細はここ

Fedora10に環境移行

音がうまく出ないのはなぜなんだぜ!? (11/30追記)なんとなくログから察するにpulseaudioのバグくさい。ちょっと待ってみようかな・・・。それまではALSAでしのぐことにする。とりあえずaudacity,ニコ動が使えるからよしとしよう・・・ そろそろ現実逃避も終わりにしよう・・・orz

ejabberdを立ち上げ

XMPPプロトコルで動作するIMサーバであるejabberdを起動。これがなぜかDNSでの名前解決を前提としていたためBINDの設定まで行った。鯖側の古いFedoraはrpmではイマイチうまく動かなかったので最新の安定版をtarballからコンパイルしてあっさり起動。PidginとiChatでいろいろいじってみる。なるほどなるほど。 ・・・別に一人でチャットしたいわけじゃなくて。ちょっと下ごしらえです。

SulphurかわいいよSulphur

いろいろ使ってる 気に入ったところ * クリック音がカチカチいって小気味よくてイイ! * updateの表示がオサレ! * 時計アプレットがオサレ! もうちょっと頑張ってほしいところ * Fedora8に比べてちょっともっさり? * firefoxもちょっともっさり * Flashビデオ開いてるとaudacious再生が上手くいかなかったり * 天気アプレットが文字化けするよ * crondがいつのまにかなくなってるよ(再インスコすればまた動く) なんだ頑張りましょうなところの方が多いじゃないかwww。ダメな子ほどかわいいってところだ。はいはい完全にバイアスかかってますよ反論は受け付けませんよ!

Fedora 9にアップグレード

DVDのダウンロードに3日ほどかかりました。結局preupgradeでのアップグレードが上手くできなかった。DVDからブートしてアップグレード。40分ほどで完了。 とりあえず気になっていること。

  • gdmの画面が妙に大きくなってしまう。(未解決)
  • gnviewは再インストールしないとダメ(またwikiに書いておこう・・・)
  • autofsでのNFS共有がうまく移行できず。サーバ側の/etc/exportsにinsecureオプションを追加して解決
  • openvm-tools&VMware-toolsをインストールし直し。ここを参照して上手くできました
  • vmware上でやってるのでマウスが上手く動かなかった。ここを参照して修正
  • マウスのスクロールがきかない。以下の設定をxorg.confに追加しておk
1
2
3
4
5
6
7
8
Section "InputDevice"
Identifier  "VMMouse"
Driver      "vmmouse"
Option      "Device" "/dev/input/mice"
Option      "Protocol" "ImPS/2"   <-----追加
Option      "Emulate3Buttons" "yes"
Option      "ZAxisMapping" "4 5"  <-----追加
EndSection