Saturday, November 29, 2008

Fedora, OpenSuse, FreeBSD, OpenSolaris

I've been running Fedora for some time at home and on several work computers--most recently the latest Fedora 10 development branches. I ventured out to try OpenSuse, and brought in Beta 5. I must admit, I was blown away. I had last run OpenSuse a year or so ago, and was not as impressed as I was with Ubuntu at the time. In case you're wondering my preferred Linux distro goes something like this ( this goes back a ways )


Even given all the hype around the recent Fedora 10 release, I am still much more impressed with OpenSuse. I prefer zypper more than yum, and YaST2 either in console mode or graphics mode is much nicer than anything I've seen in Fedora or any other distro I've tried.

Earlier I posted about Fedora directory server and openldap. Well, I'm running OpenLDAP now and very happy with it. Fedora still has the nice gui admin tool. I stumbled on OpenSuse's User and Group Management tool which fully and graphically supports a back-end ldap configuration. So, it's easy to manage your ldap users with OpenSuse!

OpenSuse is well polished, looks great, easy to install ( again the best installer I've used ), the DVD even has graphical tools that analyze and help you fix a broken system.

Bottom line, if you haven't tried OpenSuse, I'd recommend trying release 11.1.

In my spare time the last few days, I also tried out FreeBSD. I ran it on my laptop for a few days and was impressed--getting to know the system and how it worked in comparison to Linux. I often try testing things out first in a virtual machine, but I don't think you really know an OS until you run it on bare hardware--especially with things like 3D acceleration support and hardware support.

I eventually decided I would really test it out, and cleared of my home server/workstation--could FreeBSD support everything I needed??? The first road block I hit was no NVidia 3d support on the AMD64 bit platform. Even though I checked NVidia's site, I somehow missed the i386 on the driver listed. Ok, I'll through on the i386 FreeBSD version. Well, this time I realized that virtualization products ( like VirtualBox I use ) have not been ported to any BSD. I do like running VirtualBox on my Linux system. We'll, as much as I wanted to really dig deep and run FreeBSD, I decided against it--I could have lived without VirtualBox, but knowing I had full 64 bit 3D support on Linux and VirtualBox, I decided Linux suited my needs better.

Next stop...OpenSolaris 2008.11. I'd run 2008.05, but had to ask myself what it really gave me over Linux outside of ZFS and DTrace which I can personally live without. I installed 2008.11 on my workstation. OpenSolaris has a great installer--very simple. Booting up caused me a little pain, because the installer did not overwrite my previous OpenSuse boot loader. I had to wipe out the MBR, reinstall, then it was fine.

OpenSolaris 2008.11 booted up into Gnome and it looks great. It immediately identified my printers ( both HPs ), but I had no full sound card support. I ran it for a bit, but was again asking myself, "do you really want to go through the trouble. Re-compiling from scratch all the packages you just get with a standard Linux distro. Installing add-on packages just to get features you get out of the box with Linux like firewalls, traffic shaping, network virtualization??" Not that those couldn't be done with OpenSolaris, but again I asked myself "why go through the pain?" when Linux already does it and does it very well. The answer was "no", and I am back with OpenSuse.

OpenSolaris and FreeBSD are great operating systems, however, Linux has come a long way and has so much to offer me today.

Thursday, November 27, 2008

Encoding Video Using Mencoder for the Xbox 360 with AC3 5.1 Surround Sound

Some time ago, I spent a lot of time learning how to encode video using the MPlayer encoder mencoder. I eventually found settings that worked, but the final video did not support AC3 ( 5.1 ) surround sound.

The question came up to me the other day about the Xbox's ability to play back 5.1, and I thought I would revisit the issue. I found an existing video on the net the said it was an AVI for the Xbox with 5.1 sound. Sure enough, I threw it on a usb drive, plugged it in, and had 5.1 surround sound.

I looked at the specs of the file, and after a few trial and error attempts, I had a dvd converted and playing back on my Xbox 360 in full glorious 5.1 surround sound.

The magic command I use is:

mencoder dvd://1 -ovc lavc -oac copy -channels 6 -lavcopts vcodec=mpeg4:threads=2:vbitrate=4500:autoaspect:turbo:mbd=2:trell=1:vpass=1 -o test.avi -ffourcc xvid -mc 0 -noskip -vf scale=854:480,softskip,harddup -ofps 24000/1001

This command produces an avi file with a variable-rate mpeg4 video and a 5.1 AC3 audio channel.

A few interesting points on the command. I use two-pass encoding. So, you'd have to run the command 2x changing the vpass to 2 on the second run. Even though I told it to copy the stream, unless I specifically added the "-channels 6" command, mencoder only encoded 2 channels. Another issue is that you have to force the FOURCC to xvid. The final issue I had was the aspect ratio. Without forcing the scale to 854x480 ( 16/9 DVD ), the Xbox would not scale it to 16/9. mencoder allows the -aspect flag, however, as the mencoder man page states, it is only recognized by mplayer. So, scale the video while encoding it, and it plays back fine.

There are lots of other options to mencoder--it's got to be the most complex command I've ever seen. The documentation for mplayer is great, so check there if you have questions.

If anyone knows how to or can figure out if you can encode H264 videos using avi or mpeg format with a 5.1 audio channel, drop me a line.

Handbrake is another great tool for converting videos. They have an XBox 360 preset, but it looks like it only supports faac two channel audio with x264 video. Handbrake is great since it auto-crops the video. Using mplayer/mencoder, I have to play the video first to figure out if it needs cropping and to get the correct cropping parameters to pass into mencoder.

Now, if only I had a huge server farm to encode my DVD collection.