Inspirated

 
 

April 5, 2007

HOWTO: ALSA line-in capture with MPlayer

Filed under: Blog — krkhan @ 5:34 pm

I had an MSI TV @nywhere Plus card, and although it worked perfectly under Windows, I never got its sound working on my Linux box. The main reason for it was that the TV-Tuner card outputted sound through a separate cable to ALSA-line in. One way of getting around the mess was to launch MPlayer for video, and then capture audio through this separate command:

arecord -D hw:0 -r 44100 -c 2 -f S16_LE | aplay -

The solution wasn’t only ugly per se, but was also quite annoying because of a second’s lag in audio. After some searching in the mailing list archives of MPlayer, I combined various tricks in the following command which did the magic (relevant switches are highlighted):

mplayer -tv driver=v4l2:width=640:height=480:outfmt=i420:alsa:adevice=hw.0:
amode=2:audiorate=44100:forceaudio:immediatemode=0
:norm=PAL tv://

The adevice, amode and audiorate are dependent on your tuner card, whereas the alsa, forceaudio and immediatemode=0 are mandatory if you’re trying to capture sound from line-in.

That’s it. Now I don’t have to boot to Windows every time I want to do some video-recording. The profusion of capturing options in mencoder compared to MSI’s bundled software comes as an additional bonus for me.

Tags: , , , , , , , , , ,

April 2, 2007

HOWTO: Use xwd for screenshots

Filed under: Blog — krkhan @ 10:22 pm

If you’re using KDE, KSnapshot can do the job for you. If you’re using GNOME, gnome-screenshot can also achieve the task with quite perfection. So why would someone ever need tinkering with command-line utilities to generate screenshots?

The answer is: xwd is useful because not everyone uses KDE or GNOME and those who don’t usually despise installing needless extra applications for something as trivial as capturing a screenshot. xwd comes with the X.org server itself, while almost all distributions by default provide the necessary software needed to convert xwd screenshots into more popular formats. Moreover, KSnapshot and gnome-screenshot have a plethora of dependencies on their relative desktop environments whereas xwd is a small, neat and efficient solution for capturing. Let’s start with the requirements: (more…)

Tags: , , , , , , , ,
« Previous Page