Latest Publications

Ubuntu 11.10 and Hauppauge PVR 150

HauppaugeIn this example, the composite video signal from an internal Hauppauge PVR 150 video adapter from Hauppauge will be viewed and recorded on a computer with the Ubuntu 11.10 operating system.

Install the video adapter and boot up the computer.

Read the boot log and confirm, that the Hauppauge PVR 150 video adapter are recognized by the IVTV driver.

dmesg | grep PVR
ivtv0: Autodetected Hauppauge WinTV PVR-150
ivtv0: Initialized card: Hauppauge WinTV PVR-150

Read the boot log and note the MPEG encoder stream device.

dmesg | grep video | grep MPG
ivtv0: Registered device video1 for encoder MPG (4096 kB)

Read the list of available video input.

v4l2-ctl -d /dev/video1 -n
Input: 2
Name: Composite 1

Switch to the composite video input.

v4l2-ctl -d /dev/video1 -i 2
Video input set to 2 (Composite 1)

View video from the composite video input. In this example, the composite video input is viewed with the VLC player. VLC can also be used to take snapshots.

vlc pvr:///dev/video1

Record pictures or video from the composite video input using one of the following examples.

In the following example, a picture of a frame of the MPEG encoded video input is recorded in JPEG using FFmpeg. FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video.

ffmpeg -i /dev/video1 -y ~/test.jpg

In the following example, the MPEG encoded video input is recorded using FFmpeg. An existing output file will be overwritten (-y). Audio will be disabled (-an). The duration of the video will be 10 s. The file size will be limited to 500 kb. The output will be filed as ~/test.mpg. The video will have a resolution of 720×576 pixels. The video will have a framerate of 25 fps.

ffmpeg -i /dev/video1 -y -an -t 10 -fs 500K ~/test.mpg

Hauppauge PVR 150 variables and controls can be listed and set using the IVTV commands. Check these examples.

v4l2-ctl -d /dev/video1 --log-status
v4l2-ctl -d /dev/video1 --info
v4l2-ctl -d /dev/video1 --list-ctrls

The videos can be viewed with MX Video Player from Android Market for Android mobile phones. MX Video Player is the first Android video player that performs multi-core decoding.

FreeBSD and UTF-8

BeastieUTF-8 is a variable-width character encoding set, that has been designed with backward compatibility for the popular ASCII character encoding set. UTF-8 has become the standard in popular open source multilingual operating systems.

There is one exception though. UTF-8 is not standard in the FreeBSD operating system. However, FreeBSD can be configured for UTF-8.

Determine the locale, that you will be using, with the following command.

locale -a | grep UTF

Configure the default login class. In this example, the following changes was made to the default login class for the Danish language.

:passwd_format=md5:\
:copyright=/etc/COPYRIGHT:\
:welcome=/etc/motd:\
-    :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES:\
+    :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES,LC_COLLATE=C:\
:path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin ~/bin:\
:nologin=/var/run/nologin:\
:cputime=unlimited:\
:vmemoryuse=unlimited:\
:priority=0:\
:ignoretime@:\
-    :umask=022:
+    :umask=022:\
+    :charset=UTF-8:\
+    :lang=da_DK.UTF-8:

Rebuild the login class database with the following command.

sudo cap_mkdb /etc/login.conf

Be aware, that user settings will override the system wide settings. If this is a problem, the user settings can be commented out.

nano -w ~/.login_conf

Restart all applications and log in again.

WinAmp for Ubuntu 11.10

WinAmpWinAmp is a very popular MP3 audio player, that was written by Nullsoft, for the Windows operating system. Nullsoft also wrote the equally popular ShoutCast server. ShoutCast is used for streaming MP3 on the internet. The name “Nullsoft” is a parody of “Microsoft”. WinAmp and ShoutCast was released as free software.

WinAmp is not available for open source operating systems. However, WinAmp has been forked off to open source projects – and one of the popular ones is the Audacious, which looks and sounds exactly like the good, old WinAmp. Audacious is a fork of Beep, that was a fork of XMMS, that was very popular in the open source environment. XMMS was a fork of WinAmp.

This is the procedure for installing the WinAmp look and sound on an Ubuntu 11.10 operating system.

Install Audacious from the Ubuntu Software Center for the Ubuntu 11.10 operating system.

