http://www.youtube.com/watch?v=so2966a29do
ในวีดีโอนี้ สอนวิธีอัดวีดีโอ สองแบบคือ ใช้แบบ GUI กับ แบบ Command Line
แบบ GUI ให้ลงสองโปรแกรมคือ
gtk-recordmydesktop กับ mencoder
เนื่องจาก gtk-recordmydesktop จะสามารถอัดวีดีโอ ออกมาเป็นชนิดข้อมูลแบบ ogv
จึงต้องใช้โปรแกรม mencoder เพื่อแปลง ogv ไปเป็นข้อมูลแบบอื่น เช่น AVI
$ mencoder -idx iamstupid.ogv -ovc lavc -oac mp3lame -o iamstupid.avi #idx = input file #ovc = output video codec #oac = output audio codec # o = output filename
หรือ แบบ Command Line
เราสามารถใช้โปรแกรม ffmpeg ซึ่งเอาไว้ใช้ แปลงไฟล์วีดีโอเป็น mpeg
แต่ถ้าเรากำหนด input fiel เป็นหน้าจอ ก็จะทำให้เราอัดวีดีโอจากหน้าจอได้โดยตรง
$ ffmpeg -f x11grab -s 800x600 -r 10 -i :0.0 -s 800x600 -r 10 -sameq output.avi #f = frame graph #s = size or resolution (put it twice) #r = frame rate (put it twice) #i = input ( using :0.0 means current screen ) # sameq = same video quality # output.avi = output filename
ถ้าไม่รู้ว่า ขนาดจอที่ต้องการ capture กว้างแค่ไหน ให้ลองใช้คำสั่ง xwininfo ดูก็ได้
$ xwininfo แล้ว click ที่หน้าจอที่อยากจะได้รายละเอียด จะได้ว่า ptantiku@ptantiku-desktop:~$ xwininfo xwininfo: Please select the window about which you would like information by clicking the mouse in that window. xwininfo: Window id: 0x6c0002f "Blogger: It's Dear - Create Post - Google Chrome" Absolute upper-left X: 0 Absolute upper-left Y: 24 Relative upper-left X: 0 Relative upper-left Y: 24 Width: 1680 Height: 1002 Depth: 24 Visual: 0x21 Visual Class: TrueColor Border width: 0 Class: InputOutput Colormap: 0x20 (installed) Bit Gravity State: NorthWestGravity Window Gravity State: NorthWestGravity Backing Store State: NotUseful Save Under State: no Map State: IsViewable Override Redirect State: no Corners: +0+24 -0+24 -0-24 +0-24 -geometry 1680x1002+0+24
No comments:
Post a Comment