Streaming media from Amazon S3

Business, Political, Tech, Travel, Web 10 Comments

Thanks John for the reminder to investigate S3 as a business media hosting service, it works like a charm!

Now that I have far fewer bandwidth worries (max $0.17 per GB), the Torus Knot site includes a nifty dynamic selector so you can pick low, medium or high quality - the latter is at a higher resolution too, clocking in at about 100Mb. I may well use S3 for future public commercial downloads in the future too. It’s altogether more convenient than the block bandwidth allocations you get with regular hosting packages, since it scales dynamically at a very fine level of detail depending on demand. And don’t be fooled by ‘unlimited’ bandwidth offers, all hosting companies have to pay for bandwidth and there’s no such thing as ‘unlimited’ resources; you’ll actually find your bandwidth being throttled or cut off via a ‘reasonable use’ clause in the small-print; ‘unlimited’ is simply a marketing lure. If you want truly scalable guaranteed bandwidth, you have to pay for it.

Getting S3 media hosting working wasn’t that hard, but did require a few discrete steps. Firstly, you need to create a bucket in your S3 account which is all in lower case, is globally unique and is DNS-compatible; so for example I created a bucket called ‘media.torusknot.com’.

Then to make it all look nice you need to create a DNS CNAME entry to map a sub-domain of your site to that S3 bucket; in my case I mapped ‘media.torusknot.com’ to ‘media.torusknot.com.s3.amazonaws.com’. That allows me to access any files I upload to that S3 bucket via ‘http://media.torusknot.com/somefile.jpg’. You do just need to set the ACLs on the files & the bucket to make sure public access is allowed.

Finally, if you want to stream video files via a Flash player from S3 to another domain, you also have to tell Flash that it’s ok for the content to be pulled in from a different domain. Create a file called ‘crossdomain.xml’ in the bucket, with these contents:

<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
</cross>

That allows the media to be accessed from anywhere - you can be more specific if you want but this is the simplest approach.

Once again I’m using the excellent FlowPlayer; my only issue with it is that the ‘buffering’ animation seems to not work all the time (so be patient if you’re viewing the high quality version).

Gotta love this cloud computing business :)

New OgreSpeedTree media up

Business, OGRE 11 Comments

A few people asked for an OgreSpeedTree video with more varied scenes, and I’ve now uploaded one to the OgreSpeedTree section of the Torus Knot site. Just scroll down below the screenshots if you want to view the video.

I have a higher resolution & better quality version (this one is H.264 at 1Kb/s) but I’ve kept this one small for now to keep my bandwidth under control. Places like Vimeo don’t allow commercial advertising, and while before I could get away with claiming it was just in-development test output shared with enthusiasts only, this is really an advertisement video so I’m hosting it myself. I have enough bandwidth to spare unless something really goes bonkers (I think) - in case it does, does anyone know of any reasonably priced business media hosts (UK only), should I need something more than just upping my bandwidth allowance? I’ve seen a few dedicated streaming media hosts around but don’t have a view on how good they are.

OgreSpeedTree 1.0 entered RC1 a week ago and I haven’t had any reports of any issues, so I’m pretty much ready to stick a fork in it & declare it done for now. I’ve been improving OgreSpeedGrass this week, such as making the grass paging re-entrant so that new cells can be filled gradually to spread the buffer update overhead over many frames, that seems to have helped in busier scenes. That just needs a couple more utility functions for loading in grass distributions from tools, then that will be done too. Then, it’ll be time to get the marketing wheels moving…

8000 trees and 2.5M blades of grass? No problem.

Business, Development, OGRE 12 Comments

I’ve been crazily busy lately trying to get OgreSpeedTree to a fit state for a 1.0 release alongside other projects (such as Ogre of course), so I can really start promoting it. Being the kind of person I am, I find it hard to stop tinkering and perfecting and I can’t let something go out the door without being totally happy with it. The screenshots and videos so far have been good I think, but I’ve been polishing away and making it all just that bit better, and one element of that has been some additional optimisation.

Thanks to some improved batching, OgreSpeedTree is now running even faster than before, and most importantly it scales to larger forests even better than before too. Here’s a short video where I tested adding over 8,000 trees (from 5 different models, and each with different rotations / scales) to the scene, together with over 2.5 million blades of grass, each of which can  be placed individually (I procedurally generated the distribution, but it could be done manually). Actually some of those tree models have multiple trees in them (the very close ‘clusters’ of 3/4 are actually one model), so in reality there are actually 12,000+ trees as far as the viewer is concerned.

Note that all the trees here are dynamically lit including normal mapping, and dynamic shadows are being cast through 3 shadow textures (PSSM). The LOD transitions are extremely hard to spot IMO too.

