Wednesday, February 27, 2013

OLPC Video Editor: Research on ogg file splicing

Had some late night energy after this busy day of work (maybe it was those 2 cups of green tea and tasty California orange?!)... so I spent some time researching what technology I should be using to edit my ogg (theora) video files in the OLPC XO activity I am going to write.

First off, I think I've decided to write my own, new video editing activity for the OLPC instead of modifying the existing "Camera" app. It's very cool, and I had some thoughts about how to integrate my editing code into there... but I think it could cramp the UI and also it might just be easier to have my own codebase for this. Then I can make this application do just one major task: allow kids to view and seek to a start and end point in any of the video clips in their Journal, and then mark those start and end points into some sort of timeline. And from there, run some sort of command-line (or Python-accessible) splicing library that will edit these clips together, and save them out as a new .ogg file.

I've found a couple of possible options. You might wonder why I am not just porting Pitivi (Gnome editor, based on GStreamer) to the OLPC XO laptop. I took a look into it and it's really cool... but it's probably not the best fit for the XO laptop. Yes, it's a great tool and it definitely edits cleanly and like a standard non-linear editing program that anyone has used (eg iMovie, Windows Movie Maker)... but it's not specifically made with 6 year olds in mind. Certainly not with 6 year olds in mind from countries that have never seen iMovie (or even a computer before this). It's also got stuff like an "Import Clips" and "Save Movie" button which is find for a normal operating system with a regular file system, but doesn't really line up well with the XO's "Journal" directory concept. That needs to be well-integrated, or the learning curve will be too steep and I don't think it's going to get as much use as it could get.

Given what my friend Jen said about OLPC's most popular apps, simplicity in UI design is king... and paramount to whether or not your Activity is a success or a failure. If it's too complicated, if there is too much text on screen... then (most) kids will get frustrated and not use it... in my opinion. I want a lot of kids to use my application, so I need to be particularly focused on simplicity in UI design.

All that said about UI design and the necessity to keep it simple, and keep it obvious... I still need to figure out what algorithm/library/API to use to actually decode, splice, and re-encode the ogg (theora) video files. It needs to be fast, not take up too much memory, and ideally I'd like to just give it a list of in and out points (specified by the UI) and the corresponding ogg filename. Those files will then be spliced in order (I will have to allow users to re-order the clips somehow). So focusing on the actual editing part first (since I am gonna have to get that working before I even think about the UI)... I found some useful details.

GStreamer (already available on XOs) has a plugin called Gnonlin (As in G-NonLinear Editor)... YES. This is excellent news, and in fact it's what Pitivi uses under-the-hood. That said, the code looks kinda complicated. In fact all the GStreamer code seems kinda complicated. I am gonna have to read some more, and hopefully there are some useful tutorials online or good documentation of the library and how to interface with it. In any case, this looks super powerful and useful.

Some Gnonlin links:
Some other alternatives that I need to read about more, as they might be simpler if they can do what I want:
Yet another (possibly awesome) alternative is to convert the ogg files to mpeg (I think that's necessary for this) and then splice and concatenate using ffmpeg. Now this looks pretty darn easy from a programmatic side. I don't suspect they have Python access, but I can always just subprocess the conversion from the GTK app and subprocess.Popen() will make the UI wait for the subprocess to finish, which is exactly what I want. I'm not sure if XO machines already include ffmpeg or if I'd have to somehow bundle it along with my activity if I went this route. Or maybe use something like PyFFMpeg.

Thursday, February 21, 2013

OLPC Activity: Hello World

Ahhhh yes.

After some work last night getting my Sugar OS build rolling and some kind and super fast email help from Sugar-Build creator Daniel Narvaez (thanks Daniel!), I managed to get my first "Hello World" activity building tonight. Huzzah!

Creatively entitled, "JutansAwesomeActivity"

As Hello World programs tend to be, it doesn't do much. Though it still is pretty awesome.

Of course, I'll need to translate "What uppp" into Swahili, Spanish, Hindi, and all the other languages used by kids around the world who use the XO laptop ;)

Haha so yes. This first activity is just a "proof" as you might call it, that I can build an XO activity on my virtualized machine, and I can test within the Sugar emulated OS. All is looking good.

I need to try to get my Virtual Machine to use the camera on my computer so I can record videos and then edit them. If that doesn't work, I am just gonna import some .ogg files that I record directly from my XO laptop, and then start fiddling with playback, scrubbing, and ultimately editing (splicing) of those files together... which is my major goal for this project.

It's been fun to get things moving, and now that I'm finally done sorting out all the infrastructure stuff (that always takes much longer than you plan for it), I can get to the actual code writing itself. As always, I'll be posting updates here as I progress.

Mike :)

