Monthly Archives: October 2011

Converting DVDs for viewing on a tablet, while inlining captions

Previously, I  described how to convert HDTV videos for my EEE Pad Transformer.  Now, I’ll go over something a bit more difficult.

My wife and I have some DVDs of Bollywood films that we enjoy watching.  Aaja Nachle, Om Shanti Om, 3 Idiots, Billu, among others.  These films are mostly in Hindi, but there are English subtitles available.  As we don’t understand Hindi, we watch the movies with the subtitles.  The Android media viewer that comes with the tablet doesn’t have a way to select subtitles from an alternate video stream.

Now, I wanted to make files of these movies that I could watch on the Android tablet.  As noted in the previous article, the resulting files have to be H.264 Baseline profile, and under 2GB in size.

Here’s how I did this.  Note that this procedure required no less than 70 GB of free disk space to hold a large intermediate file, as I wanted to avoid artefacts introduced by running through multiple codecs, so I used a lossless intermediate state.

First of all, I used the MythTV option to rip a perfect copy of the DVD.  That gave me a file, say 3IDIOTS.vob.

Next, I used mencoder to inline the captions directly into the video stream:

mencoder -ovc lavc -lavcopts vcodec=ljpeg:aspect=16/9 \
    -vobsubid 0 -oac lavc -lavcopts acodec=flac \
    -o 3idiots 3IDIOTS.vob

The output file, 3idiots, was, as noted, huge.  It consisted of a lossless jpeg video stream, with the subtitle 0 track overlaid on the video stream itself.

Next, the file had to be converted to H.264 Baseline.  In this case, I decided, rather than setting a qmax, that I would set a bitrate.  That way I could be certain ahead of time what the final size of the file would be, though at the cost of increased trancoding time.  To get a fixed bitrate, it is necessary to run ffmpeg in two passes, once to collect statistics, and the second time to generate the file itself.  Here’s how this is run:

ffmpeg -pass 1 -i 3idiots -vcodec libx264 -vpre fast \
    -vpre baseline -b 1400 -acodec libfaac -ab 64k \
    -ac 2 -ar 44100 -threads 3 \
    -deinterlace -y junkfile.mp4
ffmpeg -pass 2 -i 3idiots -vcodec libx264 -vpre fast \
    -vpre baseline -b 1400k -acodec libfaac -ab 64k \
    -ac 2 -ar 44100 -threads 3 \
    -deinterlace 3idiots.mp4 

The “junkfile.mp4” file can be deleted.  The H.264 file, 3idiots.mp4, came in at 1.8 GB, and was of quite acceptable quality to view on the tablet.

Converting HDTV videos for viewing on a tablet

I have an Android-based tablet computer, the EEE Pad Transformer.  My MythTV computer can record digital over-the-air broadcasts in high definition now that I have put an HDHomerun on my network.  So, it would be nice to be able to transfer some HDTV programs to the Android computer to watch them there while traveling.  The HDTV shows are 1080i, encoded as mpeg2 video, at a bitrate of close to 16000 kbits/sec.

So, what are our constraints?  The Android computer is not powerful enough to play videos without hardware assist, and that hardware assist is only available when viewing H.264 videos encoded with the baseline profile.  It doesn’t work on main profile H.264 videos.  Also, the Micro-SD card that I plug into the tablet must be formatted as VFAT, it isn’t recognized when I reformat it to any more modern Linux filesystems, so our files are going to have to be under 2GB in size.  Also, the Android screen is only 1280×800, so there’s no point copying a 2560×1080 file there, the machine will have to reduce the resolution, we might as well do it before we copy it to the card.

So, a 1 hour show, recorded on the MythTV box, is about 8 GB and in the wrong format.  We convert it in two steps.  First, cut out any commercials and transcode it at high quality.  For network broadcast television that chops off about 25% of the file size, and you probably didn’t want to watch the commercials while sitting on the train/airplane anyway.

Next, it has to be transcoded to H.264 Basline.  This can be done with ffmpeg:

ffmpeg -i PROGRAM.mpg -vcodec libx264 -vpre fast \
-vpre baseline -s hd720 -qmax 30 -acodec libfaac \
-ab 128k -ac 2 -threads 4 -ar 44100 -deinterlace \
PROGRAM.mp4

This takes the HDTV .mpg file from mythtv, “PROGRAM.mpg”, and converts it.  We use the libx264 video codec, fast settings, baseline profile, formatted for a high definition 720 line screen.  “qmax” sets a limit on quality loss, I usually use a value between 25 and 30.  We use the FAAC audio codec at 128kbits/sec, deinterlace the result, and write it to “PROGRAM.mp4”.

The resulting file, about 45 minutes of air time, is about 600 MB in size.

牛蒡花枝香腸



牛蒡花枝香腸

做了超好吃的牛蒡花枝香腸。平時就愛吃牛蒡,覺得做成牛蒡魚板非常對味。沒事都會做一些當茶點,這次剛好買了腸衣,突發奇想,來灌個牛蒡花枝香腸。

材料:牛蒡2根,魚漿300g,花枝2隻,腸衣適量,薑末,塩少許依個人口味調整。

牛蒡洗淨去皮用擦菜板擦成細絲,花枝用食物處理機攪打,注意留下小花枝丁才有口感,魚漿是市場買現成的。腸衣洗淨用米酒浸著,備用。

將所有材料和均,灌入腸衣內,不要灌太飽以免腸衣爆開,並用牙籤刺幾個小洞將多餘的空氣擠出。不用晾乾,直接入滾水中煮熟,切片,食用時淋上醬汁。沒吃完的可以冷藏或冷凍,也可用平底鍋煎成脆皮牛蒡花枝香腸。

雖然心裡已經預料成品的味道應該不錯,但是試吃時仍然為它特別的牛蒡香驚艷不已。尤其是花枝和魚漿原本就是天生一對,再加上高纖爽脆的牛蒡,我們一口接一口,顧不上說話,直到把盤子清乾淨為止。

照片中的是油煎過的牛蒡花枝香腸,美味健康兼顧

週末早餐


星期六早上九點我還在賴床,老公早已盥洗完畢準備。他先來到床邊,輕聲說:我去買 buttermilk,馬上回來。我連眼睛都沒睜開,只是甜甜地享受柔軟的羽絨枕,一點兒也不想起床
昨天晚上我吵著要吃比斯吉,可是商店都已打烊了
。老公說:明天一早,我就去買 buttermilk
想到這兒,我醒了
。毫不猶豫地起床,老公已經踏上買菜之路。我懶洋洋地洗臉刷牙,才不過幾分鐘的時間,老公已經回來,開始在廚房裡忙著做我愛吃的比斯吉
比斯吉好吃的祕訣在於 buttermilk,因此他為了心愛的老婆,七早八早衝到最近的超市,買好材料就開始忙著做早餐

我從來都不知道他是怎麼做比斯吉的,我們兩人的領域界線分明,只要他會做的美食佳餚,我壓根兒不會想學,反正他會做;而我愛吃的魚菜茄子,麻婆豆腐和宮保雞丁…….等等,早在婚後第一年就把他教會了


幾乎只要是麵包就歸他做,我還愛吃英式馬芬,他就去學怎麼做;我說要吃馬來西亞的奶油烙餅,他就認真地找食譜,一次又一次地練習摺麵糰,雖然看起來很難,但他總算是做出來了,味道和口感比餐廳裡賣的更好吃--真材實料的關係吧!

想想老公討到我這樣的老婆真是他的福氣,要知道,在認識我之前他是個不會拿鍋鏟的人。為了利誘我和他成親,他先打聽出我愛吃的菜單,然後花了兩天的時間做了十幾道家鄉菜,足夠我們兩人吃一星期的份量,他對我說:達玲,請你來和我一起過生活吧!
看著那兩百顆水芥餛飩,想著他用那雙大手一顆一顆細心包成漂亮的形狀,嫁給他應該可以吃得不錯
。事實證明我當年的想法是對的,結婚以來,老公天天做飯給我吃不說,我經常要求他做一些他原本聽都沒聽過的菜餚,他也會想盡辦法變魔法出來
我問他:達玲,我是不是要求的太多?
他則深情款款地回答:不,因為妳我們的生活才多彩多姿

