Sunday, January 30, 2011

Convert from .mkv to .avi

MKV is a new format which is now more and  more used to store video content. Most of the Media Players (like vlc, dragon-player, Windows Media Player, ...) can handle this format. But there are still players which can't handle it. There are also a few other reasons to store your movies not in the mkv format. However, the way to go from mkv to an avi file is not very obvious.

I found a lot of different converters and got a few different results. I will explain now the easiest way to get your avi file. First you need to install mencoder. This is a command line utility available for windows and linux. Then enter following command:

Linux:
mencoder yourMkvMovie.mkv -oac mp3lame --xvidencopts pass=1 -o yourMovie.avi
Windows:

"C:\Program Files\mplayer\mencoder.exe" "c:\sample.mkv" -oac mp3lame -ovc xvid -xvidencopts pass=1 -o "c:\sample.avi"



The Parameters:
-oac mp3lame: Says how the audio should be encoded. In this case we use mp3

-ovc xvid: Says how the video should be encoded. In this case we use xvid (avi)

-xvidencopts pass=1: We use the one pass encoding. Here you can also specify how much threads mencoder can spawn. For more information take a look at the man page.

Friday, January 7, 2011

Arch Linux uninstall KDE

Since there is no section about this in the arch wiki i decided to write an entry about this.

To remove all KDE packages just execute this as root:

for i in $(pacman -Sqg kde-meta); do pacman -R ${i#kde-meta-};done

Linear Layout Menu with Scrollbar on Android

If you design a menu for android phones you will probably reach the end of the screen before you have placed all your elements. The solution is very easy: just use a scrollbar to enable the user to scroll up and down to see everything.

To do so you have to wrap your linear layout with a ScrollView and wrap the scroll view again with a LinearLayout. Set the height to whatever you want but keep in mind that you should not use px (pixel) to for that since it is an absolute value.













I used dp (Density-independent Pixels) which is an abstract unit that is based on the physical density of the screen. These units are relative to a 160 dpi screen, so one dp is one pixel on a 160 dpi screen. The ratio of dp-to-pixel will change with the screen density, but not necessarily in direct proportion. Note: The compiler accepts both "dip" and "dp", though "dp" is more consistent with "sp".

sp is like the dp unit, but it is also scaled by the user's font size preference. It is recommend you use this unit when specifying font sizes, so they will be adjusted for both the screen density and user's preference.

Monday, January 3, 2011

Some figures from 2010

The new year just began and i do what a lot of other people do at that moment. I take a look at the year 2010 back and analyze my figures. Most visitors (87%) are using Windows followed by 10% Linux and the rest is shared between Nokia/Symbian, Mac and other Unix. I think this is quiet special for a Linux/Unix blog. But f you think that most users are using windows it doesn't surprise to see the Internet Explorer as most preferred browser (72%) ahead of Firefox (12%), Chrome (7%) and Opera (5%).

Top visitor Countries are USA, Russia, Germany, Canada and Brazil in that order. There are about 200 unique visitors a month which is not a lot but for me enough to stay on track and post further entries in 2011.

All statistical information in this article is provided by Google Analytics.