Linux Nirvana – A webcam that actually works on my PC (also with Skype)

It’s been a long time coming, over three and one half years, but I can finally put all the hardware in the house to good use and use my PC (internet wise) as I was using Windows. And using a Sony Playstation Eyetoy to boot!

From my post on ubuntuforums, here is how to get the eyetoy working with Skype:

Close Skype before continuing.

Using K/X/Ubuntu 9.04 +, the gspca module in the kernel will run the eyetoy cam as a webcam, but to use it under Skype, and to prevent the pink and green horizontal lines, you need to edit the config file. This is tucked away in your home directory:

/home/user/.Skype/skype-user/config.xml

where user is your login, and skype-user is your skype login

If you are the cautious type, back up this file first:

cp /home/user/.Skype/skype-user/config.xml /home/user/.Skype/skype-user/config.xml.bak

Open up the config.xml file in your text editor, and browse down through the file, you should find a <Video>…</Video> section.Add the following:

<CaptureHeight>480</CaptureHeight>
<CaptureWidth>640</CaptureWidth>
<RecvPolicy>callpolicy</RecvPolicy>

Mine looks like this:

…..</StatsSender>
<Video>
<AutoSend>1</AutoSend>
<CaptureHeight>480</CaptureHeight>
<CaptureWidth>640</CaptureWidth>
<Device>/dev/video3</Device>
<Disable>0</Disable>
<RecvPolicy>callpolicy</RecvPolicy>
</Video>
<table_insert_history>….

Start up Skype and head for video settings to select and test.

You can also select the Eyetoy Microphone to use, you may need to play around with your main sound settings to get this working. I had to change from Mic2 to Mic1 in Sound Settings / Mixer, and of course chose eyetoy microphone in audio settings in Skype

GeeXBoX playback at fullscreen on LCD TV

This has been an issue for me for quite a while, but I have simply overcome it by using the menu to change the aspect ratio.

It all stems from the perplexing confusion of recording dvb tv for later playback. Watching live TV on the TV, the picture fills the screen. It’s a 16:9 42″ TV (720p). When I record dvb tv using my main pc in its raw .ts state it is 720×576 (16:9). If I play this back using the GeexBox, mplayer squeezes the picture to a display of something like Cinemascope, so a change of aspect ratio to 4:3 usually sorts this out. But it got me thinking, if the original video is 16:9 why doesn’t play as such? The Pc in use to run GeexBox has an nvidia 6200 and is connected to the TV using VGA (DVI/HDMI went “pop” a while ago on the TV!).

First off, I tried all sorts of encoding options, changing the aspect ratio and resolution using mencoder. I got some success if I encoded with aspect=4/3 as an option. but this still didn’t make sense; if I had a 16:9 aspect ratio TV, why the original video didn’t fit.

This is what I did to sort things out. I have a HDD install of GeexBox so can ftp in to edit files. If you use a live cd, then you will need to edit the files before you generate a custom iso.

Boot up the GeexBox

FTP in, and make doubly sure you get into the right place

/mnt/GeexBox-partition/GEEXBOX/etc

Open up tvout in that directory and change the Aspect Ratio line to this:

TVOUT_ASPECT=”16:9″

and save.
By just making this change alone, it squeezed my display horizontally to make a 4:3 image, so more to do

Browse to /mnt/Geexbox-partition/GEEXBOX/etc/mplayer and open up mplayer.conf
In the [default] section, add the following two lines:

monitoraspect=”16:9″

aspect=”16:9″

and save. It may be worth noting that I have vo=vidix,vesa in the default section of mplayer.conf

Log out of the ftp and reboot the GeexBox. The Main Menu and background.avi should be filling the screen.

Now try playing any recorded dvb tv or video that was previously letterboxed, even though it was 16:9 ratio or 720×576 resolution. You should see it playback in full screen.

Caveats: This may not work in your setup, and you may not need to make all the adjustments to get this to work, this is what worked for me.

[Solved] – Mencoder Freezing Computer (my computer!) or Segmentation Faulting

This has been an annoyance for sometime, when encoding anything with mencoder, but specifically ts files from recorded TV. Mencoder would start off fine and then freeze the PC completely or Seg Fault, not necessarily in the same place. Other PCs I have would encode fine using the same settings.

I found the solution today on the mplayerusers email list. About 18 months ago I had overclocked my machine, up from 1.7 to 1.9 mhz and increased the FSB. Apparently mencoder doesn’t like overclocked PCs, even though the writer with the solution said it wasn’t mencoder’s fault! So I put my settings back to “Optimal” / “Auto”, and everything is now rosy in the garden, just a tad slower than before 🙂 I can live with that!

How to remux an avi with the right audio language track using MPlayer/Mencoder

MPlayer and Mencoder to the rescue again!

I downloaded a movie the other night which was advertised as having both Spanish and English soundtracks. I had found films like this before, but English had always been the first audio track, so had never been a problem. On this occasion, Spanish was the first audio track. I didn’t want to have to fiddle around with Geexbox getting the right language playing, so needed to sort this out, so that English was the audio track that played. I wasn’t too bothered about dropping the Spanish soundtrack.

Four “simple” steps.

  1. Confirm the aid number of the English language track. Running the video with mplayer in verbose mode produced enough information to find this easily, as track 2
    • mplayer -v inputvideo.avi
  2. Extract the english audio track from the avifile
    • mplayer -aid 2 -dumpaudio -dumpfile englishaudio.mp3  inputvideo.avi
  3. Copy the video track out without any sound
    • mencoder -ovc copy -nosound -o soundlessvideo.avi  inputvideo.avi
  4. Stick the soundless video and the English audio track back together
    • mencoder -ovc copy soundlessvideo.avi -oac copy -audiofile englishaudio.mp3  -o newvideo.avi

No encoding or transcoding going on, just demuxing and remuxing of the right parts. Apparently the use of -nosound can cause a/v sync issues, but in this case a/v sync was fine all the way through.

Found another way too, as doing the above with ac3 sound doesn’t sync well at all. Simply re-encode the audio and output to a new file:

mencoder -ovc copy  -oac mp3lame aid 2 inputfile.avi -o outputfile.avi

or to simply grab the second audio stream without encoding

mencoder -ovc copy -oac copy aid 2 inputfile.avi -o outputfile.avi

Sometimes it’s better to just do one thing at a time…

Over the last couple of days, I have been trying to get the vboxtool script working in order to safely shutdown any virtual machines I leave open on secondary desktops. Seems to work fine with headless VMs but not the one opened up in the GUI form on the desktop. Anyhow, had a Vm open on second desktop. Continue reading

Successful sound output from laptop with power supply interference!

***Health & Safety Warning and Disclaimer***

Before you try this, I must issue a Health and Safety warning on the electrical front, and also a disclaimer that I can accept no responsibility whatsoever if you try this and it a) borks your equipment, b) kills you or anyone else.

PLEASE NOTE THAT ALL SOLUTIONS MENTIONED HERE ONLY APPLY TO LAPTOP PLUG-INS AND NOT TO DESKTOP COMPUTERS WHICH REQUIRE 3-PRONG PLUGS.

If you bypass the grounding system of a desktop computer, you will put human lives at risk of fatal electrocution.

That said, you should bear in mind that if you have a 3 pin power plug (UK) and you go abroad to the continent or the USA, you would use an adapter to remove the earth connection, and all your power supply and laptop are double insulated for your safety. many DJs have found the need to do something along the lines listed below to get rid of interference when using laptops Continue reading