顯示具有 ubuntu 標籤的文章。 顯示所有文章
顯示具有 ubuntu 標籤的文章。 顯示所有文章

2010年2月12日 星期五

清除舊的 grub 開機選單

最近在 Ubuntu update 完 kernel 後, 發現舊的也都還在 XD
然後 grub 開機選單就越來越長, 快要超過一頁了
如果要除掉舊的 kernel
假設是要刪除 2.6.31-14 kernel option

cd /boot
sudo rm -rf *2.6.31-14*
sudo update-grub2

2010年2月10日 星期三

ckermit to access serial port (gsm/gprs modem) in (embedded) linux

sudo apt-get install ckermit
cat ~/.kermrc

set modem type none ; There is no modem
set line /dev/ttyS0 ; Specify device name
set carrier-watch off ; If DTR CD are not cross‐connected
set speed 115200 ; Or other desired speed
set flow rts/cts ; If RTS and CTS are cross‐connected

; the following equivalent to kermit -8
set terminal bytesize 8
set command bytesize 8
set parity none ; (or "mark" or "space", if necessary)

set stop-bits 1 ; (rarely necessary)
set flow xon/xoff ; If you can't use RTS/CTS
connect ; Enter Connect (terminal) state

如果是要存取 gsm/gprs modem 的話,也可以試

set modem type user ; User defined
set modem name my-gsm ; gsm/gprs modem with AT commands
set modem capabilities at
set modem carrier-watch off
set modem kermit-spoof off
set modem flow-control none
set input echo on

set line /dev/ttyS0 ; Specify device name
set carrier-watch off ; If DTR CD are not cross connected
set speed 115200 ; Or other desired speed

; the following equivalent to kermit -8
set terminal bytesize 8
set command bytesize 8
set parity none ; (or "mark" or "space", if necessary)
set stop-bits 1 ; (rarely necessary)
set flow none
set local-echo on

; output AT\13 ; modem expect carriage return (13 in decimal or 0xD in hex)
lineout AT ; lineout would add carriage return for you
connect ; Enter Connect (terminal) state, you should see AT response OK

最後 sudo kermit 就可以 access

另外在 windows 上也可以用 putty 連線到 serial port, 選 serial 設定 baud rate 就可以 connect, 比一些 dummy terminal 好用一點, 至少有 copy/paste 可以用 :P

要 cross compile ckermit 時,需要先 build host 版本的 wuart, 把 wuart 保留一份 host build 的版本,在 cross compile target 中 failed 時手動換回 host 版本 wuart,再繼續 build 出 wermit, 要自己 rename 為 kermit :P

2009年6月18日 星期四

Ubuntu 轉換AVCHD mts 檔為 DVD Video

基本上我是照 Acmelab's BlogHOWTO: Convert and write AVCHD (.mts) to DVD with Linux 轉換跟 jw 借的 Sony Full-HD HDR-SR11 硬碟攝影機錄下的 ssh 抓周影片,另外也要感謝 lkchu 全家的參與,讓抓周更熱鬧 :P

在 Acmelab 的步驟中,原本是轉 Canon, Panasonic 兩家的 mts 檔,但我試 Sony 錄的也可以成功轉換,也發現其實 mts 檔就是錄 H.264 (mpeg-4 AVC) 的影像格式,主要就只有五個步驟:

一、安裝 mplayer svn trunk
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
cd mplayer
./configure
make && make install

二、安裝 mencoder(在 mplayer trunk 內)、dvdauthor、growisofs(在 dvd+rw-tools 內)

三、轉換的指令列
>mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:576,harddup -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:aspect=16/9:threads=4 input-file.mts -ofps 50 -fps 50 -o output_file.mpg

其中 input-file.mts 就是 DV 裡的 mts 檔,output_file.mpg 就是要輸出的 mpeg2 (因為原文是要轉 DVD-Video format) 檔案 DVD-Video 的 mpeg stream 限制

四、轉 mpeg2 為 dvd format
dvdauthor -o dvd -x dvd.xml
測試用:mplayer dvd:// -dvd-device ./dvd

五、燒錄 DVD 格式檔到光碟上
growisofs -dvd-compat -Z /dev/dvdrw -dvd-video ./dvd/

基本上,如果你以上步驟都正常,就比我幸運,不用再往下看了 :P

我另外遇到的問題是在 build mplayer 時,link 不到 libz? 於是另外安裝了 Ubuntu 的 libz package:

sudo apt-get install libz-dev
(或是 sudo apt-get remove zlib1g-dev)

然後在 configure mplayer 時要 link 到 libz
./configure --extra-ldflags=-lz

再 make mplayer 就可以把 mencoder 編譯出來了。
測試時是將檔案轉為 mpeg2 格式,就可以在 Windows 播出來了 :D
改的轉換參數隻有把 PAL 的 720x576 換成 NTSC 的 720x480

>mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:480,harddup -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:aspect=16/9:threads=4 input-file.mts -ofps 50 -fps 50 -o output_file.mpg

Cheers! Salute to ffmpeg! and AcmeLab :P

相關文章:

2009年4月9日 星期四

家用 Ubuntu 客廳機的功用 - 玩俄羅斯方塊

五年前的 Asus Pundit 始祖加裝 1GB RAM, 再換上新的 DVD ROM
之後,重灌 Ubuntu 8.10 終於成功了,原本想用小電視給 ssh 當玩
具機,但因為 Linux 上的 WPA2-Pre shared key AES 設定仍不成
功,只好先放在客廳上網。

在當 Server 之餘,對我們家最大的功用,就是打俄羅斯方塊了。:P
P1030365

註:

Asus Pundit 用的是 Intel CPU celeron 2.4GHz, L1 D cache 8k,
L2 cache 128K, 可能是 SL6XG, SL6W4, SL6VU其中一個型號,
Intel celeron spec (pdf), 採用 0.13 micron(10^-6) 製程 XD

Socket 478

FSB 400MHz

Memory with DDR 400Mhz, 1.25GB (1GB + 256MB)