The homepage of WinAmp has a free download page for skins, that has been neatly categorized. WinAmp uses its own file format for skins. These files has the WSZ extension. There are also skins with the WAL extension. These do not seem to work though. Every skins is contained in one single file and does not need to be opened or unpacked. Download one or more skins, that you will be using.

In the following example, the Pure Display skin will be installed. The Pure Display is a more neat and glossy skin.

sudo cp pure-display.wsz /usr/share/audacious/Skins/
sudo chmod 0777 /usr/share/audacious/Skins/*.wsz

Start Audacious.

Go to the View menu, go to Interface and switch the interface from GTK Interface to Winamp Classic Interface.

Press Ctrl+P to open Preferences, go to Skinned Interface and choose the Pure Display skin.

If you will be listening to MP3 ShoutCast internet radio and Firefox is not configured for Audacious, open your internet radio and let Firefox configure itself to use Audacious automatically. Digitally Imported is a good example of an internet radio, that streams MP3 ShoutCast audio.

If you will be listening to MP3 ShoutCast internet radio and Firefox is configured for Banshee, VLC Multimedia Player or something else than Audacious , you might want to configure Firefox to use Audacious automatically. Go to Preferences, go to Applications and configure “MP3 ShoutCast playlist” to use Audacious. You will need to browse to the following path. You can type to filter.

/usr/bin/audacious

If you will be listening to local MP3 files, you might want to configure the default Nautilus file manager. Right click one of your MP3 files and click Properties. Go to “Open With”. Choose Audacuous and “Set as default”.

Adjust the equalizer as necessary.

How to prepare a set of pictures for a digital photo frame

ImageMagickIn this example, we will prepare a set of raw pictures for use with a digital photo frame. The purpose is to reduce the file size, so the memory card can hold more pictures and the digital photo frame will be able to load the pictures fast. The purpose is also to normalize the colours and convert the pictures to a format, that the digital photo frame supports.

We will using ImageMagick 6.6.0.4 on an Ubuntu 11.10 operating system. The digital photo frame has a resolution of 480 x 234 and reads JPEG files from a memory card.

We make a directory, that will contain the prepared pictures.

mkdir memorex

We scale the pictures down, so at least the area of 480 x 234 pixels is filled. We crop the rest, equally from top and bottom, so the pictures now has a size of 430 x 234 pixels. We remove virtual layer information. We normalize the colours of the pictures. We convert all pictures to the JPEG format.

for i in `ls *.???`; do convert $i -resize '430x234^' -gravity center -crop 430x234+0+0 +repage -normalize memorex/$i'; done

As an alternative, we could use the following command, that uses the internal wild card option. However, if we have a lot of pictures, then this wild card would result in allocation of memory, that would cause the operating system to stop responding – and crash.

convert '*.*' -resize '430x234^' -gravity center -crop 430x234+0+0 +repage -normalize -set filename:name '%t' 'memorex/%[filename:name].jpg'

We copy the directory, with the prepared set of pictures, to the memory card. Remember, that memory cards often use the FAT file system, which only allow a certain amount of files in the root directory.

cp -r memorex /media/memcard

Configuring the Firefox browser

FirefoxThis procedure will configure the Firefox web browser for the Ubuntu 11.10 operating system.

If you will be using Firefox for printing to paper or file, such as PDF, then you will find, that Firefox is extremely bonded to the letterbox format and forced variables in headers and footers. You can change the settings over and over. Firefox will forget your settings – and go back to its default settings. Firefox is now in version 8. It’s still a problem. The only known solution is to open the secret configuration table about:config, apply the “paper_size” filter, change settings as necessary, apply the “header” filter, change settings as necessary, apply the “footer” filter and change settings as necessary. A double click will open the value for editing. Restart Firefox. You might notice, that Firefox uses the same settings for the “Print to File” printer as your printer.

If you will be using Firefox to store or document the content of closed forums, social web sites or web pages in general, open the Add-ons Manager, install the pdfit and restart Firefox. The Add-ons Manager can be opened by pressing Ctrl+Shift+A. pdfit can generate PNG and PDF documents.

If you will be using Firefox for Facebook – and would like to keep track of pending friend requests, lost friends and more, open the Add-ons Manager, install Greasemonkey and restart Firefox. The Add-ons Manager can be opened by pressing Ctrl+Shift+A. Install the Unfriend Finder script from this link or from the homepage. Unfriend Finder has a built in backup and restore function.