2010-11-23

[Tip]enable MP3, MPEG4, AAC, and other restricted encoders in FFmpeg

Because of licenses difference between FFmpeg and libfaac/libmp3lame/etc, the offical FFmpeg doesn't support MP3, MPEG4, AAC, and other restricted encoders. However, we could make FFmpeg support these encoders by installing modified packages from third-party repository.

Medibuntu is a third-party repository that contains packages that are unable to be included in the official Ubuntu repositories. We can install modified libavcodec-extra-52 from them.

First, change repository settings:
sudo wget http://www.medibuntu.org/sources.list.d/`lsb_release -cs`.list --output-document=/etc/apt/sources.list.d/medibuntu.list && sudo apt-get -q update && sudo apt-get --yes -q --allow-unauthenticated install medibuntu-keyring && sudo apt-get -q update

Second, apt-get install libavcodec-extra-52 again:
sudo apt-get install ffmpeg libavcodec-extra-52

Then we are able to use the below command to compress any video file to mp4 with avc/aac stream inside.
ffmpeg -i input.file -acodec libfaac -ab 128k -vcodec libx264 -vpre default -crf 15 -threads 0 output_file.mp4

By the way, we could remove Medibuntu repository:
sudo apt-get autoremove ffmpeg medibuntu-keyring && sudo rm /etc/apt/sources.list.d/medibuntu.list && sudo apt-get update
But I suggest that you should remove modified libavcodec-extra-52 before restoring repository settings to default state.

2010-11-10

[PyQt] Warning: correctly use openPersistentEditor() and closePersistentEditor() with entered() signal to keep editor opened

Sometimes we may use openPersistentEditor() and closePersistentEditor() to keep editor of delegate opened.
For example, when entered() signal is generated, we close old persistent editor and open new persistent editor to make real editor widget always locates on the cell that mouse is pointing on.

However, the QModelIndex instance from entered() signal will be destroyed after the slot connected to entered() is returned. If we call openPersistentEditor() with the QModelIndex instance from entered() signal, I found that call closePersistentEditor() with QModelIndex:
1. has same instance as what we used to call openPersistentEditor()
2. has another instance that contains same row, column, and parent as what we used to call openPersistentEditor()
will failed, both of them.

If we want to open persistent editor and close it later in slots that entered() signal is connecting, we should create new index with model.index(index.row(), index.column()).
(Caution: directly assign index.parent() to the 3rd argument of model.index() causes the same problem, parent index should be cloned, too.)

2010-11-01

[人物]台灣微軟Silverlight看板娘-藍澤光

其實在同人界,將軟體擬人化已經不是什麼新鮮的事情了。但是軟體公司官方主動請插畫師設計軟體看板人物,並且為其正統背書的例子,倒是難得一見。除了Crypton的人聲合成軟體VOCALOID的CV系列(初音ミク等角色)以外,最近有位在台灣土生土長,卻有著日系漫畫美少女特徵,而且紅到日本去的軟體看板人物,那就是台灣微軟的Silverlight 4看板娘-"藍澤 光"(あいざわ ひかる)了:

2010-10-13

[開箱]毛糸のカービィ(Wii)

就在2010-10-13這天,任天堂旗下HAL研究所之最新力作,也是今年最治癒的遊戲,終於姍姍來遲了!

呃......不對,事實上2010-10-14才是任天堂HAL研究所官方發售這款遊戲的時間。因為不少店家老早就已經拿到貨,只等發售時間到來便可立即販售,有些小賣店按捺不住,就搞偷跑搶生意,在正式發售日前一天低調販售毛糸のカービィ。正好筆者也得知部分店家偷跑的消息,因此前一天我就買到了毛糸のカービィ。

2010-09-30

[CV]Adobe's Plenoptic Camera System

Yes, it is again an example of applying hardware assistance to solve the real world problem.

Adobe’s plenoptic camera processing:


We know that apply depth of field modification on photograph from traditional single lens camera is a hard problem. However, it is elegantly solved by compound eyes system plus specific software system.

Maybe it is another choice to reconstruct 3D photograph (a photograph includes depth value per pixel)?

Some paper reference:
Single Lens Stereo with a Plenoptic Camera (1992)

2010-09-22

[食記]博多拉麵-微風店

平價、美味的拉麵!

很多人應該都知道這家本舖位在市民大道上,以平易近人的價格提供美味湯頭,而頗負盛名的拉麵店。不過有趣的是,博多拉麵的其中一家分店,就座落在距離本店約100公尺處,而且還同樣在市民大道旁(這是自家店舖在相互鬩牆嗎XD)。只是人潮卻不像本店一樣多。雖然如此,微風分店的裝潢比起本店來說,確實寬敞了許多,因此用餐的舒適感比本店好上不少。

2010-09-05

[散策]湖興路散策:竹林路-有光產業道路-湖興路-花園新城-新烏路

住在新店地區的居民也許曾經到花園新城,沿著茂密的樹木散步過,但是又有多少人知道,梅崗二路走到底之後,能看到很棒的美景呢?


往永福路一帶行走,可以在特定季節欣賞大樹開滿的花。沿著湖興路往翠峰路方向,可以看到比貓空視野更廣的大台北盆地,以及參天茂密的樹林。而這篇文章,就要帶領讀者沿著湖興路一帶行走。