On my 9800 GX2 with a 2.66 dual-core, it runs consistently over 60fps (actually about 75fps most of the time). This is with a quite dense  clustering of the trees too; If you spread the trees out a bit more you can easily double that. The LOD settings are quite high too; reign those in and your lower class cards should be able to easily handle this, and of course you have the option of dropping or scaling back the dynamic shadows if you’re pushed.

I’m happy :) Not that I’ve quite finished of course, I have a couple of things still to polish for 1.0, but it shouldn’t be long now.

OgreSpeedGrass

Business, OGRE 12 Comments

Next in the line of OgreSpeed* products, here’s a shot of OgreSpeedGrass.

It’s based on IDV’s SpeedGrass but I’ve rewritten a fair amount to make it work conveniently with Ogre, and also improved it somewhat - such as better wind effects and the completely dynamic lighting and shadowing you see there, which I think looks rather nice.

OgreSpeedGrass will be bundled with a yearly support agreement for OgreSpeedTree, in the same way that the original SpeedGrass is licensed. I’m not looking for any additional beta testers right now, but there will be an official 1.0 release of both these libraries by the end of the month; if you’d like to be notified when that happens, please email enquiries at torusknot dot com.

More shots are available in the Ogre gallery.

Edit: and here’s a video, for those who asked:

Great video on making money as a startup

Business, Tech 1 Comment

David Heinemeier Hansson is famous for being the guy that invented Ruby on Rails and running 37Signals; I  have mixed feelings about Rails personally (great for some things, not so great for others, but then that applies to pretty much every technology), but this presentation he did on making money as a tech startup is very good indeed - insightful yet very amusing.

He presents in an online context for the most part but as he says himself, the principles apply to all kinds of product. It also dovetails in nicely with what I was saying a few days ago about open source and business, in that there are similar arguments about not believing the hype we’re often sold by high-profile business news stories.


Found via Matt Asay.

Exchange rate gambling: I win for a change!

Business, Political, Travel 3 Comments

One of the problems with doing most of your business internationally is that you’re at the mercy of currency exchange rates, with the ever-present possibility of losing money just because the market changed. In the last couple of years the Pound has steadily got stronger against the Dollar, meaning it’s not a case of whether I lose, but rather how much. It has also meant that for new work I either have to stick to my Pound rates and risk being less competitive, or just accept a lower & ever-depreciating Dollar rate in order to secure the work.

Over the last month though, things have suddenly changed. The UK housing market is in free-fall, and most recently the Chancellor gave a rather unexpectedly candid interview in which he basically admitted that the UK economy is up a certain creek without a certain paddling device. Nice of him to be honest about it, but the markets aren’t used to such lack of spin and reacted quite badly (being as they are twitchy, caffeine-overdosed sheep suffering from chronic panic attacks) - and promptly leaped off a metaphorical cliff, as did the exchange rate. Perhaps the Chancellor’s honesty is attributable to those eyebrows - I’m guessing they make bluffing considerably more difficult :)

Lots of people are now lamenting on the news & talk panels about how this will affect the price of imports, but there’s never a shortage of people to go on these programs declaring that we’re all doomed and we might as well throw ourselves under the next passing bus. Personally I find it rather ridiculous because these are the same people that were lamenting when the rate went up in the first place, because it would cripple all the exporters in Britain (and we might as well throw ourselv….you get the idea).

Personally, I’m glad - the Pound/Dollar rate has finally returned to about what it was when I went into full-time business in 2006 ($1.77 ish), having dropped over 10% in a month. I wouldn’t mind if it dropped a bit lower - I was quite happy when it was about 1.6 personally. Sure I’ll pay more if I buy something from the States, but far more money comes in my direction from there than the other way around.

So, to the Chancellor: thank you, Darling! ;)

Inflated pricing models

Business, Personal, Travel 12 Comments

My wife mentioned to me a week or so ago that one of her work colleagues had recently had a hard drive crash on her laptop. Having replaced it, she wanted to try to get some of the data back from the disk, because she had a lot of family photos on there which were not backed up (I’m sure this experience has informed her future back-up plans).

However she had taken it to a local store, which I won’t name, who quoted her £600 to recover the photos. £600! They could be excused some element of estimate padding here, since you never know how long these things might take, but £600 really is taking the p*ss. Even if it took them a couple of days constantly sitting at the machine to recover the data, that would be an inflated rate for this kind of work. At the least they could have done a quick initial test and told her how difficult it was likely to be.

I was disgusted when I heard, so I volunteered to take a look at it. It took a while to process everything, but most of that was a machine chugging away in a corner without me having to do anything. I connected the drive up to a Linux machine, so I had the option of using free tools (like PhotoRec and ddrescue) to try to manually scan / repair the disk if it was too badly damaged, but it turned out that wasn’t necessary; even though some of the blocks were certainly damaged, most of the disk was in good enough condition to get the most important data back.