Wednesday, February 20, 2013

Router update: Shared hard disk, success!

Wow this really is awesome.

After getting the new Linksys router I talked about last week, I connected up a new 2 TB Western Digital Elements Hard Disk to the router.

I was then able to share the hard disk without much hassle, it was pretty straightforward. Added security made it a little harder to work around (darn Windows network settings), but other than that it was smooth sailing.

So I now have a networked hard disk, where I can both read and write from my Windows AND my Mac machines. Awesome. It's plugged into the router, so if my Mac is on and Windows is off, but I want something shared... I can still just copy it over and turn on my Windows machine anytime later to get it.

All of this is amazing... but wait, it gets better. This is also a DLNA Media Server. So my Blu-Ray now recognizes the Hard Disk. This allows me to stream all of my music library from the HD to my TV entertainment center system, and I don't need to have any of the computers on in the house to do it. Sweeeeeeeeeet awesome.

Building OLPC activities within Sugar-build

Whew, been tough to find time lately to spend in the evening on OLPC dev stuff. But had a bit of energy tonight and spent some time on some build stuff.

Tonight I experimented some more with the OLPC Sugar-build setup (as described here: http://sugarlabs.org/~buildbot/docs/build.html). I also finished reading the lengthy-and-very-detailed "Create your own sugar activites" manual. I skimmed some of the code, but in general made it through most of the stuff that will be relevant to the Activity development I am aiming for.

I could tell there were some Activities pre-installed in this sugar-build script (eg terminal, browse, chat, and a few other basics), but I wanted to know how to install new activities from their source code on Sugar's gitorious/github page (http://git.sugarlabs.org/)

This now allows me to do a few necessary things:
1) Check out and edit existing activities (or create my own new one) from Sugar's Github source control (necessary for contributing to OLPC software)

2) Write and modify code

3) Build and test the activities inside of the sugar environment on my desktop

It was a little tough to figure this out so I thought I'd document it here in case anyone else is trying to do this.

First of all, find the git:// address for the OLPC activity you want access to. (on here http://git.sugarlabs.org/). From there, go to your sugar-build directory and edit the following file:
config/modules/activities.json



This config file instructs the sugar-build script which activities to download from the appropriate git:// address, and what to call the directory that you're dropping the git repo into.

Then "pull" from the git repo to get the code:
make pull

make build
make run


And... voila! We run the sugar emulator again and here's the Hello World activity, along with the Camera and some other stuff I added too.

I just tried to edit the files and rebuild them, but it looks like the build system doesn't understand that I've modified the files and they need to be re-built and copied over to the install area. I'm probably doing something wrong. But it's time for bed :) More soon.

Sunday, February 17, 2013

The art of espresso

Yesterday evening I saw this great quote at a pastry shop in the Mission:




Heh. I was recently getting excited at the idea of getting an espresso machine at home. With this on my mind, I just read James Freeman's (founder of Blue Bottle) chapter on espresso making in the new Blue Bottle coffee book I bought.

What a daunting process. It sounds really really reaaalllly hard to get right, minute changes in grinding need to be made when your coffee is of different ages or the room temperature is more or less humid... wow. Becoming even decent requires thousands of pours of practice & a real motivated dedication to the craft. (Sounds like that Frank Lloyd Wright quote above.) :)

I finished the chapter with a huge appreciation for the ferry building blue bottle coffee magicians, and a strong desire to leave it to the pros, for now. Since I get paid to write computer software, I think I'm gonna keep my hours focused on that. And next time I'm at blue bottle, I'm gonna watch the magicians at work a little more closely, and realize my $2 is incredibly well spent, supporting the art of espresso.

- Posted using BlogPress from my iPad

CNET: Holograms of Holocaust survivors let crucial stories live on

Wow, some impressive and time-sensitive work happening at USC. I wonder if Spielberg is involved. Well done, USC.

Holograms of Holocaust survivors let crucial stories live on:

http://news.cnet.com/8301-17938_105-57568301-1/holograms-of-holocaust-survivors-let-crucial-stories-live-on



- Posted using BlogPress from my iPhone

Sunday, February 10, 2013

It's finally time for a new router

My trusty blue Linksys 801.11G router is still going strong about 5 years after I bought it, it requires a power-cycle maybe only a few times per YEAR... it's been a really powerful and stable friend in the home streaming department.

Now that I've got an iPad 4 and iPhone 5 though, I'm definitely behind the times in the standards, since both of those devices support the newer 802.11N standard, and more excitingly on the less-used 5Ghz band which will mean better performance. I find signal strength issues when far away from my current router, and I finally need something heftier.

Something else cool is new routers can automatically prioritize video streaming using something called QoS, and that's what I use my router for most of the time anyway.

I'm also now running a PC and a Mac desktop at home on the same network, but haven't really solved the shared network drive situation. What I really need to do is buy a 2TB drive and connect it up to a NAS, but I don't really stream that much from a hard disk (I usually use Netflix). That said, it would be nicer to have my music accessible on both my Mac and PC, and also shared via DLNA to my TV for streaming through my entertainment system... it's a bit silly that I haven't already set that up. All these potential use cases point to the need to have a USB port shared on my router itself, and to hook up an external HD to it.

I've been reading a bunch of reviews and there are not many routers out now which support USB 3.0, which is too bad. There is a DLink one which does, but the speed rates of data transfer are not high enough to warrant buying it over the routers which only support USB 2 - in fact it's slower! So that says to me that USB 3.0 Hard Disk sharing via Router is not "ready" yet, and it's not something I should be looking for if I am buying right now.

In terms of those leading edge features though, it seems that 802.11a/c (the new post-"N" standard, 3x faster than N routers) does seem to be reasonably well supported by the new Asus RT-AC66U router. While that's definitely in the future-proofing camp, it might be reasonable to get it since (eventually) I'll have 802.11a/c devices (presumably) and will want to benefit from it. And given that I haven't replaced my current G router for the last, say 6 years, it appears I don't upgrade routers very often. So maybe it's good to future proof.

That said, there are a lot of excellent reviews of the previous model of the Asus router, the Asus RT-N66U "Dark Knight", and yes, it also has a kick-ass name. It seems a bit silly to pay only $30 less for an "N" router now and then kick myself in 3 years when I (presumably) need a/c support. And I guess $30 now vs another $150 in 3 years to buy the latest and greatest makes sense. Ok, I think I've convinced myself :) There are some great features on the Netgear R6300 as well.

Here's what's currently going through my mind that I just sent out to some friends on Facebook.

Anyone know if 802.11a/c is set to be the next "big" standard? If I'm buying right now should I get an N900 router or pay a little more for an A/C router and future-proof? By the time a/c devices are out, will there be a post-a/c standard that will more likely be the "winner" or is that THE only upcoming standard?

I, like everyone else, don't have any A/C clients yet... but I upgrade routers like once every 6 years, so maybe it's wise to just future-proof now.

My main requirements are to:
1) stream Netflix
2) share files on a network connected HD between Mac and Windows desktops
3) DLNA-stream music files from that HD to my TV entertainment center
4) not have to buy another router in 2 years from now
5) Use 5Ghz/802.11N now on my iPad 4 and iPhone 5
6) Have that shared HD be running on USB 3.0 (but that seems like not too many support this yet, still USB 2 only).


It's looking like either this Asus (http://reviews.cnet.com/routers/asus-rt-ac66u-802/4505-3319_7-35406080.html) or this Netgear (http://reviews.cnet.com/routers/netgear-r6300-wifi-router/4505-3319_7-35315201.html) are the best choices. 

So, not sure exactly what I'm gonna get, but one of those 2 looks good, or alternatively the Asus RT-N66U (http://reviews.cnet.com/routers/asus-rt-n66u-dark/4505-3319_7-35110985.html)

