Friday, February 11, 2011

OpenBSD NC4200: Editing .mkv file's subtitles. A fun project.

Well, this is basically a fun project. I have collections of anime and I was thinking about making Malay subtitle for some of it. Just for fun. I found that it's totally possible with OpenBSD. Here's the packages that I need:

mkvtoolnix-4.0.0
subtitleeditor-0.33.0p3
gstreamer-ffmpeg-0.10.11
x264-20100511
wordnet-3.0p4

mkvtoolnix have few programs that can manipulate .mkv files. I can extract subtitles from a .mkv file for editing purpose. Then there's program to merge the subtitle inside the .mkv file. There's also GUI for it which is named mmg.

subtitleeditor is a great subtitle editing program for .ass subtitles. It also has video preview panel in it. I had problem with subtitleeditor when it stated that I have missing H.264 decoder and I solved it by installing gstreamer-ffmpeg package. There's also error stating about missing audio decoder but I forgot the package I installed to solve it because I also installed gstreamer-plugins-bad-0.10.19p0 and gstreamer-plugins-ugly-0.10.15p0 also not forgetting x264-20100511. I use Subtitle Workshop in XP but subtitleeditor works great in OpenBSD and better at editing .ass subtitles.

wordnet is a thesaurus program. It's not required but I would like to check meaning of words so I can translate the existing subtitles better. As always, man is the best friend. Later then.

Wednesday, February 09, 2011

OpenBSD NC4200: Using Plantronics USB Headset.

It's been a while since I last post anything. My OpenBSD box is still running great. Yesterday I got a Plantronics USB Headset and I wanted to see if I can get it to work in my 4.8. When I plugged the headset, here's the dmeg:

uaudio0 at uhub1 port 1 configuration 1 interface 0 "Plantronics Plantronics USB Headset" rev 2.00/1.20 addr 3
uaudio0: audio rev 1.00, 10 mixer controls
audio1 at uaudio0
uhidev1 at uhub1 port 1 configuration 1 interface 3 "Plantronics Plantronics USB Headset" rev 2.00/1.20 addr 3
uhidev1: iclass 3/0
uhid0 at uhidev1: input=1, output=0, feature=0


Seems to be ok. Now to test the headset. For I change the symlinks for these files:

/dev/audio = from /dev/audio0 to /dev/audio1
/dev/sound = from /dev/sound0 to /dev/sound1
/dev/audioctl = from /dev/audioctl0 to /dev/audioctl1
/dev/mixer = from /dev/mixer0 to /dev/mixer1

Normally it can be done manually by using:

$ ln -sf /dev/audio1 /dev/audio

and using the same method for the other 3 devices. I read someone's post on the net and he provided with this simple script which I named chaudio.sh file.

====== chaudio.sh script starts ======
#!/bin/sh

p=$1

ln -sf /dev/audio$p /dev/audio
ln -sf /dev/sound$p /dev/sound
ln -sf /dev/audioctl$p /dev/audioctl
ln -sf /dev/mixer$p /dev/mixer

exit 0

====== chaudio.sh script ends ======

After I created the script, chmod it to executable and then just type:

$ sudo ./chaudio.sh 1

and all 4 symlinks got changed. Doing ./chaudio 0 will change the symlinks back to default sound.

I tried testing the USB headset using:

$ cat /dev/urandon > /dev/audio1

and I can hear sounds on the headset. But, here comes the unsolved (yet) part, using mplayer or mp3blaster will output the sound to the laptop's speaker. Drats. I'm currently trying to figure this out. Got something to do with sndio stuff I guess. Will update on this if I find anything interesting. If you know any tips for this, please share.

Update: I found out that my Plantronics USB Headset is faulty. It's wacko even in XP. Damn. Later then.