I felt embarrassed that someone in ‘my’ industry tried to take advantage like that, especially of an individual over their precious family photos. Quoting the price of a new laptop to recover some data? Maybe they just didn’t want to do it, so quoted a silly price to get rid of her. Maybe they were paranoid about getting bogged down in a messy data retrieval task, although that could have been mitigated with an hour of staff effort (and a few hours of unattended machine time), which they could have required as a minimum, and should have cost less than a tenth of that price. Or maybe they just didn’t know what they were doing. Worst case scenario would be if they deliberately quoted a stupidly inflated price because they knew the photos were irreplaceable and that she’d pay whatever they asked, but I’d prefer not to believe that.

Shameful, either way.

Mixing Open Source & Business - my take

Business, Open Source, Personal 17 Comments

Bruce Byfield wrote an interesting article (discovered via Matt ‘Alfresco’ Asay’s blog, which should be required reading for anyone in this field) about the sometimes unsteady alliance between open source and business that, on the whole, I agreed with - within a given context. I do think, however, that his context was weighted towards the larger players in market that are fusing open source with business opportunities though, and wanted to share some of my experiences and conclusions from the perspective of a more individual player in the business.

Apologies for the length of this article, I had a lot to say :)

Read the rest of this entry »

Lag Issues

Business, OGRE, Travel 1 Comment

I’m finally back at home and beginning to return to normal, trying to iron out the wrinkles in my sleep cycles. I’ve done 12 flights in the last month (I’m trying not to think of my carbon footprint, although at least I rarely drive back home) with a time zone range of 10 hours and I’m certainly feeling it - I’ll be happy to be settled in one place again for a while!

Siggraph was fine, very hectic with some long hours on the booth and some very late evenings at the office - as such I was lucky if I got to check my email for 10 minutes in the day, never mind trying to cope with the OGRE forum. I managed to meet up with a number of people from various companies in between working for my client which was great (such as AMD, NVIDIA, IDV, FMX), and even got recognised a couple of times by people I didn’t know which was kinda cool. On a personal level it was also great to finally meet Andres Carrera, aka Lioric, oFusion creator and long-time OGRE community member & GSoC mentor, who turned out to be a really nice bloke who was a lot of fun to be around. He doesn’t like to travel much and getting a US Visa from his home in Argentina is stupidly difficult so I was really happy to get the rare opportunity to meet him. I was also very happy to run into Sean Morrison from BRL-CAD and BZFlag again, which I always seem to do whenever I’m in the US!

It might have been nice to have some leisure time in LA, but there really wasn’t any time prior to or during the show, and I literally went straight from the closing of the show in the afternoon to the airport for my overnight flight, because I needed to get back in time for my cousin’s wedding yesterday. Luckily I made it, although a combination of sleep deprivation and jet lag meant I needed precision doses of coffee and Red Bull throughout the day :)

So, I plan to catch up with my email today and perhaps brave the Ogre forums tomorrow, although ‘catching up’ with those is probably impossible - I’ll skim and try to pick out anything important. My focus for the coming week will mostly be OgreSpeedTree and getting Ogre 1.6 even closer to RC status. The Google Summer of Code also finishes this week so I’ll be on hand for that if any organisation assistance is needed.

Sleepless in … LA

Business, OGRE, Travel, Uncategorized 4 Comments

I arrived in LA either Saturday night or Sunday morning depending on whose watch you believe, and am coping with the inevitable jet lag. Working helps to some degree, since it keeps you active, until you hit that ‘wall’ where suddenly your brain holds up it’s hands and says “I don’t care what the clock says, it’s 3am”, before grabbing its hat and coat and sodding off, leaving you a hollow shell looking at a screen full of C++ going ‘buh?’.

I’m staying in Torrance since that’s close to my client’s offices, but we’ll be heading downtown to get registered for Siggraph today I’m sure. I have a fair few things in my diary for the next few days so hopefully I’ll be lucid enough.

If you’re at Siggraph too and want to say hi, drop me an email (sinbad at ogre3d dot org or steve at torusknot dot com), I’ll check my email as often as I can. Alternatively you may find me on the ‘Works Zebra’ stand on the AMD booth (#323) where I’ll probably be from 3:30pm Tuesday, 12:30pm Wednesday and 1pm Thursday. The company will also have a presence on the Vicon booth (#1101) at times although I don’t think I’ll be needed for that. Bear in mind I’m there for my clients while on booth duty though, so if you want to yak about Ogre & unrelated TorusKnot stuff we’ll have to arrange to meet again later on.