Showing posts with label Multimedia. Show all posts
Showing posts with label Multimedia. Show all posts

Jan 4, 2011

ว่าด้วย ALSA กับ Realtek ALC888/ALC887

เนื่องจากมีอันต้องเปลี่ยนเมนบอร์ด ก็เปลี่ยนโดยไม่ลง OS ใหม่เพราะ linux มันฉลาดพอ แต่ดันเกิดปัญหาว่า alsa ไม่สามารถหา mixer ได้
ของเดิมเป็น ALC880 ก็ใช้งานได้ดีไม่ต้องทำอะไร แต่บอร์ดใหม่นั้น เป็น ALC888B/ALC887 ดูได้จากคำสั่งนี้
cat /proc/asound/card0/codec#* | grep Codec
ลองค้นดูก็เลยรู้ว่าต้องใส่ option ตอนโหลด module ดังนี้
options snd-hda-intel model=generic
เนื่องจากใช้ Debian อยู่ก็เลยไปแก้ที่
/etc/modprobe.d/alsa-base.conf
แล้ว restart ก็เป็นอันว่าใช้ได้
แต่การทำแบบนี้ก็ทำให้ สูญเสียความสามารถ multi-channel ไป

Apr 20, 2009

Make DVD from 6 vcds (or more) using ffmpeg

You can make DVD from 6 vcds by using ffmpeg re-encode vcd mpeg file to dvd-format.

Requirement:
- linux or windows
- ffmpeg
- dvd authoring software ( e.g. k9copy , k3b ..etc)


use below command:

vcd -> pal-dvd

$ ffmpeg -threads 2 -i source-vcd.mpg -target pal-dvd -s cif -b 1150k -aspect 4:3 -ac 2 -ab 224k destination-dvd.mpg

or vcd -> ntsc-dvd

$ ffmpeg -threads 2 -i source-vcd.mpg -target ntsc-dvd -s qvga -b 1150k -aspect 4:3 -ac 2 -ab 224k destination-dvd.mpg

Note:
-
one DVD can contain 400 minutes of vcd if you use this method.

Aug 1, 2007

Screencast on Linux with ffmpeg and QTRLE codec

Introduction
As we known screencasting or screencapturing on windows is very easy and pretty by using varies application e.g. Techsmith Camtasia studio,Lotus screen CAM . On linux , you have many solutions to make screencast ,e.g. Istanbul, xvidcap, yukon or ffmpeg . Using ffmpeg is the one easy way to produce screencast ,but most people usually encode output by mpeg4,flv or ogg that may not produce good quality video. Recently, I found on Clemens Fruhwirth's blog , the Screencast codec showdown elects the Animation codec as the best codec for screencasts. Animation codec is a run-length encoder also known as qtrle. Unfortunately ffmpeg, the codec library of mplayer, was only able to decode qtrle. So he wrote qtrle encoder for ffmpeg, and now it already checked in to ffmpeg's svn .

What is QTRLE
QTRLE is Apple Quicktime Animation (RLE) Format ,see http://multimedia.cx/qtrle.txt . RLE stands for Run Length Encoding. It is a lossless algorithm that only offers decent compression ratios in specific types of data. RLE compression is only efficient with files that contain lots of repetitive data like screencast that have a little change of pixels from frame to frame , see http://www.prepressure.com/library/compression_algorithms/rle .

Make ffmpeg works with qtrle codec
1. First , check your ffmpeg's formats supported.
$ ffmpeg -formats
in section ' Codecs: ' should have this :
DEV D qtrle
' E ' means that your ffmpeg can encode qtrle , you not need to compile the new one.

2. If your ffmpeg can't encode qtrle ,you must check out the svn verson of ffmpeg, then compile it .
$ ./configure --enable-gpl --enable-x11grab --enable-faad
$ make

3. To make screencast .
$ ./ffmpeg -vcodec qtrle -r 10 -g 300 -s 1024x768 -f x11grab -i :0.0 ~/Desktop/test1.mov
* Replace "-s 1024x768" with your screen resolution.
* "-r 10" sets the frame rate per second. 10fps should be enough for a screencast.
* "-g 300" sets the group size. This instructs the encoder to produce a key frame every 300 frames. With 10fps, this gives you a seekable stream point every 30 seconds.
* If your screencast is still too big, try to raise the group size, lower the frame rate and/or lower the screen resolution.

*** May the force be with you,Good Luck!!!


Jul 30, 2007

Using parallel port joypad/joystick with Linux

Introduction
My parallel port joystick is a Sony PSX controller type. I have no problem using it on windows(directpad pro drivers on win9x, ntpad on winnt/2k/xp), but on linux I find the solution to use it for a log time. Finally I found the solution on kernel source's document file /usr/src/linux/Documentation/input/joystick-parport.txt . The driver for this type of joystick is gamecon.c .

Activate your joystick
Using gamecon.c you can connect up to five devices to one parallel port. It uses the following kernel/module command line:
$ sudo modeprobe gamecon map=port,pad1,pad2,pad3,pad4,pad5
Where 'port' is the number of the parport interface (eg. 0 for parport0).And 'pad1' to 'pad5' are pad types, The types are:
Type | Joystick/Pad
--------------------
0 | None
1 | SNES pad
2 | NES pad
4 | Multisystem 1-button joystick
5 | Multisystem 2-button joystick
6 | N64 pad
7 | Sony PSX controller
8 | Sony PSX DDR controller

if you have lp module load, remove it first.
$ sudo rmmod lp
for PSX joypad on parallel port
$ sudo modprobe gamecon map=0,7

check kernel message by 'dmesg' command you should something look like below:
' input: PSX controller as /class/input/input5 '
Then you can test joystick by :
$ jstest /dev/input/js0
note: the device node /dev/input/js0 is created by automatically if you use devfs/udev , so you don't need to create manually .
If you don't use devfs,you'll have to manually create these nodes in /dev:
# cd /dev
# rm js*
# mkdir input
# mknod input/js0 c 13 0
# mknod input/js1 c 13 1
# mknod input/js2 c 13 2
# mknod input/js3 c 13 3
# ln -s input/js0 js0
# ln -s input/js1 js1
# ln -s input/js2 js2
# ln -s input/js3 js3
For testing with input-utils it's also convenient to create these:
# mknod input/event0 c 13 64
# mknod input/event1 c 13 65
# mknod input/event2 c 13 66
# mknod input/event3 c 13 67

*** May the force be with you,Good Luck!!!