Skip to content

Convert Windows Live Movie Maker to Windows DVD Maker (approximately)

29-Dec-10

What does this menu choice from Windows Live Movie Maker look like to you:

image

Well, to my wife, it looked like Windows Live Movie Maker could make DVD’s. I don’t blame her. I mean, the thing has “Movie Maker” in its name—and it has a “Burn a DVD” menu option. She spent about an hour putting together a slideshow for her grandmother using Windows Live Movie Maker.

Except Windows Live Movie Maker isn’t the same thing as Windows DVD Maker. How ever would you confuse the two. Windows Live Movie Maker can’t make DVD’s—at least not the kind that you play in a DVD player. It can, however burn a movie file (windows media video file) to a DVD—which is playable on a computer, but not on a DVD player. So, it lets you do things that you probably would just use a flash file for.

I had to figure out how to get all her pictures into DVD maker. The one great thing about Microsoft is that they’ve embraced XML file formats—everywhere. So, all these programs read and write XML. I wrote a small Python program to translate (approximately) from Windows Live Movie Maker to Windows DVD Maker. It’s in Python 3.1:

[cce_python]

import xml.etree.ElementTree as etree

tree = etree.parse(‘D:/Users/Poojan/Documents/My Movie.wlmp’)
outfile = open(‘D:/Users/Poojan/Videos/2010-12-28 For Grandma.xml’, ‘w’)
outfile.write(‘<BurnWizard><Content>’)

root = tree.getroot()
media_items_roots = root.findall(‘MediaItems’)

for m in media_items_roots:
media_items = m.findall(‘MediaItem’)
print(media_items)
media_items.sort(key=lambda m: int(m.attrib[‘id’]))
for media_item in media_items:

print(media_item.attrib[‘filePath’])
outfile.write(‘<ContentFile Filename=”{0}”/>’.format(media_item.attrib[‘filePath’]))

outfile.write(‘</Content><Title>12/28/2010</Title><Style>Soft Focus</Style><Font Name=”Segoe UI” Color=”0xFFFFFDA4″ Bold=”1″ Italic=”0″/><Button Play=”Play” Scenes=”Scenes” Notes=”Notes”/><Notes></Notes><InsetVideo></InsetVideo><BackgroundVideo></BackgroundVideo><MenuAudio></MenuAudio><SceneButtonName>Circle</SceneButtonName><SlideShow Transition=”Cross fade” PanZoom=”1″ MatchMusic=”0″ Length=”7.000000″/></BurnWizard>’)

[/cce_python]

Update:

One thing you should be aware of is that WLMM supports .mov files (quicktime movies), but Windows DVD Maker does not. In fact, Windows DVD Maker will fail–but only after going through the process of trying to transcode all your files to DVD format. If the .mov files are at the end of your slideshow (which was my case), you’ll watch patiently for a long time, and then be dissapointed.

Be the first to like.

My Windows Home Server Atom D525 Build

27-Oct-10

My portwell machine finally died. No idea what’s wrong with it. It was never super-reliable to begin with. It would shut down randomly (I presumed due to a flaky power connector—but now I ‘m not so sure). Anyway, I decided to go ahead and build my own Atom D510 PC. This would not normally make much sense financially. I am an MSDN member, and get the OS for free (and I’d use FreeBSD/FreeNAS otherwise). But, to be honest, I did it just because I wanted to, not because it optimizes any specific cost or performance metric.

What follows is a photo diary of how I built this machine, including two external hard drives that I stuck inside the computer case (to save space).

I started with this Gigabyte D525 motherboard/CPU combo (NewEgg used to have it cheaper, but now Amazon has it for the same price with free shipping; I paired it with 4GB of DDR3):

Atom D510 Build 001Atom D510 Build 002

The reason I picked this motherboard is that it has the dual-core D525, and it has a total of 4 SATA connections. Two are on the Intel chipset and one is on a Gigabyte chipset.

