Archive

Posts Tagged ‘Tiny Ears’

Playing movies with an alpha channel on the iPad

May 16th, 2012 21 comments

We hit a snag the other day with the development of Tiny Ears. Our strategy to save space on the animation in each storybook was to create lightweight movies to play at the appropriate moment, rather than to have to implement large quantities of frame animation with all of the assets involved (including now retina support with the new iPad). To save further space we decided that we would like to animate only those things that moved by creating a video animation with an alpha channel to make the background visible through the video.

Problem was, when it came to implementing this strategy on the device itself, the transparent .mov file renders with a black background. Why? AVPlayer and MPMoviePlayer  do not have alpha channel support. Desperate not to have to change our strategy and recreate our animations complete with background or return to frame animation I spent some time researching a possible solution on the Internet. After 1 day of looking the best I had come up with was a solution suggesting we use OpenGL to sample the video as it played and turn certain colours transparent I was ready to give it up for lost.

Then, at last, I came across AVAnimator. Hidden in the depths of Google lay this single page site detailing this wonderful library that seems to do pretty much everything that you would want to do with movies in iOS but can’t. There is little documentation and that single page is the only information that exists, but it was enough. Here was a native movie player for iOS with alpha channel support (and a lot more besides but we won’t go into that now).

The code itself was really simple to implement, but in order to play the movies you have to do a little bit of transformation first to turn them into the .mvid format that AVAnimator requires. The tools you need are qtexportani and QTFileParser.

Unpack qtexportani. Open a terminal in that location and type the following:

./qtexportani <name>.mov

This will create you a file in the same directory called export_<name>.mov.

Now unzip QTFile112.zip. Go into QTFileParser and open the XCode project. Build & archive the app and select Distribute. Select Save Built Products and choose somewhere to save it. Then, with the terminal in the same location as the app you just built, run the following command:

./qtaniframes -mvid export_<name>.mov

This will save you a file called export_<name>.mvid.

At this point, don’t be afraid of the fact that your new .mvid file is substantially larger than the original .mov. We’re gonna 7Zip it to make it nice and small. The nice thing about AVAnimator is that you can 7Zip all of your .mvid media into one archive and use that in your app, making all of your media have a delightfully small footprint. I’m not gonna tell you how to 7Zip your files – you’re geeks you should be able to handle that on your own. But at the end of it you should have something like <name>.7z that contains all of your mvid media.

Now comes the fun bit. From the AVAnimator site I could not find just the source file download, but you can grab it by downloading any of the links from their website. I grabbed StreetFighter cos that was the example app that did exactly what I wanted.

So, in your xcodeproj, import all of the files in the AVAnimator folder that you will find in your downloaded project. You will also need to import all the files inside the folder called LZMASDK. In the UIViewController where you want to play your animation then add the following code:
// create the animator view

AVAnimatorView *animationView = [AVAnimatorView aVAnimatorViewWithFrame:CGRectMake(0,0,1024,768)];

// create a new object to store your media in

AVAnimatorMedia *media = [AVAnimatorMedia aVAnimatorMedia];

// Create a 7Zip resource loader

AV7zAppResourceLoader *resLoader = [AV7zAppResourceLoader aV7zAppResourceLoader];

// tell the resource loader what the name of your 7Zip archive is, and the name of the media file inside it you want to play

resLoader.archiveFilename = @”media.7z”;

resLoader.movieFilename = @”export_video.mvid”;

resLoader.outPath = [AVFileUtil getTmpDirPath:animationFilename];

// tell the media holder which resource loader to use

media.resourceLoader = resLoader;

// Create decoder that will generate frames from Quicktime Animation encoded data

AVMvidFrameDecoder *frameDecoder = [AVMvidFrameDecoder aVMvidFrameDecoder];

media.frameDecoder = frameDecoder;

media.animatorFrameDuration = AVAnimator30FPS;      // this is a constant I made for the frame rate

[media prepareToAnimate];

// request to be notified when the movie is played

[[NSNotificationCenter defaultCenter] addObserver:self

selector:@selector(animatorDoneNotification:)

name:AVAnimatorDoneNotification

object:media];

// you have to add the AVAnimatorView to the superview before you can attach the AVAnimatorMedia

[self.view addSubview:animationView];

[animationView attachMedia:media];

// play the movie

[media startAnimator];
And that’s it. Everything to you need to play a movie animation while preserving the alpha channel creating a transparent animation. In a few short lines of code. Thank you AVAnimator, you wonderful thing you. It’s astounding that more people don’t know you exist.