很好很好,標準答案

比斯吉烤好了,屋子裡頓時瀰漫著溫暖的奶油香,伯爵茶也早已沖泡好擺在餐桌上,比斯吉切開,塗上之前自家做的蔓越莓醬--哇哈哈!人生就是要浪費在美好的事物上

蔓越莓果醬



蔓越莓果醬

每年這個時候我都要做許多蔓越莓果醬,做好了裝在密封瓶中放入冷凍室,一直吃到春天雪融為止。

蔓越莓果醬是聖誕晚餐上不可少的一道“醬”,通常是配火雞吃的。但是我和老公兩人都覺得火雞肉配果醬不是很怪嗎?因此好多年來我從不去碰蔓越莓果醬.直到有一年感恩節晚餐,我在廚房幫忙,第一次嚐到新鮮家庭製的蔓越莓果醬時,我立刻驚為天人並要求抄食譜,無奈有些人還是不願意分享密方,(小氣,哼!)如此一來我一年只能吃到一次家庭製的蔓越莓果醬。(市面上賣的罐頭果醬我是一點也不感興趣。)

還未找到最佳食譜之前,每年冬天我都可憐巴巴的向別人要蔓越莓果醬,而且還必須等到聖誕節後看有沒有剩下才會給我。有時候還要不到,用錢也買不到,只能扼腕嘆息。

老公看我那麼愛吃蔓越莓果醬,於是看烹飪節目幫我找了一個食譜。後來婆婆聽說以後也把她的果醬食譜給我。我試了幾次,又修改了一點,最後才決定這是我最喜歡的配方。

我有多愛吃呢?一天一杯是我的基本量。我可以單吃,可以和酸奶酪一起吃,可以塗在餅乾麵包上吃,還可以加進紅茶裡變成俄羅斯紅茶。

至於蔓越莓的好處那是多到說不完,尤其女性更應經常食用,網路上隨處可查。

這幾天又送了好幾瓶給親朋好友,也不斷收到友善的回禮,為感恩節增添了不少歡樂的氣氛。

 

3-2-1 蔓越莓醬

材料:

蔓越莓3杯(洗淨濾乾)

水2杯

細砂糖1杯

作法:

以上材料放入鍋中小火加熱至沸騰,煮至蔓越莓膨脹爆漿即可熄火,趁熱裝入高溫消毒過的玻璃罐中,栓緊蓋子,瓶內即成真空狀態。如果瓶子裝得很滿,不要放冷凍否則瓶身會裂開,辛苦的成果就毀了。

如果做的量很大,需長時間保存,將全都裝好的瓶子放進大湯鍋中,倒入沸水淹過瓶身,小火煑20~30分鐘即可室溫保存三~六個月。

 

蜂蜜蔓越莓醬(無糖)

我現在最愛這個配方了,我自己修改研發的。

材料:

蔓越莓3杯(洗淨濾乾)

水1杯

蜂蜜1杯

作法:

將水和蔓越莓放入鍋中如上述方法煮至蔓越莓爆開,加蓋悶十鐘,等溫度稍降時加入蜂蜜,攪拌均勻即可,超簡單吧?

蜂蜜後下是因為盡量避免因高溫而破壞其酵素,這個配方的蔓越莓醬較稀,不會像果醬一樣凝成凍狀。

我第一次用龍眼花蜜,美味到令人飄飄欲仙。後來試其它的蜂蜜,雖然味道也不錯但個人還是最喜歡龍眼花蜜。對了,菊花蜜的風味也很特別,但是很容易被蔓越莓蓋過蔓。這次一口氣做了三公升,裝250ml 的瓶子可以裝12瓶,沒幾天就送完了每天早餐一定要加兩大匙在原味優格裡,今年我自己只吃了兩瓶。沒關係,等天氣再冷一點,蔓越莓會更紅更好吃!