I picked up this case for about $20 on Amazon (it’s now $30):

Atom D510 Build 005Atom D510 Build 006

This was the perfect case, because it was cheap. It didn’t come with a fan, but I don’t need one due to the Atom’s low power draw. (The Gigabyte does have a CPU fan on it, and connectors for a system fan if you want one.)

The case included a bunch of extra screws, including standoffs; here’s the motherboard sitting on the standoffs:

Atom D510 Build 008

I also bought this reasonably-priced efficient power supply (now out of stock):

Atom D510 Build 003Atom D510 Build 004

I didn’t want to over-size the supply, since the power efficiency tends to drop as the power increases (unless you need the extra power). If it had been available for cheaper, I’d go with a 180W rather than the 250W. This was the cheapest 80-PLUS power supply I could find.

One hitch between the motherboard and case was that the case’s cut-outs for ports (USB, PS/2 keyboard/mouse, VGA) didn’t line up correctly:

Atom D510 Build 007

Luckily, the Gigabyte also came with its own cut-out that fit perfectly in the case (the case’s cut-out was removable):

Atom D510 Build 009

Some reviewers complained that the power supply’s cables were too short. They were just perfect for my use:

Atom D510 Build 010

I stashed a couple internal (IDE+SATA) hard drives within the case. I also bought a couple SATA to eSATA cables, and stuck a couple external SATA hard drives within the case (just sitting loosely) to save space:

Atom D510 Build 017 cropped

Windows Home Server “Vail” runs pretty smoothly on this machine. I did, in the end, buy another 1 TB hard drive to replace one of the 250 GB hard drives I had in there. I’m very happy with the way this machine turned out.

More pictures:

Atom D510 Build 011Atom D510 Build 012Atom D510 Build 013Atom D510 Build 014

Be the first to like.

Windows Home Server Vail connector install not compatible with NOD32 AV

11-Sep-10

I’m trying out Windows Home Server preview (Vail). When I try to install the connector software (that allows my desktop PC’s to be consoles into Windows Home Server), I get the following:

image

I tried many things (including diasbling OpenDNS). As it turns out, the problem was my antivirus. When I temporarily disabled the NOD32 antivirus, things worked fine—even with OpenDNS enabled.

Be the first to like.

Installing FreeBSD from USB (created using Windows)

05-Sep-10

Be careful. You’re creating a FreeBSD boot image using Windows. It’s sometimes difficult to see which hard disk you’re writing to. See here:
Writing FreeBSD memstick.img to a USB drive in Windows « Koitsu’s Blog

Download dd for Windows here: chrysocome.net – download. I chose beta 0.6.3. Unzip it, and take a look at the options:


dd [bs=SIZE] [count=BLOCKS] [if=FILE] [of=FILE] [seek=BLOCKS] [skip=BLOCKS] [–s SIZE and BLOCKS may have one of the following suffix:
k = 1024
M = 1048576
G = 1073741824
default block size (bs) is 512 bytes
skip specifies the starting offset of the input file (if)
seek specifies the starting offset of the output file (of)

I had to run CMD and then dd as administrator (on Windows 7). Unless I did that, I couldn’t see the NT Block Device Objects. When I ran as administrator, i got the following (in addition to other outputs):


NT Block Device Objects
\\?\Device\CdRom0
size is 2147483647 bytes
\\?\Device\CdRom1
size is 2147483647 bytes
\\?\Device\Harddisk0\Partition0
link to \\?\Device\Harddisk0\DR0
Fixed hard disk media. Block size = 512
size is 80000000000 bytes
\\?\Device\Harddisk0\Partition1
link to \\?\Device\HarddiskVolume1
\\?\Device\Harddisk0\Partition2
link to \\?\Device\HarddiskVolume2
\\?\Device\Harddisk1\Partition0
link to \\?\Device\Harddisk1\DR1
Fixed hard disk media. Block size = 512
size is 250000000000 bytes
\\?\Device\Harddisk1\Partition1
link to \\?\Device\HarddiskVolume3
\\?\Device\Harddisk2\Partition0
link to \\?\Device\Harddisk2\DR2
\\?\Device\Harddisk2\Partition1
link to \\?\Device\HarddiskVolume4
\\?\Device\Harddisk3\Partition0
link to \\?\Device\Harddisk3\DR6
Removable media other than floppy. Block size = 512
size is 4007657472 bytes
\\?\Device\Harddisk3\Partition1
link to \\?\Device\HarddiskVolume8
Removable media other than floppy. Block size = 512
size is 25600000 bytes

Then, I ran the dd command. I got a file permission error problem. I went over to the Windows volume manager and formatted the drive I was interested in. Windows formatting of the drive failed, too. It created a partition with a size of 24MB. After that, though, I could run dd:


D:\Users\Poojan\Downloads\dd-0.6beta3>dd bs=10240 if=..\8.1-RELEASE-amd64-all\FreeBSD-8.1-RELEASE-amd64-memstick.img of=\\?\Device\H
arddisk3\Partition0 –progress
rawwrite dd for windows version 0.6beta3.
Written by John Newbigin <jn@it.swin.edu.au>
This program is covered by terms of the GPL Version 2.

It has been running for quite a while. It’s up to a count of 470,000,000 right now.

After about 30 minutes, it’s finally done:

D:\Users\Poojan\Downloads\dd-0.6beta3>dd bs=10240 if=..\8.1-RELEASE-amd64-all\FreeBSD-8.1-RELEASE-amd64-memstick.img of=\\?\Device\H
arddisk3\Partition0 –progress
rawwrite dd for windows version 0.6beta3.
Written by John Newbigin <jn@it.swin.edu.au>
This program is covered by terms of the GPL Version 2.

1,075,384,320 105018+0 records in
105018+0 records out

2 people like this post.

Partitioning with gpt

04-Sep-10

Sometime ago, I setup a ZFS system using glabel on FreeBSD. I recently stumbled across this FreeBSD diary entry, which describes to do almost the same thing using gpt. I like this method better, because it results in a partition that is on a 4kB boundary, which works better for some hard drives (whose sector size is 4kB).

Here’s what I did:

#gpart show da0
=>        63  1953525105  da0  MBR  (932G)
63  1953525105       – free –  (932G) 

OK: that’s the starting point. I have a MBR-style partition which is set up as one 932G partition and some free space.

I wasn’t sure exactly how to get rid of it, so I tried:

# gpart delete -i 1 da0
da0s1 deleted

I still have a MBR-style partition table. Next, as I read in the FreeBSD diary, I need to figure out how many sectors I have:

# dmesg | grep “da0”
da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
da0: <Hitachi HDS721010CLA332 > Fixed Direct Access SCSI-2 device
da0: 40.000MB/s transfers
da0: 953869MB (1953525168 512 byte sectors: 255H 63S/T 121601C)

OK: 1953525168 sectors of 512 bytes each. However, for some reason, that isn’t what gpt shows:


# gpart show da0
=> 34 1953525101 da0 GPT (932G)
34 1953525101 – free – (932G)

I’m not sure if this smaller size is because 34 sectors are taken up by the partition table, or if it’s a cylinder-boundary thing.

As the article recommends, I want to leave the first 1MB free (Windows does this, too). I also want to leave around 200MB free at the end of the disk (to allow for some slack in case I want to replace this disk). So, I have 1953525168 sectors (total) – 2048 sectors (1MB) – 409600 (200MB) = 1953113453 sectors:


fbsd2# gpart add -b 2048 -s 1953113453 -t freebsd-zfs -l Hitachi_1TB da0
da0p1 added


# gpart show da0
=> 34 1953525101 da0 GPT (932G)
34 2014 – free – (1.0M)
2048 1953113453 1 freebsd-zfs (931G)
1953115501 409634 – free – (200M)

Looks good: the partition is 931GB large. I have 200MB of slack at the end, and it starts 1MB into the disk. Now, let’s replace the old glabel-based partition with this one:


# zpool replace tank label/hitachi_1tb gpt/Hitachi_1TB


# zpool status
pool: tank
state: DEGRADED
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scrub: resilver in progress for 0h0m, 0.01% done, 95h54m to go
config:

NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
label/fantom_500gb ONLINE 0 0 0 6.27M resilvered
replacing DEGRADED 0 0 0
label/hitachi_1tb OFFLINE 0 1.83K 0
gpt/Hitachi_1TB ONLINE 0 0 0 9.41M resilvered
label/fantom_1tb ONLINE 0 0 0 6.25M resilvered

Pretty cool.

Be the first to like.

Disk space calculation for streaming my music

29-Aug-10

I’ve been wondering how much disk space I would need if I wanted to run an ampache server on my web host. I get 10 GB of space on my web host. Is it enough to house copies of my music? Even if I down-graded them to 64 kbs AAC+?

Last night, I went through all my music and found duplicates files. I’m now down to (according to dirstat) about:

FLAC: 25.7 GB
MP3: 27.4 GB
M4A: 7.8 GB

The FLAC is around 700 kbps (CD is 1411 kbps and I’m assuming 50% compression). I’m estimating the MP3’s (conservatively) to be 200 kbps. The M4A are probably around 200 kbps as well.

So, when compressed, this would end up being around:

FLAC: 2.4 GB
MP3: 8.8 GB
M4A: 2.5 GB

Total: 13.7 GB

I generally can’t notice the difference at 64 kbps AAC+. However, this is a bit past what I have available right now. Also, I’d be paying for high bandwidth yet using low bandwidth to stream. I’ll think about it.

Be the first to like.

Setting up public (anonymous) shares on Samba

23-Jul-10

It’s documented here: http://micheljansen.org/blog/entry/182. However, I only found this post after learning each lesson individually.

I wanted to set up a \\server\Public share that anyone on the network could connect to. Certain users can write, but everyone can read.

I tried enabling guest ok in /usr/local/etc/smb.conf (and changed the file/directory masks, so anyone can read by default):

[cc_ini]
[Public]
comment = Public (user-wide) directories
browseable = yes
writeable = no
path = /tank/Users/Public
guest ok = yes
write list = Me, Wife
create mask = 0775
directory mask = 0775
[/cc_ini]

That didn’t work. Then, I read that you can specify which Unix account guest should map to. However, by default it is nobody, which should work.

I finally found the key: A Samba directive called map to guest which tells Samba that any user that doesn’t pass the login should be mapped to the guest account. I placed this in my [Public] share definition. Samba complained. I then placed it in the [global] section, and it worked!

Be the first to like.

Limit number of instances of a specific process and user

22-Jul-10

I’m using this to limit the number of processes that Ampache spawns. Sometimes, it goes hay-wire.

[cc_bash]
#!/bin/sh

cmd=”$1″
lim=”$2″
user=”$3″ || “www”
numprocs=ps -U www | grep "$cmd" | wc -l
echo “Found $numprocs comparing to $lim”
if [ “$numprocs” -gt “$lim” ]; then
echo “found $numprocs processes”
killall aacplusenc
fi
[/cc_bash]

Be the first to like.

Using git with large files

20-Jul-10

I’m using git to keep snapshots of large files. These are outputs of long runs of tools, that would take a long time to re-construct. Using git has the benefit of true version control on the input design files, and an archive of the large, time-consuming outputs.

The idea here, however, is to save time, not disk space. I’ve found that when I check in, git runs for a long time–likely trying to compress the data. It’s unlikely that the large files can be compressed very much (the input-to-output process is a bit chaotic). So, I want it to try less with finding deltas, etc.

The two options that do that are:


git config –add pack.window = 3 # default is 10

and

git config –add pack.depth = 3 # default is 50

The first says not to look at more than 3 “adjacent” (close in type, size, and name) objects for candidates of a delta. The second option says not to look at more than 3 previous versions for a delta. Basically, if you do a lot of branching and merging, the second one is of advantage. However, in my case, the development is pretty linear, so the best delta for any object is the one I checked in previously (not 50 back).

Be the first to like.

Setting up bags, recipes, and users in TiddlyWeb(Wiki)

15-Jul-10

Up to now, I’ve been using TiddlyWeb as a server-hosted version of TiddlyWiki. This is a fraction of what’s possible with TiddlyWeb. One can create bags which are self-contained stores of tiddlers. One can combine these bags using recipes. Different users can have access to different bags and to different recipes.
By default, TiddlyWebWiki comes with a recipe aptly named default which is owned by a user named administrator. This recipe pulls in tiddlers from two bags: system and common.
Basically, system has the innards that make TiddlyWiki work over TiddlyWeb (the combination of which is called TiddlyWebWiki). common contains stuff that’s supposed to be common between all users.
To customize permissions, one needs to do the following:

  1. Create users
  2. Set up a bag other than common to house per-user (or group) tiddlers
  3. Set up a recipe that exposes the bag to users (or groups thereof)

Setting up a new user is performed by running


twanager adduser UserName UserssAwe$om3P@assw0rd USERROLE WORKROLE BLAHBLAROLE

A role is essentially a user group that one can use to set group permissions on bags/recipes. To set up a new bag, etc. Here’s what you do:


(tiddlyweb)[username@host main_inst]$ twanager bag personal

Now, entere the following and terminate it with CTRLD (^D):
{“policy”: {“read”: [“UserName”, “R:ADMIN”], “create”: [“UserName”, “R:ADMIN”], “manage”: [“R:ADMIN”], “accept”: [“UserName”, “R:ADMIN”], “write”: [“UserName”, “R:ADMIN”], “owner”: “UserName”, “delete”: [“UserName”, “R:ADMIN”]}, “desc”: “UserName’s personal bag”}
^D

If you make a mistake, you can edit the fields that define this bag manually with

vi store/bags/personal/policy
vi store/bags/personal/description

Now, for the recipe:

twanager recipe personal

And type in:

desc: UserName’s personal recipe
policy: {“read”: [“R:ADMIN”, “UserName”], “create”: [“UserName”, “R:ADMIN”], “manage”: [“R:ADMIN”], “accept”: [“UserName”, “R:ADMIN”], “write”: [“R:ADMIN”], “owner”: “UserName”, “delete”: [“R:ADMIN”]}

/bags/system/tiddlers
/bags/common/tiddlers
/bags/personal/tiddlers
^D

Since /bags/personal/tiddlers is specified last in the list, that’s the default bag that UserName‘s tiddlers will go.

You can edit this recipe definition after the fact with:

vi store/recipes/personal

I haven’t tried this, but another option is to use a template recipe such as:

desc: Any user’s personal recipe
policy: {“read”: [“R:ADMIN”, “R:USER”], “create”: [“R:USER”, “R:ADMIN”], “manage”: [“R:ADMIN”], “accept”: [“R:USER”, “R:ADMIN”], “write”: [“R:ADMIN”], “owner”: “”, “delete”: [“R:ADMIN”]}

/bags/system/tiddlers
/bags/common/tiddlers
/bags/{{ user }}/tiddlers
^D

where {{ user }} will get replaced with the login of the current user. I’m not sure how the bag for each user gets created, though. Also, in the above, I specified the role USER (specified with “R:USER”), which is something you’d set up when you add a user.
Finally, to access the newly-created TiddlyWiki described by the above storage scheme (recipe), one would visit http://TiddlyWikiURI/recipes/personal/tiddlers.wiki.

Be the first to like.