Next Startup Chile Applications Start March 19th 2012

February 9th, 2012 No comments

The next application round for Startup Chile starts on 19th March 2012 and closes April 3rd. Coincidentally I will be back in the UK to attend NSConference, have some meetings with Tiny Ears collaborators Persistent Peril, Mind Orchard and Edable and to attend the wedding of my good friends Dan and Rachel.

I will be free between 22nd and 29th of March. If  anyone reading is in the UK and thinking of applying to Startup Chile and would like to meet and chat during this time about their application, or just to ask some questions about what it’s like out here in Chile, please do email me. I will be based in Mortimer near Reading during NSConference from 19th-21st and could meet in the evenings, otherwise I will be in the Brighton area and would be happy to commute to London or anywhere within easy train ride of Brighton to meet.

Also, if anyone during this time would like me to do a presentation or talk on Startup Chile, and/or Tiny Ears, please also get in touch.

 

Being a Sole Founder is hard

February 6th, 2012 2 comments

Before we arrived in Chile, and in the first few days after getting here, we were told by previous round entrepreneurs not to expect to get much done in our first month here. But there is a plan, I thought. I know exactly what I need to do. Of course I’m going to get loads done in the first month.

Wrong.

There are a number of factors for this. First is the highly stressful situation you live under for the week or two before you leave home to come here. Those two weeks were total write-offs for me, although Ian and Kyran managed to get a lot done. For them it was easier I think as they had a deadline at the end of January that they had to meet, therefore no matter how crazy, busy and stressful it got, they had to work. For me, however, there were no deadlines set so soon after arrival and so I became consumed by the process of visa obtaining, flat rental, car selling, packing and moving out of our flat. That’s OK I thought. There will be lots of stress-free time after we arrive for me to get on with some work.

Wrong

The first 5 days were simply spent reacclimatising, getting over the stress of the previous 2 weeks and getting our bearings in Santiago. The next week was a whirlwind of induction activities and social & networking opportunities. The week after there were a number of activities to get involved in and I spent a lot of time trying to get over my feeling of helplessness by teaching myself Spanish. Last week, was picking up Chilean ID’s, arranging meetings and RVA activities (I co-organised my first Girls in Tech Chile last week), networking, opening bank accounts and trying to get hold of a Chilean mobile data plan.

And before I knew it, 1 month is coming up. We will have been here for 4 weeks in 2 days time and that thought frightens me. Our time here suddenly feels perilously short and there is such a lot to do. To say that I have been wasting my time here would be wrong. I have been dealing with Universidad de Chile sorting out our Speech Recognition systems. I’ve been trying to get hold of the right person in CORFO to talk to about grant applications for the university. I’ve been coordinating my disparate team of fellow Tiny Ears collaborators and coming up with a plan of action from here. I’ve been reading an enormous tome dedicated to speech processing and a number of associated research papers. I have been reading and teaching myself the iPad game development & animation skills that I will need to develop the project. But in comparison with the productivity that I would have achieved had I not been here it’s not enough.

That is not to say that being here is worse than being back home. Not a chance. It just takes time to get used to being here, to fit yourself into a new routine and a new way of life. Those that I have seen making this transition well have been those with teams larger than one. They are able to help focus one another and they seemed to have created their new routines much quicker. Us sole founders with no local team members seem to be finding it a lot harder not to be cast adrift on the change of environment and the wealth of new opportunities.

I am now starting to gather a routine together. I wake in the morning, go for a run, have breakfast and then either set up work at home or make my way into town to CMI for the day. I am starting work at around 11am daily. The morning is spent catching up on correspondence and doing admin. Lunch is around 2pm. The afternoon is spent either programming, learning, reading or designing depending on needs. Come 6pm I stop do my hours Spanish learning then I pick it back up and work through until around 8 or 9. Dinner is between 9 & 10 normally and then I try and relax for the rest of the evening.

This routine is easily disrupted however. When at CMI there are people and meetings and chats to get involved in. There are events in the evening that start between 7 & 8, and the city is so large that it can take over an hour to get somewhere. I am having to learn to be far stricter with myself during the working day than I used to be. However, the meetings chats and people are often of incredible value. Tiny Ears is being presented as an example of a disruptive education technology this Thursday at an event down in Concepción. Sadly this is a little too far to go just for an evening, but it good that we’re getting some coverage already. Tomorrow I am being interviewed by the BBC (as are a number of other high tech and AI based startups) and I have made friends with some very well connected people who are eager to help however they can.