[EDIT: After researching some more and thinking about this, #4 in the list above is not correct. I should probably instead be buying something that's not TOP of the line, but rather was top of the line about a year or year and a half ago. I am gonna start looking at the editor's choices for N300 routers since that's well beyond my current level of accessible bandwidth anyway - I only get 20 Mb/s from Comcast anyway!! What's the point of paying way more for bandwidth I'll never use. Rather, I'll get a router that can do a great job and will move me into 802.11N-land, as well as offering a reasonable networked HD setup. This'll be much better than what I've got now which is G, and in 3 years or whenever all my devices are 802.11a/c or whatever is the new hotness by then, I'll upgrade again at that point... buying whatever wins the top of the line for the next-gen standard now, but at that point. Needless to say I should probably be upgrading my router more often than every 6 years.]

[EDIT #2: I am seeing way too many reviews saying that the Asus needs to be power-cycled too often and that sounds like a huge pain in the butt. Also, starting to think N600 or roundabouts should be more than enough. But definitely have to get the shared Hard Drive and DLNA if I'm upgrading. Linksys E4200 or E4200 V2 are looking promising.]


Linksys/Cisco EA4500

[EDIT #3 and summary: I've managed to get a really good price on the newer Linksys/Cisco EA4500, just the updated version of the EA4200 v2. It's very similar, just with their new cloud-based firmware which I'm neither here nor there about. The features seem great. I got confused for a bit cause it looks like my "NAS" usb-attached drive will likely need to be formatted in NTFS, which I thought would mean I couldn't access it from my Mac Mini - but after some googling it looks like you can always access NTFS drives via samba on Mac (duh) and read/write that way. That'll be fine for my purposes of sharing music/photos between my 2 machines etc.]

Friday, February 08, 2013

Mailbox

Hmm... email management just got interesting... :) This could be really useful.


Tuesday, February 05, 2013

OLPC: Children in Peru write their own history on Wikipedia

When I was in the Peruvian Amazon last May, I had heard there were some One Laptop Per Child laptop deployments somewhere near that area... it is CRAZY to see this. This must be in a school with reasonable communication ability and consistent power sources to be able to be connected to Wikipedia (online, not the standard offline version)... so freakin' epic. This is the kind of stuff that really makes you proud of what humanity can do...


Sunday, February 03, 2013

A quick state of the Jutan-union

Hi all!

When my bro Finkel (aka "Alex") finally convinced me to join Twitter I didn't think it would affect my blogging, but I suppose it has to some extent. The lighter fare blogs (eg: reposting videos or interesting articles, etc) have definitely migrated to the Twitterverse (I think that's what the kids call it these days). So feel free to Follow me there if your internet stalking has been affected (my apologies, if that is the case).

I just realized I posted a grand total of 3 times in January 2013 which is pretty meager/crazy given my history for unleashing way too many details of my adventures via this blog. Don't worry; many adventures are still happening, I'm just posting less often these days I suppose. I think maybe I overposted with my 6 month blog extravagannza that was the South America trip, so I guess this was an unplanned pause on blogging. I'm also thinking about how to better reach people with this blog, and I suspect posts will be more targeted in the future and less in the "this-is-what-I-ate-for-dinner-today" vibe, though if I eat something really good for dinner, you'll hear about it one way or another, no doubt.

What else can I report. Things are busy and exciting at work and I will be submitting a talk for the Siggraph graphics conference this year, which I am incredibly psyched about. I really hope it gets in, and if so, I will be so psyched to present it. On that note, I noticed my resume was getting a little old, so just updated it.

Side-projects:
I'm taking a little pause on this as well (after releasing Gym Ninja at the end of December). I creeped back up a little on the weight loss goals over the Dec holidays which I am not happy about, it's not terrible, but I need to turn the heat way back up. The last month or so I've been trying a few new things like a couple different kinds of Yoga and a (crazy) high-intensity training workout. That's all going well, but I need to push harder on that stuff so I've been spending less evenings on the computer lately.

Volunteering:
I've been meeting with OLPC-SF every month and still very inspired by their efforts, there is some really awesome stuff going on there. I've got my XO 1.75 laptop, as well as a virtualized Sugar OS and Fedora 18 OS (with a Sugar build in it) all set up. I'm currently making my way through the massive "Make your own sugar activities" manual (250 pages of awesome) and learning all the details so I can hit the ground running with the volunteer software development I will be doing for them soon.

Travel:
Nothing too crazy on this front this year. I am gonna head to Texas in the summer which is going to be just about as much of a culture shock as South America was, I expect. :) Should be super awesome though.

I hope you are all well and 2013 is off to a glorious start for everyone!