dinsdag 11 januari 2011

#09 | Synergy

Manual configuration works pretty well :-)

#08 | avidemux

New phone, avec possibilities to play video (HTC Hero). No divx or xvid support though, so we need to do some converting using avidemux. On Ubuntu:

#sudo apt-get install avidemux-qt

to install avidemux-qt. This seems to be the only version that actually works. Avidemux comes with some great powers. I've adjusted a script to easily convert my movies so that they can be played on a HTC Hero: video: MPEG-4 ASP (avcodec), Quantisation type: H.263, Resize filter width=480px. audio: AAC (Faac), 128kbps.

#cat script.js
var app = new Avidemux();

origx = app.video.width;
origy = app.video.height;

// calculate new y-value, assuming video is wide-screen (x > y)
x = 480;
y = (origy / (origx/x));

// resize filter
app.video.addFilter("mpresize","w=" + x,"h=" + y,"algo=0");

// video codec
app.video.codecPlugin("0E7C20E3-FF92-4bb2-A9A9-55B7F713C45A", "avcodec", "CQ=4", "<?xml version='1.0'?><Mpeg4aspConfig><presetConfiguration><name></name><type>default</type></presetConfiguration><Mpeg4aspOptions><motionEstimationMethod>epzs</motionEstimationMethod><fourMotionVector>true</fourMotionVector><maximumBFrames>0</maximumBFrames><quarterPixel>false</quarterPixel><globalMotionCompensation>false</globalMotionCompensation><quantisationType>h263</quantisationType><macroblockDecisionMode>rateDistortion</macroblockDecisionMode><minimumQuantiser>2</minimumQuantiser><maximumQuantiser>31</maximumQuantiser><quantiserDifference>3</quantiserDifference><trellis>false</trellis><quantiserCompression>0.5</quantiserCompression><quantiserBlur>0.5</quantiserBlur></Mpeg4aspOptions></Mpeg4aspConfig>");

// audio
app.audio.reset();
app.audio.codec("Faac",128,4,"80 00 00 00 ");
app.audio.normalizeMode=0;
app.audio.normalizeValue=0;
app.audio.delay=0;
app.audio.mixer="NONE";
app.setContainer("MP4");
setSuccess(1);

This script could be placed in the ~/.avidemux/custom/ directory. It should be visible then in the custom menu of avidemux. I prefer to batch my videos though:

#cat batch.sh
#!/bin/bash
VAR="files.txt"
ls *.mkv | sort > $VAR
cat $VAR | while read line; do
  INPUT=$(echo ${line})
  OUTPUT=${INPUT%.mkv}
  OUTPUT+=".mp4"
  avidemux2_qt4 --nogui --load "$INPUT" --run ~/.avidemux/custom/script.js --save "$OUTPUT" --quit
done
rm $VAR

Above script searches for all .mkv files within the current directory and converts them to a .mp4 file using the custom script provided above. Make sure to chmod +x it and run it with ./ instead of sh.

note: I am experiencing stuttering on some of the videos that I converted. Not sure why.

#07 | WPC54g on Ubuntu

Let's assume you have a Windows/Ubuntu dual-boot system. You had a rough youth and now you're using an Intel wireless adapter and some weird network setup. Unfortunately for you, Ubuntu is experiencing problems connecting to the wireless network. You should, off course, look for the core problem and fix this (write a better driver...), but, you could also use that old Linksys WPC-54g wireless card you have lying around somewhere.

So here you go: plug-in that nice piece of PCMCIA hardware and you're up. Or not. Turns out that Ubuntu doesn't have the correct drivers installed. And how could we install drivers without having a working Internet connection? ....... It's Windows time all over again.

Searching the web, being unlucky as you are, you'll find yourself stuck in (a) searching for the correct debian package, followed by (b) finding that the package does not contain the actual driver. It is easy to fix this on your own, but having the solution out here, is much easier :-)

It comes down to this

wget http://www.vvdveen.com/broadcom-wl-4.150.10.5.tar.bz2
export FIRMWARE_INSTALL_DIR="/lib/firmware"

if [ ! -d "$FIRMWARE_INSTALL_DIR" ]; then
mkdir -p $FIRMWARE_INSTALL_DIR
fi

tar xjf broadcom-wl-4.150.10.5.tar.bz2
cd broadcom-wl-4.150.10.5/driver
b43-fwcutter -w "$FIRMWARE_INSTALL_DIR" wl_apsta_mimo.o