This afternoon is the first meeting of a new group of entrepreneurs who are meeting to discuss the particular problems around being a sole founder. I am hoping that from within this group I will find support, tips and advice about how to deal with the loneliness and lack of support that you get as a sole founder. If you have any advice about being a sole founder then I will gratefully receive it. I will keep you posted on how it goes.

Tiny Ears Update

January 25th, 2012 No comments

Well, the first week of Tiny Ears here in Chile has gone pretty well. We’ve had a meeting with Professor Nestor Becerra-Yoma and his team at the Speech Processing and Transmission Laboratory at Universidad de Chile and their software seems to meet our needs well and we are now trying to come up with a deal whereby we can use their software whilst trying to find funding to allow them to enhance it with all of the extra bits that Tiny Ears requires.

There will, no doubt, be a post to come whereby I detail all the fun and games to be had trying to find funding here in Chile, but I think what is there presently will be enough to provide a good enough prototype with which to secure funding. Yet again I am wishing that  I was able to find a co-founder to help me with these business matters as I would far rather just concentrate on building the product and leave these other consideration to someone else, but I guess that’s what a startup entrepreneur is, someone willing to dirty their hands with all the jobs that need doing.

On that basis, and with that weight lifted from my mind, I am ready to start working on the storybook itself. I will be getting in touch with the various loosely organised Tiny Ears members who have agreed to work on the project and try and get everyone together on a Skype call to discuss what needs to be done. Now that the Speech Recognition part is at least partially resolved then all the different members of the team who I had been putting off getting overly involved due to the uncertainty of the outcome of the meeting with the Universidad de Chile. I really feel that Tiny Ears can start to move forward with purpose now.

Startup Chile Ahoy

January 9th, 2012 1 comment

Well, Startup Chile is about to start. We leave on Tuesday 10th January to join the second intake of the second round. While we were trying to decide whether or not to apply we tried to find information about the program and what it was like to be a part of it. At the time, back in August, there was not much about apart from comments about the successful drinking that was being done by the participants. Since then, there have been a number of well publicised successes from the program and international news coverage, but little that I have found from a more on-the-ground perspective. I have therefore decided to blog as much as I can about the program, what it’s like to be a part of it, how useful it is to us and what we have to to during our time in Chile.

To start with, a few weeks ago I was contacted by my madrina, Johanna Angulo, a Chilean entrepreneur interested in my project whose role is to introduce me to the Chilean business scene, smooth the initial Startup Chile introduction process and generally look after me during my time there. Each business involved with the program is assigned a madrina or padrino (godmother or godfather) which seems to be a really nice way to help new arrivals get orientated.

Johanna has been really nice and helpful during our email conversations, including pointing out useful resources to learn the local Spanish dialect, Chilano, and offering to take us on a tour of Santiago when we arrive. Our situation is a little odd in that Ian and I are a couple, and yet we are there with two separate projects and therefore have separate godparents. Johanna and Strong Steams padrino, Fernando Mejia, seem to have teamed up though which is really useful.

Kyran, Ian’s business partner in Strong Steam has been arranging the accommodation for us in Santiago and has arranged for the agents through which we are renting our flats to pick us up from the airport and take us and our baggage to the flats. Johanna has offered to meet us at the airport also and to take us out for a late lunch after we’ve sorted ourselves out with our flats.

Once we’ve arrived, we’ll need to sort out our Chilean ID. Apparently we need this for a lot of things, not least to leave the country at the end of the program. The process seems fairly simple but I’ll keep you posted on that front. Otherwise, there will be some sort of induction occurring on the 16th January and an internal demo day where we have to pitch our projects. Not really sure what that will entail but it’s quite possible that my pitch from Startup Weekend will do the job nicely.

For now, it’s back to packing up the flat, packing for the flight and getting the last few bits and pieces together – including a rather large shopping list from Jon & Anna Markwell of all the things that they’ve missed from the UK since they’ve been away. The next update will probably be after we’ve arrived. How exciting.

Tiny Ears Team Update

January 9th, 2012 No comments

I know I’ve been very quiet on the Tiny Ears front recently, but it’s been rather hectic with the move recently. However, that does not mean that I’ve been idle. I’ve been networking like crazy, meeting many interesting people and building up a team of people around me to help make Tiny Ears the most awesome project ever. As such I would like to welcome the first of my new collaborators, Persistent Peril.

Ginny and Garth are fantastic, BAFTA award winning animators whose characterisations and style I love, and I believe kids will love their creations too. Their enthusiasm is amazing and I have no doubt that they will help me to create a beautiful and fun app. I am really pleased to be working with them.