tag:blogger.com,1999:blog-124010452026-06-27T23:50:27.697-07:00Mike Jutan's World3D computer animation, travel, film, photography, technology, health, life, inspiration... and a few extra helpings of enthusiasm. ;)Mike Jutanhttp://www.blogger.com/profile/13692386796675585659noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-12401045.post-25330875436976396302013-10-13T03:43:00.001-07:002013-10-13T03:43:45.773-07:00New OLPC page on mikejutan.comAs the OLPC-SF Summit gets closer, I wanted to make a webpage that talks about what I'm working on now and links back to the OLPC and XOFilmmaker posts on my blog.<br /> <br />Check it out here!<br /> <a href="http://olpc.mikejutan.com/">http://olpc.mikejutan.com</a><br /> <br /> Good times :)Mike Jutanhttp://www.blogger.com/profile/13692386796675585659noreply@blogger.com0tag:blogger.com,1999:blog-12401045.post-30830846327684237282013-10-13T02:54:00.001-07:002013-10-13T02:54:16.226-07:00XOFilmmaker: Poster for the OLPC-SF SummitLife has been busy lately and I haven't had a ton of time to devote to coding for my XOFilmmaker app for OLPC, but I did make some progress after getting back from Canada a few weeks ago, so that was pretty sweet.<div> <br /></div> <div> Next week is the OLPC-SF Summit, and so I've made a poster submission for the conference to drum up some interest in my project from my fellow attendees, and also to ask around for some technical help. It'll be nice to talk to a bunch of smart people who will be able to offer some great advice, and also I hope some folks from lots of different countries around the world where I might be able to send this software to once it's complete :)</div> <div> <br /></div> <div class="separator" style="clear: both; text-align: center;"> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwcjJA31wdy59zYMXHNrjTq_ZHe0R8WFyQhoxzyEE6-jZGo0EDDbEHWu_pGSrboGMh8KoEcg-_t9E7rQStLr1GsZ9lS-xIYDkIqaBvOWE1zaErqb5HIBi39Fb1DtJBFYyfOpVP8w/s1600/olpc_poster_mjutan.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwcjJA31wdy59zYMXHNrjTq_ZHe0R8WFyQhoxzyEE6-jZGo0EDDbEHWu_pGSrboGMh8KoEcg-_t9E7rQStLr1GsZ9lS-xIYDkIqaBvOWE1zaErqb5HIBi39Fb1DtJBFYyfOpVP8w/s640/olpc_poster_mjutan.jpg" width="640" /></a></div> <div> <br /></div> Mike Jutanhttp://www.blogger.com/profile/13692386796675585659noreply@blogger.com0tag:blogger.com,1999:blog-12401045.post-66300228243812307352013-09-16T00:29:00.001-07:002013-09-16T00:35:07.890-07:00XOFilmmaker: Audio re-saving via PythonWahoo for progress!<br /> <br /> Tonight I just spent about an hour and a half (a short session tonight!) aiming to solve one specific problem for XOFilmmaker. Good news: problem solved!<br /> <br /> I had taken my iPad back home to Canada a couple weeks back and read a bunch of the code for the existing OLPC Activities "Record" and "Jukebox", both of which use GStreamer a lot. This is the same library which I am employing for this XOFilmmaker activity.<br /> <br /> Anyhow, as you might expect from previous blogposts, I've been running into a stack of problems with GStreamer and the learning curve is pretty steep, and the documentation hasn't been the most glorious. So I found some nice examples inside of these two existing activities. In Record specifically, I found a pretty fabulous function called "gst.parse_launch()" which appeared to let you just run a gstreamer command-line option directly in Python and it would "run the pipeline" for you... a GREAT way to splice together my final edits in the XOFilmmaker Activity, I reckon!<br /> <br /> <u>So my goal tonight was to see if I could get this to work... and the answer is... YES!!!!!!!!!</u><br /> <br /> <br /> I started with the line I knew I had working last time:<br /> <blockquote class="tr_bq"> gst-launch filesrc location=$PWD/high_1.ogg ! oggdemux name="demuxer" \<br /> demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink \<br /> demuxer. ! queue ! theoradec ! ffmpegcolorspace ! autovideosink</blockquote> This line successfully opened an ogg video file (created with the Video Camera on the XO Laptop), demuxed the audio and video, and then sent them out to an "audiosink" and "videosink" -- basically, playing the video file (with audio attached) to the screen.<br /> <br /> On first attempt, it didn't work. It seemed like nothing was happening.<br /> <br /> So I simplified it, reducing the line so that it worked on the command-line first, and it just outputted audio:<br /> <blockquote class="tr_bq"> gst-launch filesrc location=$PWD/high_1.ogg ! oggdemux name="demuxer" \<br /> demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink</blockquote> Trying this again in Python, I still got nothing. Weird. So I tried a command-line save-to-disk operation... essentially unpacking the audio from the audio/video ogg file, and then saving the audio track only back to a new file. This was a success on the command-line:<br /> <blockquote class="tr_bq"> # Audio demux, then mux again and save as a new file<br /> gst-launch filesrc location=$PWD/high_1.ogg ! oggdemux name="demuxer" \<br /> demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! vorbisenc ! oggmux ! filesink location=$PWD/audioOut1.ogg</blockquote> This gave me an audio file on disk that I could run. <br /> <br /> &gt; ogg123 audioOut1.ogg<br /> And it worked!<br /> <br /> <br /> Now, to convert to Python. At first I still got nothing from the pipeline and there was a file being created on disk, but it was 0 bytes. After some googling, it looked like I needed to launch the gobject MainLoop -- otherwise I wouldn't get any code launched. Duh (I guess?!) So after some digging and experimenting, I got this to work!!!!!!!<br /> <br /> =====================================================<br /> #!/usr/bin/python<br /> import gobject; gobject.threads_init()<br /> import pygst; pygst.require("0.10")<br /> import gst <br /> <br /> class Main:<br /> &nbsp;&nbsp;&nbsp; def __init__(self):<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Express this gst-launch code in a Python call<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst-launch filesrc location=$PWD/high_1.ogg ! oggdemux name="demuxer" \<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink \<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; demuxer. ! queue ! theoradec ! ffmpegcolorspace ! autovideosink<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2nd try, audio only with re-convert<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst-launch filesrc location=$PWD/high_1.ogg ! oggdemux name="demuxer" \<br /> &nbsp; demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! vorbisenc ! oggmux ! filesink location=$PWD/audioOut1.ogg<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '''&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mainLoop = gobject.MainLoop(is_running=True)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; filePath = "/home/mjutan/Downloads"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; muxline = gst.parse_launch('filesrc location=' + filePath + '/high_1.ogg' + ' ! oggdemux name=demuxer demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! vorbisenc ! oggmux ! filesink location=' + filePath + '/pythonAudioOut2.ogg')&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; muxline.set_state(gst.STATE_PLAYING)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while mainLoop.is_running():<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try:<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mainLoop.run()<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; except KeyboardInterrupt:<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mainLoop.quit()<br /> <br /> start=Main()<br /> =====================================================<br /> <br /> <br /> <u>And here is my audio file, finally a non-zero size!</u><br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiUzX_9x_ZWyTGq15Hu2-GHeF4-lzRIl-vFZImTDCZm5mH6hxn_-IcPZlMNR0iR2VINB8spv6gNPkpw37wzWbGhgGemvzwX0r-lXp0hX7412N0Ay3GbkFxshmF47ek9yNXovRBmA/s1600/olpc1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiUzX_9x_ZWyTGq15Hu2-GHeF4-lzRIl-vFZImTDCZm5mH6hxn_-IcPZlMNR0iR2VINB8spv6gNPkpw37wzWbGhgGemvzwX0r-lXp0hX7412N0Ay3GbkFxshmF47ek9yNXovRBmA/s1600/olpc1.jpg" height="448" width="640" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">pythonAudioOut2.ogg, suckas!!!!!!!!!!!!</td></tr> </tbody></table> <br /> <u>So why is this awesome?</u><br /> <br /> The GREAT news here is that now I can work on the command-line to try to figure out how to splice Audio and Video correctly using GNonLin/GStreamer. This gst.parse_launch command removes the extra overhead of trying to set up a pipeline and catch pads and do all this other crazy crap. I just want to open up the input files, splice them together with the timings specified by the user, and output a single file all cut together correctly. It's probable that I can just programatically create a big long gst parse line which will generate a "Pipeline" for me. Then, I just run the pipeline and BOOM, the completed, edited video is written to disk. (Aside: I tried the original audio and video playback line again after I had this final version of the code with the MainLoop run() method, and that worked too, and played back my video and audio together on the screen. Awesome.)<br /> <br /> <u>How does this move me closer to getting video editing?</u><br /> <br /> Good question. Well, it means I can now focus on getting the syntax for gst-launch correct on the command line, and try to just splice 2 videos together. If I can get this to work, then I've already solved doing the same thing from Python -- I just need to copy-paste the line into this parse_launch() command and I'm all set.<br /> <br /> <u>What's next?</u><br /> <br /> My goal for the next OLPC session will be to try to get GStreamer on the command-line splicing 2 videos together successfully using different in and out points. If I can get that to work, then the large majority of the "unknown" section of this project will be COMPLETE!!! AHHHH man I can't wait.<br /> <br /> From there, then I need to build a nice simple UI that kids in developing nations with next-to-no instruction about how to use this software will need to be able to understand. There will ideally be no words on the app. For this app to be a real success on the XO Laptop, my feeling is that it needs to be extremely intuitive and simple to use. Once I've got this particularly troublesome part of actually cutting videos and audio splicing together finally sorted out, then I can move onto the exciting parts of starting to build the UI and getting a playback widget figured out so kids can set the "in" and "out" points of each clip they want to use.<br /> <br /> After that, I'll need to actually integrate it with the XO look-and-feel and with the files in the XO Journal. But that's for a later date. First I'll need to get the standalone GStreamer app working well. It's awesome to see this finally moving along though. I'm really happy with tonight's progress.Mike Jutanhttp://www.blogger.com/profile/13692386796675585659noreply@blogger.com0tag:blogger.com,1999:blog-12401045.post-71641645660888574372013-08-26T02:48:00.001-07:002013-08-26T02:56:50.202-07:00XOFilmmaker: To Mux or To DemuxWhew!<br /> <br /> Tonight I had some open time and managed to get back to my XOFilmmaker development work, which rocks.<br /> <br /> <u>Inspiration from Peru</u><br /> I recently joined OLPC's laptop.org support mailing list and it's been super interesting to see the chatter on there. I had a conversation with a teacher out in Peru, working with kids on the XO laptops. They said they are very excited to try XOFilmmaker when it is done, and they really look forward to making movies with it!! Wow. They said they will "definitely use it" and are excited. Talk about the motivation I need to get back into the fray and bend the (increasingly complex) GStreamer library to my will! For the good of the kids, I *will* solve this!!!!!!!!<br /> <br /> <u>What were my goals tonight?</u> <br /> My goal for tonight was to jump back in whole-heartedly. I haven't had time for the past 2 months to work on this given my travel in Texas and SIGGRAPH conference talk, so I wanted to pick things up from where I left them back in June.<br /> <br /> In June I had written some code which took in an Ogg video file filmed with an XO Laptop's webcam and then successfully spliced a portion of video A with a portion of video B, and then played that video back. Pretty good start. But, there is no audio attached, and I'm not sure why.<br /> <br /> I have 2 goals which I was hoping to chip away at tonight, and I managed to make some progress.<br /> <ol> <li>Figure out how to get it to play back sync'd audio along with the video. </li> <li>Write the file to disk, instead of play it back on screen. </li> </ol> <u>So, how did it go tonight?</u><br /> At first, slooooooooooowly. I ran into a lot of problems and some roads that looked promising but led nowhere.<br /> <br /> I spent a bunch of time digging into GStreamer and GNonLin more, but kept running into more walls.<br /> <br /> I started with the attempt to write to disk... it didn't work at first attempt, though I did get a 0-length file written to disk. So, not exactly sure how to do this, but I probably need to remove the streamer from the playback UI and just run a command which does not sync to the UI. I suspect I need a "filesink" for this, not the playback&nbsp; "autovideosink". Anyway, I decided to leave this for another time and jump into figuring out the missing audio.<br /> <br /> With every night like this, I end up pushing through the frustration of not getting anywhere and banging my head against the GStreamer API, making a few silly mistakes, and then eventually learning something and making some minor progress. Just need to keep at it and make sure I make time for lots of these evenings before the end of the year... then, just maybe, I'll be able to get this open source software out the door and into the hands of kids in Peru!<br /> <br /> Let's look at where I started:<br /> <br /> ======================================================= <br /> #!/usr/bin/python<br /> import pygst<br /> pygst.require("0.10")<br /> import gst<br /> import pygtk<br /> import gtk<br /> import gtk.glade<br /> <br /> class Main:<br /> &nbsp;&nbsp;&nbsp; def __init__(self):<br /> <br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # set up the glade file<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.wTree = gtk.glade.XML("gnonlin.glade", "mainwindow")<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; signals = {<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "on_play_clicked" : self.OnPlay,<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "on_stop_clicked" : self.OnStop,<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "on_quit_clicked" : self.OnQuit,<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br /> <br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.wTree.signal_autoconnect(signals)<br /> <br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # creating the pipeline<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.pipeline = gst.Pipeline("mypipeline")<br /> <br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # creating a gnlcomposition<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.comp = gst.element_factory_make("gnlcomposition", "mycomposition")<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.pipeline.add(self.comp)<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.comp.connect("pad-added", self.OnPad)<br /> <br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # create an audioconvert<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.compconvert = gst.element_factory_make("audioconvert", "compconvert")<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.pipeline.add(self.compconvert)<br /> <br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # create an alsasink<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.sink = gst.element_factory_make("alsasink", "alsasink")<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.pipeline.add(self.sink)<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.compconvert.link(self.sink)<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # create a gnlfilesource<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.audio1 = gst.element_factory_make("gnlfilesource", "audio1")<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.comp.add(self.audio1)<br /> <br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # set the gnlfilesource properties<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.audio1.set_property("location", "/home/mjutan/high_1.ogg")<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.audio1.set_property("start", 0 * gst.SECOND)<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.audio1.set_property("duration", 5 * gst.SECOND)<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.audio1.set_property("media-start", 0 * gst.SECOND)<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.audio1.set_property("media-duration", 5 * gst.SECOND)<br /> <br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; caps = gst.Caps("audio/x-raw-float")<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.filter = gst.element_factory_make("capsfilter", "filter")<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.filter.set_property("caps", caps)<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.pipeline.add(self.filter)<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # show the window<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.window = self.wTree.get_widget("mainwindow")<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.window.show_all()<br /> <br /> &nbsp;&nbsp;&nbsp; def OnPad(self, comp, pad):<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "pad added!"<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; convpad = self.compconvert.get_compatible_pad(pad, pad.get_caps())<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pad.link(convpad)<br /> <br /> &nbsp;&nbsp;&nbsp; def OnPlay(self, widget):<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "play"<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.pipeline.set_state(gst.STATE_PLAYING)<br /> <br /> &nbsp;&nbsp;&nbsp; def OnStop(self, widget):<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "stop"<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.pipeline.set_state(gst.STATE_NULL)<br /> <br /> &nbsp;&nbsp;&nbsp; def OnQuit(self, widget):<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print "quitting"<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; gtk.main_quit()<br /> <br /> start=Main()<br /> gtk.main()<br /> <br /> =======================================================<br /> <br /> I spent an impressive amount of time stuck on a Python error. Whoops.<br /> <br /> I was trying to force the "type" (or "caps") of the format to be audio/x-raw-int, trying to get the audio layer of the Ogg file extracted and get that to play back.<br /> <br /> I should explain: Ogg is just a container. And it contains 2 pieces in my case, a "Vorbis" audio stream, and a "Theora" video stream. I've already successfully extracted the Theora video stream and can splice that together, so that rocks. But I gotta figure out what the deal is with the audio.<br /> <br /> As you can see here, the file I recorded with the XO webcam is a combo Ogg file which contains Theora and Vorbis together.<br /> <br /> =================================================<br /> &nbsp;[mjutan@localhost Downloads]$ ogginfo high_1.ogg<br /> Processing file "high_1.ogg"...<br /> <br /> New logical stream (#1, serial: 4428c820): type theora<br /> New logical stream (#2, serial: 35df27fa): type vorbis<br /> Vorbis headers parsed for stream 2, information follows...<br /> Version: 0<br /> Vendor: Xiph.Org libVorbis I 20120203 (Omnipresent)<br /> Channels: 1<br /> Rate: 16000<br /> <br /> Nominal bitrate: 48.000000 kb/s<br /> Upper bitrate not set<br /> Lower bitrate not set<br /> User comments section follows...<br /> &nbsp;&nbsp;&nbsp; ARTIST=Mike Jutan - San Francisco<br /> &nbsp;&nbsp;&nbsp; COMMENT=olpc<br /> &nbsp;&nbsp;&nbsp; ALBUM=olpc<br /> &nbsp;&nbsp;&nbsp; TITLE=Video by Mike Jutan - San Francisco<br /> Theora headers parsed for stream 1, information follows...<br /> Version: 3.2.1<br /> Vendor: Xiph.Org libtheora 1.1 20090822 (Thusnelda)<br /> Width: 400<br /> Height: 300<br /> Total image: 400 by 304, crop offset (0, 4)<br /> Framerate 10/1 (10.00 fps)<br /> Pixel aspect ratio 1:1 (1.000000:1)<br /> Frame aspect 4:3<br /> Colourspace unspecified<br /> Pixel format 4:2:0<br /> Target bitrate: 0 kbps<br /> Nominal quality setting (0-63): 16<br /> Vorbis stream 2:<br /> &nbsp;&nbsp;&nbsp; Total data length: 23413 bytes<br /> &nbsp;&nbsp;&nbsp; Playback length: 0m:05.767s<br /> &nbsp;&nbsp;&nbsp; Average bitrate: 32.472954 kb/s<br /> Logical stream 2 ended<br /> Theora stream 1:<br /> &nbsp;&nbsp;&nbsp; Total data length: 31776 bytes<br /> &nbsp;&nbsp;&nbsp; Playback length: 0m:05.900s<br /> &nbsp;&nbsp;&nbsp; Average bitrate: 43.086102 kb/s<br /> Logical stream 1 ended<br /> =================================================<br /> Ok so where next. I got caught up on the syntax for the "Caps", trying to supply a similar arrangement to this code below in Python which did not work at all.<br /> <br /> There is a command-line version of GStreamer that you can access with gst-launch and that allows you to sort-of "prototype" out a streamer Pipeline on the command-line to see if it works before then trying to integrate it into Python. So that's pretty cool.<br /> <br /> Problem is, I was getting supppper weird results from this below. This was telling me that GStreamer was missing some plugins which turned out to be a pretty awesome red herring/wild goose chase.<br /> <br /> I also was silly and tried to set a caps value on something using this format:<br /> self.audio1.set_property("caps", "audio/x-vorbis")<br /> <br /> And I got a pretty clear TypeError from Python. I was so confused though that I went on a search trying to figure out what I was doing wrong. As it turns out, it was a simple type error and you need to create a Caps object, like this:<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; caps = gst.Caps("audio/x-raw-float")<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.filter = gst.element_factory_make("capsfilter", "filter")<br /> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self.filter.set_property("caps", caps)<br /> <br /> But,&nbsp; as it turns out, I may not even need that. D'oh.<br /> <br /> Anyhow, this took me on a trip to attempt to install all the other gstreamer plugins, consider building gst-plugins-base myself, and a bunch of other things that didn't work. All because of this weird message about missing plugins.<br /> <br /> =================================================<br /> gst-launch gnlfilesource name=video location=$PWD/high_1.ogg \<br /> start=0 duration=5000000000 \<br /> media-start=0 media-duration=5000000000 \<br /> ! identity single-segment=true ! progressreport update-freq=1 ! ffmpegcolorspace \<br /> ! theoraenc ! oggmux name=mux ! filesink location=$PWD/outputResult.ogg \<br /> gnlfilesource name=audio caps="audio/x-raw-int" location=$PWD/high_1.ogg \<br /> start=0 duration=5000000000 \<br /> media-start=0 media-duration=5000000000 \<br /> ! identity single-segment=true ! audioconvert ! vorbisenc ! mux.<br /> <br /> Setting pipeline to PAUSED ...<br /> Pipeline is PREROLLING ...<br /> ERROR: from element /GstPipeline:pipeline0/GnlFileSource:audio/GstURIDecodeBin:internal-uridecodebin/GstDecodeBin2:decodebin20: Your GStreamer installation is missing a plug-in.<br /> Additional debug info:<br /> gstdecodebin2.c(3576): gst_decode_bin_expose (): /GstPipeline:pipeline0/GnlFileSource:audio/GstURIDecodeBin:internal-uridecodebin/GstDecodeBin2:decodebin20:<br /> no suitable plugins found<br /> ERROR: pipeline doesn't want to preroll.<br /> Setting pipeline to NULL ...<br /> Freeing pipeline ...<br /> =================================================<br /> <br /> <br /> Bah. So anyway after that, I then managed to get through the Python errors and then ended up with this pretty hard-to-understand error. It's basically saying that my audioconvert module is failing and that sortof implied again that maybe I was missing a plugin. Hmm... <br /> <br /> &nbsp;=================================================<br /> ** Message: pygobject_register_sinkfunc is deprecated (GstObject)<br /> play<br /> pad added!<br /> Traceback (most recent call last):<br /> &nbsp; File "gnonlin-tutorial1.py", line 64, in OnPad<br /> &nbsp;&nbsp;&nbsp; pad.link(convpad)<br /> TypeError: GstPad.link() argument 1 must be gst.Pad, not None<br /> stop<br /> quitting<br /> &nbsp;=================================================<br /> <br /> After more searching I finally came across this useful line. And enter the magical demuxer.... <br /> <br /> &nbsp;=================================================<br /> gst-launch filesrc location=$PWD/high_1.ogg ! oggdemux name="demuxer" \<br /> &nbsp; demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink \<br /> &nbsp; demuxer. ! queue ! theoradec ! ffmpegcolorspace ! autovideosink<br /> =================================================<br /> <br /> I ran this line and... voila!!!!!!!! My video clip played in a viewer, WITH AUDIO!!! Huzzahh!!<br /> <br /> So this is great news. I suspect the problem turned out to be that really I just need to essentially "unpack" the Vorbis audio file from the OGG container... I can't just "read the audio portion" from the Ogg file... though that seemed to work fine with the video portion. I guess I actually need to "demux" the Ogg file first, essentially unpacking it into it's audio and video portions. From there, I should hopefully be able to then compile up the start and end time segments that I want, and then re-compile them into a new Ogg file ("muxing them") and save that out to a filesink on disk. And of course, I'll need to do that in Python.<br /> <br /> So after a lot of tripping over the wrong things, I feel like I managed to make some progress. The issue with my specific file is likely that I need to demux it first or something like that. I just tried an initial version of this in Python and I don't get any audio playing... but at least there are no failures.<br /> <br /> One other odd thing in that this seems to work ok with the filesrc object. But I need to use the "gnlfilesource" object so I can splice it. That seems to hang up the pipeline for who knows what reason...<br /> gst-launch gnlfilesource location=$PWD/high_1.ogg start=0 duration=5000 \<br /> &nbsp; media-start=0 media-duration=5000 ! oggdemux name="demuxer" \<br /> &nbsp; demuxer. ! queue ! vorbisdec ! audioconvert ! audioresample ! autoaudiosink<br /> Setting pipeline to PAUSED ...<br /> Pipeline is PREROLLING ...<br /> <br /> Maybe you have to have a&nbsp; gnlcomposition for this to work. Anyway, I should go to bed. 3am on a "school" night :)<br /> <br /> Something to try to continue another night. Off to bed to dream of video editing in developing nations. <br /> <br /> Mike :) Mike Jutanhttp://www.blogger.com/profile/13692386796675585659noreply@blogger.com0tag:blogger.com,1999:blog-12401045.post-72323143305639009202013-06-18T01:06:00.000-07:002013-06-18T01:06:07.214-07:00OLPC XO Filmmaker: Well, I can playback files, sortofSpent just a couple hours tonight fiddling with GStreamer and GNonLin, their non-linear editing addition.<br /> <br /> After a bunch of fiddling and googling like crazy, I managed to find a couple of examples that I could fiddle with further to playback my OGG video files that I recorded using the built-in camera on the OLPC laptop.<br /> <br /> The one example I have is playing back my video, which is great. I can't remember now, but I think I got that to play the audio along with it.<br /> <br /> The other example I have is playing back 2 splices of 2 different videos (YES!!!!!!), cut together at different start and end points (YESSSSSSSS). But it doesn't have any audio attached, and I'm not sure how the heck to do that. But one thing at a time :)<br /> <br /> Obviously I will need to re-write this code and add UI elements etc, but it's good to have some examples to work from because the Documentation for GNonLin is G-Non-Existent (ha). Seriously though, the documentation is epically lacking, and I'm hoping my code can end up being a good example that people can refer to online once it's done.<br /> <br /> Tonight I found another great example from the awesome jonobacon, this was a good first start: <a href="http://www.jonobacon.org/2006/12/27/using-gnonlin-with-gstreamer-and-python/">http://www.jonobacon.org/2006/12/27/using-gnonlin-with-gstreamer-and-python/</a><br /> His explanations were great, but for the life of me I couldn't get this to playback any audio on my machine Not sure why. I tried a few different filetypes (.OGG, .MP3, etc) but couldn't get any audio playback to work.<br /> <br />After working with this though, I found some cool examples of video playback here:<br /> <a href="http://lists.freedesktop.org/archives/gstreamer-devel/2010-September/028407.html">http://lists.freedesktop.org/archives/gstreamer-devel/2010-September/028407.html</a><br /> After not-much fiddling, I managed to get a stream which plays back 2 SEPARATE VIDEOS, "cut" together at a supplied start and end time. Fantastic. So that's exactly the sort of thing I want, and ultimately then to save this file (I guess, "encode" it) back to disk. I of course also need to figure out how to get the supplied audio tracks to come along for the ride.<br /> <br /> The "scrubbing" in this video works but only across one clip - it freaks out after the first one and then crashes. It's great to have some examples, cause man, the docs for this puppy are hard to come by. I am looking forward to more fiddling with this and getting something together that works... and then pimpin' out the UI some more so it looks easy to use. The main goal here (and the reason I am not just porting the excellent and already-existing PiTiVi Gnome video editor to OLPC) is that this needs to be usable by young kids - that's the audience of OLPC. So the workflow needs to be hyper-intuitive and as simple as possible. As little English wording as possible too because the more internationalized I can be from the start, the less I need to hope that people around the world write translation modules for me.<br /> <br /> But first, the technology. Python rocks and I know it super well, but this GStreamer and GNonLin API is "hella verbose" and I'm sure glad for guys like jonobacon who is helping to make it easier to get over the initial learning curve. Once I see a few more examples and fiddle some more, I think I'll start making more progress. But it sure was cool tonight to see 2 clips merged together in one playback window. That I envision would be a "video project" that kids would compile together from existing clips (a.l.a. a very simplified version of iMovie). To save that to a file then, I think I just need to somehow attach an "encoder" to the end of the GStreamer pipeline.<br /> <br /> Onwards!<br />Mike :)<br /> <br />Mike Jutanhttp://www.blogger.com/profile/13692386796675585659noreply@blogger.com0tag:blogger.com,1999:blog-12401045.post-84939291076781013562013-06-17T02:14:00.000-07:002013-06-17T02:17:27.875-07:00OLPC XO Filmmaker progress: Basic GStreamer audio and GTK appOnwards!! As you can see I am back to it, working again towards my ultimate aim of a video editing application for the One Laptop Per Child program's "XO" laptops. We all know that naming things in Computer Science is hard, so even though I am still a ways away from getting this app done, I've got a name for it. I want to keep it simple, so I'm going to call it, "XO Filmmaker".<br /> <br /> As you saw from yesterday's post, I was crazily working last night till 5:00am to get my Windows 7 machine to be a more effective virtualized host for a Fedora VirtualBox "guest" machine.<br /> <br /> Things are now finally quite smooth. The biggest problem as I mentioned in yesterday's post was that I had hardcore run out of (virtual) disk space on the Linux virtual machine, and so I couldn't install anything and stuff was generally going haywire. Getting that sorted last night was SWEET. Also I managed to finally get dual-monitor support working on the Linux machine too, which means I can work :) This is all great. Tonight I fixed an issue with the VirtualBox Guest Additions, so now I can freely copy and paste from my Windows machine to the virtualized Linux machine... this is all kindof magic.<br /> <br /> Tonight, the main event was to start learning about GStreamer, and make a test program using GLADE (GTK's wysiwyg user interface editing toolkit, like Qt Designer), connected to callbacks inside of Python to GStreamer objects. SUCCESS!!<br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVm7JlCiRFqgMJmU-VhepEMcjwGIxpo4MDRO825KFthIFTSebdphDadCCLqNojC3lkXXvoBsK7FilRQWdWdkvsfmD5ftRCgkKd-vMDsDMq6M_KTdhEYmqXwJCL7aun9BDJWV1spw/s1600/gstreamerAudio.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVm7JlCiRFqgMJmU-VhepEMcjwGIxpo4MDRO825KFthIFTSebdphDadCCLqNojC3lkXXvoBsK7FilRQWdWdkvsfmD5ftRCgkKd-vMDsDMq6M_KTdhEYmqXwJCL7aun9BDJWV1spw/s1600/gstreamerAudio.jpg" height="374" width="640" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">A GLADE user interface (3 buttons) connected to a Python program, running a GStreamer Pipeline</td></tr> </tbody></table> I followed the great tutorial here:<br /> <a href="http://www.jonobacon.org/2006/08/28/getting-started-with-gstreamer-with-python/">http://www.jonobacon.org/2006/08/28/getting-started-with-gstreamer-with-python/</a><br /> <br /> So, why is this cool???<br /> <br /> Well...<br /> <br /> This is basically the foundation of what I am trying to ultimately do, which is a video editing application for the One Laptop Per Child program. For this application I am trying to write, I am ultimately going to need some GTK widgets, probably created via this GLADE tool, and then have them firing events back to Python code (as I am doing here as well). And in the backend, doing most of the work, will be the GStreamer Python library. This example just plays a tone through the sound card, but that's sortof similar to decoding and playing back video files. GStreamer does handle this, which is great. And ultimately, I want to figure out how to use something called GStreamer Editing Services to combine inputted .OGG video files together into a glorious edited result.<br /> <br /> Tonight was awesome, and I'm finally feeling like I've got a stable setup here and some good ground to stand on to now move forwards with the actual app writing. There's still a lot of work ahead of me on this, and I'm going at it alone which is a little crazy given my generally busy work schedule and life in general. I could have put together a team for this but I think it's pretty tractable to get it done myself, I just need to keep chipping away at it. I really believe in this, and I want to make sure to get it done. Even if it does take me longer than I'd hope, I'm gonna keep chipping away at it whenever I can sort out larger blocks of time.<br /> <br /> Once I get version 1 of XO Filmmaker out to OLPC, I'll upload it on Github for the Open Source community. At that point, I may try to source some more volunteers to help maintain and add new features going forwards, or at least offer up my services as more of a consultant/code-reviewer/project lead kindof role. If any budding young coders want to try to add some new features, I can offer advice/support/guidance which would be super fun too.<br /> <br /> Glad to have made some progress and have some idea of how GStreamer works now. This is all quite exciting :)Mike Jutanhttp://www.blogger.com/profile/13692386796675585659noreply@blogger.com1tag:blogger.com,1999:blog-12401045.post-32913187028539499642013-06-16T04:08:00.000-07:002013-06-16T04:36:49.800-07:00Extending the size of a virtual disk in VirtualBox + resizing Linux LVM partitionsWow, this was complicated.<br /> <br /> As part of the OLPC development I've been doing on a Virtualized Fedora machine running from Windows 7, I figured I'd be smart and let VirtualBox manage my disk size. Seems appropriate. But... I set the initial disk size to 8 Gb or something too small to use for Linux and all the stuff I am doing.<br /> <br /> So no worries, I should just need to extend the size of the VirtualBox disk up to 20Gb, right? Well, sortof.<br /> <br /> That works, but then the Virtual Linux machine has a bunch of unpartitioned space you need to partition. That's cool, and I managed to do that in an active Linux session open. The problem is, I actually want to increase the size of the main "running" partition -- and you can't do that while a disk is running of course.<br /> <br /> Enter something fancy called GParted, a partition manager you can boot into using an iso disk image. Pretty sweet: <a href="http://gparted.sourceforge.net/download.php">http://gparted.sourceforge.net/download.php</a><br /> <br /> From here, you can get a fancy partition window and it looks great, but wait a sec, my disk is locked!<br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_t-zUyTYSonm2eOurq8RqqmJqnUA5gvI-JKW4r5QEJYKKNdv0NjpPf8FVOOWWXKVUnt3i_I9rwS7IssDwjnBsVTPv1BDBlH9i33ySAOBgrN3KaG-QE9vZDuA5i2ZIXGA-mR0-cQ/s1600/resizePartitions.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_t-zUyTYSonm2eOurq8RqqmJqnUA5gvI-JKW4r5QEJYKKNdv0NjpPf8FVOOWWXKVUnt3i_I9rwS7IssDwjnBsVTPv1BDBlH9i33ySAOBgrN3KaG-QE9vZDuA5i2ZIXGA-mR0-cQ/s1600/resizePartitions.JPG" height="516" width="640" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">Darn you, LVM partitions</td></tr> </tbody></table> Apparently these LVM partitions are "locked" and hard to extend. Weird.<br /> <br /> But after reading for an hour or so on various Google sites, I found this one which explained very well how to extend an LVM partition. Instead of extending it, I just need to take my new space (that 12Gb drive /dev/sda3), format it to be LVM2 PV format as well, and then "connect" it to the existing drive (/dev/sda2).<br /> <br /> This is a great explanation, from this site: <a href="http://www.ibm.com/developerworks/library/l-resizing-partitions-2/">http://www.ibm.com/developerworks/library/l-resizing-partitions-2/</a><br /> <blockquote class="tr_bq"> LVM is a disk allocation technique that supplements or replaces traditional partitions. In an LVM configuration, one or more partitions, or occasionally entire disks, are assigned as <i>physical volumes</i> in a <i>volume group</i>, which in turn is broken down into <i>logical volumes</i>. File systems are then created on logical volumes, which are treated much like partitions in a conventional configuration. This approach to disk allocation adds complexity, but the benefit is flexibility. An LVM configuration makes it possible to combine disk space from several small disks into one big logical volume. More important for the topic of partition resizing, logical volumes can be created, deleted, and resized much like files on a file system; you needn't be concerned with partition start points, only with their absolute size.</blockquote> Strangely, I actually get what's happening after this explanation. I just need to "connect" these 2 drives together, after formatting the unallocated space into LVM2 PV format to match my existing 100% full /dev/sda2 drive.<br /> <br /> GParted can't connect the drives, so I need to open up a terminal in the booted GParted window, and run something called vgextend. This allows me to take the existing "Volume Group" called "fedora" and extend it out to include the new /dev/sda3 drive as well. Wahoo!!<br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSJar1mcExrBgAPFuUfU50oqnTuu_2kVaWxEB0eVHqWGVD-wOD_MN8Co3F8Ko0QoxAdXUKOoExelN6AZ2qB3Ad20lPw75ydeyM20XPkmypxeyGMAAElNMqtRnCA-KlrLcSksH4NA/s1600/resizePartitions2.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSJar1mcExrBgAPFuUfU50oqnTuu_2kVaWxEB0eVHqWGVD-wOD_MN8Co3F8Ko0QoxAdXUKOoExelN6AZ2qB3Ad20lPw75ydeyM20XPkmypxeyGMAAElNMqtRnCA-KlrLcSksH4NA/s1600/resizePartitions2.JPG" height="181" width="400" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">Wahoo!</td></tr> </tbody></table> Now the /dev/sda3 drive is also part of the same mount point as /dev/sda2. Now I should stop getting these annoying drive empty errors on my Virtualized Fedora machine... hmm maybe not quite yet. But looks like I'm close ;)<br /> <br /> &gt;&gt;Edit: Ok, I figured it out. That excellent IBM page suggested I install something called system-config-lvm. First, I had to uninstall something big (firefox, and deleted some icons and media files). Then I could install it.<br /> <br /> <br /> This allowed me to see the logical disk setup. There was 12Gb unused space that I could extend my logical drive into. This program also "extended the file system" into this space as well as just extending the logical drive volume. Whew!!!!!!!!!! What a lot of work :)<br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhxef6qy9xSZfzM2eJbm0xS0C1nAW4kvm2WKeABjUdatkl1ViKYtlzhKOTlgD6KenRqnJWiZVWwC1nwXN2Rv8o_o87Id2SHXM8iAysS2_Dz9PbMHUspeXOQcS7JopDBSeg5VqOhg/s1600/lvm.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhxef6qy9xSZfzM2eJbm0xS0C1nAW4kvm2WKeABjUdatkl1ViKYtlzhKOTlgD6KenRqnJWiZVWwC1nwXN2Rv8o_o87Id2SHXM8iAysS2_Dz9PbMHUspeXOQcS7JopDBSeg5VqOhg/s1600/lvm.jpg" height="411" width="640" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">First, extend the logical volume into the remaining space.</td></tr> </tbody></table> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8xxlFqk7r3czuCkQ29257sCYbZn7efQe1J33hXk0PuKp4Ptq20-jhqzEAfm2ZPcFJef0zxP6KvRVf7LI0qQuk4LFpQEWFU2XSveSk0Z11yuw0SXv4wfTSBdjioskghW31G24S_w/s1600/lvm2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8xxlFqk7r3czuCkQ29257sCYbZn7efQe1J33hXk0PuKp4Ptq20-jhqzEAfm2ZPcFJef0zxP6KvRVf7LI0qQuk4LFpQEWFU2XSveSk0Z11yuw0SXv4wfTSBdjioskghW31G24S_w/s1600/lvm2.jpg" height="385" width="640" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">Ahh, that looks better! Now the root area is much larger, and actually has some space!</td></tr> </tbody></table> <br /> <div class="separator" style="clear: both; text-align: center;"> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhxef6qy9xSZfzM2eJbm0xS0C1nAW4kvm2WKeABjUdatkl1ViKYtlzhKOTlgD6KenRqnJWiZVWwC1nwXN2Rv8o_o87Id2SHXM8iAysS2_Dz9PbMHUspeXOQcS7JopDBSeg5VqOhg/s1600/lvm.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div> And now when I look at the Disks utility, I can see the filesystem has increased from 5Gb to 19Gb. Woot!<br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWoxa2mMzQOHUO2I8crrs5bW1u2nNeLK9ENUeuUvBsC92V6wxgICGBRUy91yVnkF8X9XxY17Gg4qTzbG09aSwwrj7rtU9hqSZpM9VbzcR1fFZ43UDMRYcMjstYmTCp3J8HTqqRbg/s1600/lvm3.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWoxa2mMzQOHUO2I8crrs5bW1u2nNeLK9ENUeuUvBsC92V6wxgICGBRUy91yVnkF8X9XxY17Gg4qTzbG09aSwwrj7rtU9hqSZpM9VbzcR1fFZ43UDMRYcMjstYmTCp3J8HTqqRbg/s1600/lvm3.JPG" height="502" width="640" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">Back in business</td></tr> </tbody></table> Man that was hard and interesting and also it's 4:30am and I'm going to sleep. Back to the OLPC software development another day. But for now, it was nice to get the system functioning again, and learn a little more about Linux filesystem management (more than I ever thought I'd want or need to know) at the same time :)Mike Jutanhttp://www.blogger.com/profile/13692386796675585659noreply@blogger.com2tag:blogger.com,1999:blog-12401045.post-6303459590171891142013-03-18T00:56:00.000-07:002013-03-18T01:22:27.995-07:00OLPC Video Editor: Looks like we can cut a file<a href="http://jutanclan.blogspot.com/2012/11/one-laptop-per-child-here-we-go.html">(Here's what I'm doing, why I'm doing it, and why One Laptop Per Child friggin' rocks</a>) <br /> <br /> It has been a busy few weeks at work and with my family visiting, but I had a couple spare hours tonight to get back to this project which was suuuper sweeeeeeeeet.<br /> <br /> Made some good progress on figuring out which technologies NOT to use for video splicing on Linux... and man are there a lot complicated solutions! I read documentation pages for about 8 different options, none of them ultimately a good choice. D'oh. After trying a few things out and not making any progress, I opted to try "oggCut" and "oggCat", and had success running this from a standalone Python script (running in my virtualized Linux environment, not on the OLPC itself yet... it'll be a while till we can get that sorted).<br /> <br /> As I mentioned in my previous post, it may turn out to make most sense to just "cut" the video using command-line programs launched from a subprocess call from the XO activity. We know those calls are blocking, and it's not too too disk intensive so it should run fast enough without freezing the UI too badly.<br /> <br /> I first tried trimming and splicing together a random .OGG video file I found online and it worked, which was exciting. The audio seems to be lined up too which is good, cause that can always be an issue when you splice files which contain both an audio and video stream. So that was a good first step.<br /> <br /> Then I recorded myself talking in a couple of different quality settings from the existing OLPC Activity called "Camera", on my XO itself. It's important to test this solution with "real" video data that's actually recorded from the XO device itself, because I had roughly no idea what frame rate or encoding it uses and this oggCut/oggCat combination could have failed for the ogg files from the XO. Good news, it seems to work (or at least, in most cases). These are part of the oggvideotools and are working quite well. <a href="http://www.streamnik.de/78.html">http://www.streamnik.de/78.html</a> and <a href="http://en.flossmanuals.net/ogg-theora/ch052_cat-files/">http://en.flossmanuals.net/ogg-theora/ch052_cat-files/</a><br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEwdfNHADLPY2qfsHkOD3zZWY8rMqr4euCu4K1IXseaXzBtNm5zqKpGj34Bz4a3Zfi9V2vds7INcQp7p3I-0lou28YE4bgW-b9dOlTchu1zwfeUuAOE3WAmbJILdVuwvKKFOb_Rw/s1600/oggVideo.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEwdfNHADLPY2qfsHkOD3zZWY8rMqr4euCu4K1IXseaXzBtNm5zqKpGj34Bz4a3Zfi9V2vds7INcQp7p3I-0lou28YE4bgW-b9dOlTchu1zwfeUuAOE3WAmbJILdVuwvKKFOb_Rw/s1600/oggVideo.JPG" height="400" width="640" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">Edited Ogg Video file, spliced together into a single file from 2 separate original Ogg files recoded on the XO laptop</td></tr> </tbody></table> <br /> To get this to work, I needed to install oggvideotools:<br /> <b>yum install oggvideotools</b><br /> <br /> I believe I read that you can bundle whatever libraries you need installed with an Activity installer itself, which is good, cause oggvideotools is not available by default on the XO machines. So hopefully I can work that out when needed.<br /> <br /> Then I called a subprocess from Python, calling out to oggCut (to slice the videos) and oggCat (to compile the sliced videos together into a final, single video).<br /> <br /> &gt; import subprocess <br /> &gt; subprocess.Popen("oggCut -i 1.ogg -s 1000 -e 5000 -o fromPython.ogg; oggCut -i 2.ogg -s 0 -e 2000 -o fromPython2.ogg; oggCat editFromPython.ogg fromPython.ogg fromPython2.ogg", shell=True) <br /> <br /> The "s" and "e" times are in milliseconds, and specify the start and end points for the video. This generally worked, though I got an error a couple of times on one of the videos. Not sure why - perhaps I am trying to edit past the end of the video or something... so it wasn't 100% bulletproof, but it seemed to roughly work for the moment!<br /> <br /> I also spent some time reading about GStreamer and am trying to figure out how best to playback these videos from a GTK window. I haven't used GStreamer before and was hoping their GNonLin linear video editing stuff would be straightforward but it seems like a bit of a learning curve... so it might be better just let the kids mark the start and end points in the GStreamer UI, and leave the actual editing work to the command line oggvideotools.<br /> <br /> Anyhow! Made some progress which is good. Glad to keep this moving, and although it's been tough to make time lately to work on this, I am excited to see some progress and I think this is gonna be cool as time progresses. More updates when I get another chance to work on it.<br /> <br /> In other news, I'm thinking of running an OLPC "Birds of a Feather" meeting at the SIGGRAPH Computer Graphics Conference in Anaheim, California in July this year. I still gotta confirm whether or not I am going to the conference, but if I am it seems like a good idea to help mobilize and excite the community of developers about what's going on and how they can contribute... sounds exciting eh? Ideally I'd like to have some interesting work to show by then on my XO at the conference... so we'll see how it all progresses. I better keep at it :) Anyway, fun times and I'm getting a chance to learn some of this crazy Linux sysadmin/build setup/installer/video editing stuff, so that's a really cool side benefit too. Good times :)<br /> <br /> Aside: Hmm, this is interesting: <a href="https://blogs.gnome.org/edwardrv/2009/11/30/the-result-of-the-past-few-months-of-hacking/">https://blogs.gnome.org/edwardrv/2009/11/30/the-result-of-the-past-few-months-of-hacking/</a> It looks like the guys who made Pitivi, a non-linear Linux video editor (that I basically want to make a super simple, kid-friendly version of) made a library that might help you in writing applications like this. I am gonna give them a shout and see if they have some advice for me on this. Haha, hilarious quote from Edward Hervey, the writer of the GStreamer Editing Services library about why he wrote it:<br /> <blockquote class="tr_bq"> "Because writing audio/video-editors is a lot of work, and we should make it as easy as possible for people to write such applications while being able to leverage the power of GStreamer and not requiring a PhD in nuclear engineering.<b>"</b></blockquote> haha :)Mike Jutanhttp://www.blogger.com/profile/13692386796675585659noreply@blogger.com0tag:blogger.com,1999:blog-12401045.post-26789178246333365932013-02-27T01:50:00.002-08:002013-02-27T02:02:55.147-08:00OLPC Video Editor: Research on ogg file splicingHad 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.<br /> <br /> 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.<br /> <br /> 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.<br /> <br /> 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.<br /> <br /> 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.<br /> <br /> 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.<br /> <br /> Some Gnonlin links: <br /> <ul> <li><a href="http://gstreamer.freedesktop.org/apps/">http://gstreamer.freedesktop.org/apps/</a></li> <li><a href="http://www.jonobacon.org/2006/12/27/using-gnonlin-with-gstreamer-and-python/">http://www.jonobacon.org/2006/12/27/using-gnonlin-with-gstreamer-and-python/</a></li> <li><a href="http://www.openshotvideo.com/2008/05/introduction-to-gnonlin.html">http://www.openshotvideo.com/2008/05/introduction-to-gnonlin.html</a></li> </ul> Some other alternatives that I need to read about more, as they might be simpler if they can do what I want:<br /> <ul> <li><a href="http://superuser.com/questions/367584/concatenating-ogg-video-files-from-the-command-line">http://superuser.com/questions/367584/concatenating-ogg-video-files-from-the-command-line</a></li> <li><a href="http://en.flossmanuals.net/ogg-theora/ch052_cat-files">http://en.flossmanuals.net/ogg-theora/ch052_cat-files&nbsp;</a></li> </ul> 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.<br /> <ul> <li><a href="http://osric.com/chris/accidental-developer/2012/04/using-ffmpeg-to-programmatically-slice-and-splice-video/">http://osric.com/chris/accidental-developer/2012/04/using-ffmpeg-to-programmatically-slice-and-splice-video/&nbsp;</a></li> <li><a href="http://ffmpeg.org/faq.html#How-can-I-join-video-files_003f">http://ffmpeg.org/faq.html#How-can-I-join-video-files_003f</a></li> <li><a href="http://code.google.com/p/pyffmpeg/">http://code.google.com/p/pyffmpeg/</a>&nbsp; </li> </ul> <ul> </ul> Mike Jutanhttp://www.blogger.com/profile/13692386796675585659noreply@blogger.com1tag:blogger.com,1999:blog-12401045.post-86448294741134895582013-02-21T02:49:00.001-08:002013-02-21T02:49:34.702-08:00OLPC Activity: Hello WorldAhhhh yes.<br /> <br /> 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!<br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic-DZM1dMJ7lmJP_0Ic4JfEH0y_vbizZzhgedzBW_Kdy1_Van8OGu_UIbmLTbTXC8FBKuflXUHRGWdy04RyiKJmQn8Kwtjszt78TJVzUl9Z4d-kjwVir1N8EdYxJAQiB3kZufIRg/s1600/activity1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic-DZM1dMJ7lmJP_0Ic4JfEH0y_vbizZzhgedzBW_Kdy1_Van8OGu_UIbmLTbTXC8FBKuflXUHRGWdy04RyiKJmQn8Kwtjszt78TJVzUl9Z4d-kjwVir1N8EdYxJAQiB3kZufIRg/s1600/activity1.jpg" height="444" width="640" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">Creatively entitled, "JutansAwesomeActivity"</td></tr> </tbody></table> <br /> As Hello World programs tend to be, it doesn't do much. Though it still is pretty awesome.<br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv4KpKs7kS7MoTKFgIXeV3CGf02mgw3d8R6uT8-UAgWGgMcZLlH7vD3l6tkcomNtuHgf4pTkhRqRbGocbiCm9R4Wei0pSAkSr3DKIhaa22TUE_4qEpM3Nr4HRv90H3eQfxTfcmgQ/s1600/activity2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv4KpKs7kS7MoTKFgIXeV3CGf02mgw3d8R6uT8-UAgWGgMcZLlH7vD3l6tkcomNtuHgf4pTkhRqRbGocbiCm9R4Wei0pSAkSr3DKIhaa22TUE_4qEpM3Nr4HRv90H3eQfxTfcmgQ/s1600/activity2.jpg" height="505" width="640" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">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 ;)</td></tr> </tbody></table> <br /> 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.<br /> <br /> 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.<br /> <br /> 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.<br /> <br /> Mike :)Mike Jutanhttp://www.blogger.com/profile/13692386796675585659noreply@blogger.com1tag:blogger.com,1999:blog-12401045.post-11715026685966612892013-02-20T00:46:00.000-08:002013-02-20T00:46:38.284-08:00Building OLPC activities within Sugar-buildWhew, 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. <br /> <br /> Tonight I experimented some more with the OLPC Sugar-build setup (as described here: <a href="http://sugarlabs.org/~buildbot/docs/build.html">http://sugarlabs.org/~buildbot/docs/build.html</a>). 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.<br /> <br /> 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 (<a href="http://git.sugarlabs.org/">http://git.sugarlabs.org/</a>)<br /> <br /> This now allows me to do a few necessary things:<br /> 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)<br /> <br /> 2) Write and modify code<br /> <br /> 3) Build and test the activities inside of the sugar environment on my desktop<br /> <br /> 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.<br /> <br /> First of all, find the git:// address for the OLPC activity you want access to. (on here <a href="http://git.sugarlabs.org/">http://git.sugarlabs.org/</a>). From there, go to your sugar-build directory and edit the following file:<br /> <i><b>config/modules/activities.json</b></i><br /> <br /> <div class="separator" style="clear: both; text-align: center;"> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2-eCpqzRL-mLT_e9rGdBSXScKywwR6Pnstmj_6oWdRwR5ObJ626N7DOYaxqkzYM_FJWAMpKhAntRqBDpSDEFky-yDwMDai08YZCYhSsYloy_R7b98vyV61uBbZTR4ncfHJxpemQ/s1600/addingModules.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2-eCpqzRL-mLT_e9rGdBSXScKywwR6Pnstmj_6oWdRwR5ObJ626N7DOYaxqkzYM_FJWAMpKhAntRqBDpSDEFky-yDwMDai08YZCYhSsYloy_R7b98vyV61uBbZTR4ncfHJxpemQ/s1600/addingModules.jpg" height="345" width="640" /></a></div> <br /> <br /> 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.<br /> <br /> Then "pull" from the git repo to get the code:<br /> make pull<br /> <br /> make build<br /> make run<br /> <br /> <br /> 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.<br /> <br /> 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.Mike Jutanhttp://www.blogger.com/profile/13692386796675585659noreply@blogger.com0tag:blogger.com,1999:blog-12401045.post-39160411830874160792013-02-05T01:03:00.000-08:002013-02-05T01:03:35.786-08:00OLPC: Children in Peru write their own history on Wikipedia<span class="userContent">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...</span><br /> <span class="userContent"><br /></span> <iframe allowfullscreen="" frameborder="0" height="360" src="http://www.youtube.com/embed/1XPnH_rF9ks?rel=0" width="640"></iframe><br />Mike Jutanhttp://www.blogger.com/profile/13692386796675585659noreply@blogger.com0tag:blogger.com,1999:blog-12401045.post-79767966433687744912013-01-29T00:19:00.001-08:002013-02-01T01:19:52.634-08:00Getting Fedora 18 set up on VirtualBox: Round 2Wow, sure has been a while since I've set up a new Linux machine. I am missing all my aliases and keyboard shortcuts!! Ahh!!<br /> <br /> Learned a few more things tonight. Apparently the default user you make in Fedora 18 does not have Administrator access, so that's why I was having problems doing anything outside of root. I just learned the difference between "su" and "su -" as well. You can put a user into a group called "wheel" that gives sudo access which is fancy. I guess I haven't set up a machine in quite a while, and I am used to having these things all work a certain way from the get-go. Crazy times. Anyhoo fiddled with this for a while and got it to work.<br /> <br /> For some reason you can't right click on the background to get a terminal?!?!? That's NOT default Linux behaviour, which was really surprising. For that I needed ot install "nautilus-open-terminal". Who would have thought? (*Note, turns out this is just cause I am new to Gnome 3, and these are all Gnome 2 features I am used to, so you can install something called gnome-tweak-tool that allows you to do stuff you'd expect to be able to do on Linux, like right click the background and get a terminal window.) :)<br /> <br /> Ok this is pretty sweeeet. The website <a href="http://extensions.gnome.org/">http://extensions.gnome.org</a> has a bunch of add-ons you can load just from a web browser, and they will install on your local machine. Pretty sweet. That allowed me to get a nice quick launch sidebar and some other useful stuff.<br /> <br /> Alright back to work trying to get my build of the Sugar OS running!<br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-0cwoz3m_j9M6zNAciReUrXqA0blOcijfAlDEDA_py0uB76mDnAWOBeevA155j-5u2vXjb5GZo9H1S9YrTvgHCIkFibLug_2sQcqL21gaCLA6x96lWxMAQ8Jnp1PGuxF4ZcmhXg/s1600/sugarBuild.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-0cwoz3m_j9M6zNAciReUrXqA0blOcijfAlDEDA_py0uB76mDnAWOBeevA155j-5u2vXjb5GZo9H1S9YrTvgHCIkFibLug_2sQcqL21gaCLA6x96lWxMAQ8Jnp1PGuxF4ZcmhXg/s1600/sugarBuild.JPG" height="257" width="400" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">Almost there...</td></tr> </tbody></table> As it turns out my problems last night were related to software group permissions (ain't that always the thing, eh!) After I got some great advice from one of the friendly folks at Sugar Labs who said it looked like an "Authentication Problem", I realized I was trying to run the code as "mjutan", but I had sync'd and built as "root" (since mjutan was not a sudoer when I tried to do this yesterday). All of this led to my build not launching.<br /> <br /> After all is said and done... I've got Sugar running from source code I built!!!! Hooray! This is great news. I'll need to install some other activities but then it ought to be pretty straightforward from this point to iterate on the work and see the results back in Sugar. Very nice.<br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipVOItsyqCQRaPxWC1D5DuPSSZSCHyNfA2gDx75llRRMOR6AleGroDTSrkV06oZKHff29V2jRAClTwLuUTv8iXogHmuyvH46kYj8oEg7DPIa_H87QipfCcUIfvk6q3T9m7ddurBg/s1600/sugar2.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipVOItsyqCQRaPxWC1D5DuPSSZSCHyNfA2gDx75llRRMOR6AleGroDTSrkV06oZKHff29V2jRAClTwLuUTv8iXogHmuyvH46kYj8oEg7DPIa_H87QipfCcUIfvk6q3T9m7ddurBg/s1600/sugar2.JPG" height="416" width="640" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">Sugar OS, running from built source code on Fedora 18, which is emulated on my Windows 7 machine through VirtualBox</td></tr> </tbody></table> <br /> Hooraaaay!!!!!!! Awesome to get this going. Next step will be to read through the "Make your own sugar activities" manual in full (or as much as I need to) and then start planning the changes I am going to make to the existing Recording app, or alternatively plan out my own app in more detail. I gotta see if I can playback movie files through this VirtualBox thing, hopefully my video card doesn't freak out.<br /> <br /> More details as I figure 'em out :) Till next time... Mike :)<br /><br />PS More good news. Audio and Video playback both work in the VirtualBox instance. I tested running a .ogg file with audio and video and it looks good. So that means I'll be able to test playback with pre-recorded ogg files from my XO laptop. Sweet.Mike Jutanhttp://www.blogger.com/profile/13692386796675585659noreply@blogger.com0tag:blogger.com,1999:blog-12401045.post-39313542321480386892013-01-28T00:51:00.000-08:002013-02-01T01:19:52.632-08:00Setting up Fedora 18 virtually on Windows as a Dev Environment for Sugar ActivitiesI had the pleasure of attending OLPC-SF's (One Laptop Per Child, San Francisco Chapter) 5th Anniversary event here in SF this weekend. It's amazing that folks have been working on exciting projects together for 5 years already, and I feel lucky to have met all of these interesting and awesome people, albeit coming to this game only relatively recently!<br /> <br /> Since being first inspired to jump aboard and do my part for OLPC, I've got my own XO 1.75 laptop (courtesy of the lovely ladies from OLPC Canada) to experiment with and test my work, and I've managed to <a href="http://jutanclan.blogspot.com/2012/11/one-laptop-per-child-here-we-go.html">get SoaS ("Sugar on a Stick") installed via Oracle's VirtualBox on my development machine at home</a>. This was pretty straightforward, and I documented some of the steps on <a href="http://jutanclan.blogspot.com/2012/11/one-laptop-per-child-here-we-go.html">this previous blog entry</a>.<br /> <br /> If you are interested in developing Sugar Activities or contributing software skills to the OLPC effort, contact the fine folks on the Sugar Dev team <a href="http://wiki.sugarlabs.org/go/Development_Team">here</a> or email me at jutanclan (-at-) gmail (-dot-) com and I'm happy to give you a hand or pass you along to the right people/helpful website.<br /> <br /> In the background I've been slowly making my way through this excellent Floss manual ("<a href="http://www.flossmanuals.net/make-your-own-sugar-activities/">Making your own Sugar Activities</a>") and I thought I'd do a bit of screen-capping of my own as I go, to document my own process, and to help anyone else who might come across this and have an interest to develop for OLPC too.<br /> <br /> If you're like me and born after 1980, you grew up with Microsoft Windows and you might not use Linux at home... even if you are a Computer Scientist. (I know, I know.) ;) I have a Win 7 Dev machine and a Mac Mini, and my Win 7 machine has a massive HD and is my main go-to machine... so I've decided to install the Fedora 18 Operating System via VirtualBox. You can also do a dual-boot scenario, but VirtualBox really seems to have improved over the years, so it makes it easy to virtualize a machine... plus that idea is just kinda cool, and sortof crazy that this works.<br /> <br /> You really need Linux for developing parts of Sugar or Sugar Activities, so I'm installing the newest Fedora (version 18) now. First I made a new VirtualBox machine, and labelled it "Fedora 18". <br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoeWg8UQx6USdjXEGKUTCvwxKP0adxlGcVXRC_IZvB5SPs4_P1AiAR3tUQdnhZwK4JZFIAXczv75pL3THKDfOjDbITGfJdDW7fjhm9gaKfTqde93TKJ10Wcd96j9jV1Iv9W_7qRg/s1600/fedora18.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoeWg8UQx6USdjXEGKUTCvwxKP0adxlGcVXRC_IZvB5SPs4_P1AiAR3tUQdnhZwK4JZFIAXczv75pL3THKDfOjDbITGfJdDW7fjhm9gaKfTqde93TKJ10Wcd96j9jV1Iv9W_7qRg/s1600/fedora18.JPG" height="301" width="400" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">Fedora 18 Virtual Machine in VirtualBox</td></tr> </tbody></table> Then I downloaded what's called an "ISO" file, also sometimes referred to as an "Installer". This was from the Fedora site: <a href="http://fedoraproject.org/en/get-fedora">http://fedoraproject.org/en/get-fedora</a> <br /> <br /> <br /> <div class="separator" style="clear: both; text-align: center;"> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRb5AxlC6xEkaiW8sZKkwkyKPvRF49CCYGEtoIhH2FCokqWcKQFbIdzJX8fCgBOGV1-1BSUvsFeBZhrzEvjCYD6Yi9qAq5SA30qdeA34fBMCA6_MJ0lT0TlafkPvGZ-t4E4-l4fg/s1600/fedora1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRb5AxlC6xEkaiW8sZKkwkyKPvRF49CCYGEtoIhH2FCokqWcKQFbIdzJX8fCgBOGV1-1BSUvsFeBZhrzEvjCYD6Yi9qAq5SA30qdeA34fBMCA6_MJ0lT0TlafkPvGZ-t4E4-l4fg/s1600/fedora1.JPG" height="212" width="320" /></a></div> <br /> If you get an error like this, go to the Devices-&gt; CD/DVD Devices menu and select "Choose a virtual CD/DVD disk file" and point to the ISO file you downloaded from the Fedora site.<br /> <br /> Reboot the Virtual Machine from the "Machine" menu, then you should see something like this.<br /> <br /> <div class="separator" style="clear: both; text-align: center;"> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMCMRb6nEOYowDZN3HLi7ADEGY-w0sWRlv924Dg57PhvZXZ7PvoL1KqhvBf850DeVLYbyjzOsmo_Pi3Wm6VVMCUldkbqyK533R855kEqR2EeaMdJE4soAiVDHqJorhaAsZ12jIZQ/s1600/fedora2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMCMRb6nEOYowDZN3HLi7ADEGY-w0sWRlv924Dg57PhvZXZ7PvoL1KqhvBf850DeVLYbyjzOsmo_Pi3Wm6VVMCUldkbqyK533R855kEqR2EeaMdJE4soAiVDHqJorhaAsZ12jIZQ/s1600/fedora2.JPG" height="271" width="320" /></a></div> <br /> This is a good sign. Let's get started!<br /> <br /> Log into Fedora, and start setting up your user/account. You can just select Live System User for now, that's a quick way to get started.<br /> <br /> Well that certainly was easier than installing Linux ever used to be :) Now we've got Fedora 18 up and running, and humming along fast enough. I just noticed my VirtualBox settings are only giving this Virtual Machine 764Mb of RAM, so I up'd it to 1GB, and also gave this machine 2 Procs so it'll run a little faster.<br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj67Ltvuu_ZGDuO0lfiq6mvB2029V9iTKNVPgdysGg9E1sOkYXWamOfMjnDKTqLGpOi5eOm0jflVn3LX7LzS681KwjadtpwkWku3viqDD-DUxlLj35CbMbnCguvJMnGKH_vm77bqA/s1600/fedora3.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj67Ltvuu_ZGDuO0lfiq6mvB2029V9iTKNVPgdysGg9E1sOkYXWamOfMjnDKTqLGpOi5eOm0jflVn3LX7LzS681KwjadtpwkWku3viqDD-DUxlLj35CbMbnCguvJMnGKH_vm77bqA/s1600/fedora3.JPG" height="266" width="320" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">We're in!</td></tr> </tbody></table> You'll notice this isn't running at full resolution either, it's not taking up my entire screen. That's pretty annoying, but VirtualBox has a way to fix that. Just google "virtualbox larger resolution" and you'll find lots of pages explaining how to extend the size of the window.<br /> <br /> Now let's install the OLPC Sugar Operating System locally on this machine, so we can have an area to test our development going forwards.<br /> <br /> First we need a terminal window. I was surprised you couldn't right-click on the desktop by default to get a Terminal window, but it is easily found in the "Activities", "System Tools" area.<br /> <br /> <div class="separator" style="clear: both; text-align: center;"> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhepkkTih4p6rgQ5XXRLWtAYn3-Ki_oIE4lKTAAFE4kEy3oi3-HdvnwUYx2RCgDYo1eIF8Y6FfMUgL35KfFSvqBVI1APRGK4WNFgHb9afhOOnEpp723rtZhv8TSnhyphenhyphencML8nQPehkw/s1600/fedora4.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhepkkTih4p6rgQ5XXRLWtAYn3-Ki_oIE4lKTAAFE4kEy3oi3-HdvnwUYx2RCgDYo1eIF8Y6FfMUgL35KfFSvqBVI1APRGK4WNFgHb9afhOOnEpp723rtZhv8TSnhyphenhyphencML8nQPehkw/s1600/fedora4.JPG" height="268" width="320" /></a></div> <br /> Ok now, let's follow the very helpful instructions for getting the package of Sugar from the <a href="http://wiki.sugarlabs.org/go/Fedora_18">Sugar Development site</a>, and install it to our Virtualized Linux machine.<br /> <br /> Now that you've got a terminal open, run the following 3 commands:<br /> 1) su (press enter. This puts you into "root" access mode, allowing you to install software locally) <br /> 2) yum groupinstall sugar-desktop (press enter, then wait for a while while it downloads) Note: I had this freeze on me at action 46/106, and it stopped installing... I had to do a reboot of the virtual machine and just try again....<br /> 3) yum install sugar-emulator<br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-UDrruUk4yKTC97Q1FDlSv_CciU3ch_OyDjs4K0epCU4NqPNKHFBamqiwjfaWc4C-PbBcFY9uy4a03GZvt34ZvWMs4zYdHaDmOj7DmeIMT3qmUP7qCT-NWu5Ebm63Lq81NSMGKQ/s1600/fedora5.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-UDrruUk4yKTC97Q1FDlSv_CciU3ch_OyDjs4K0epCU4NqPNKHFBamqiwjfaWc4C-PbBcFY9uy4a03GZvt34ZvWMs4zYdHaDmOj7DmeIMT3qmUP7qCT-NWu5Ebm63Lq81NSMGKQ/s1600/fedora5.JPG" height="333" width="400" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">Installing...</td></tr> </tbody></table> Ok this stalled on me a few times and was generally unstable. I decided it was probably a bad idea to be running this "Live System" mode on a Virtualized Machine, so I went through with the rest of the installation instructions listed <a href="http://wiki.sugarlabs.org/go/Tutorials/Installation/Install_SoaS_in_VirtualBox-f18">here</a>.<br /> <br /> The installer finished and I had a "real" Fedora install now rather than the sortof temporary "Live System" one, better place to start from. Then I rebooted and things are already looking more reasonable. Things run much faster now.<br /> <br /> I tried again to get VirtualBox to do a higher resolution screen but it was taking a while and I ran out of patience ;) It's harder to get that to work than it should be, but I remember getting it going ages ago for another older project. I'll figure that out and post it another time. (Edit: turns out I just needed to change desktop settings in Fedora itself - duh. Should have checked that first).<br /> <br /> <b>Building Sugar</b><br /> <br /> Then I decided it was probably wiser to just BUILD sugar from scratch rather than to install it, since I am going to ultimately be modifying activities and testing them anyway. There are great instructions for this <a href="http://sugarlabs.org/~buildbot/docs/build.html">here</a>. <br /> <br /> First you need git for code repository access. You can install this with:<br /> <br /> yum install git-core<br /> <br /> Then follow those great instructions on that previous page I linked. This setup is pretty great because all related dependancies are contained within this script and it gets all the related libraries and does an install of everything that is needed. Pretty sweet.<br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjXYn99ozgkB2LlnubkkP75oGnevCDLguQ96jh_BzQar9OxuV6-Z_2XnShVz7yUjs4uht0y6Y9EbqiQgzC1TphARyFhT-IHpmjvlhe_patFRu7fZRei-22Rntqfww8ZGQub2NTvw/s1600/fedora6.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjXYn99ozgkB2LlnubkkP75oGnevCDLguQ96jh_BzQar9OxuV6-Z_2XnShVz7yUjs4uht0y6Y9EbqiQgzC1TphARyFhT-IHpmjvlhe_patFRu7fZRei-22Rntqfww8ZGQub2NTvw/s1600/fedora6.JPG" height="302" width="400" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">Looks to be working much better than my earlier atempt</td></tr> </tbody></table> <br /> Alrighty! Looks like it built perfectly which is awesome. Now I tried to run it... and I got a few errors. Looks like I might have messed something up with my dual monitor setup in VirtualBox, so that might be messing with stuff. I'll try to get that worked out for next time and post the details.<br /> <br /> That was a pretty good hack-a-thon to get this off the ground. Soon I'll get it running and then I can start digging into the code for the Activities themselves. Boom!Mike Jutanhttp://www.blogger.com/profile/13692386796675585659noreply@blogger.com0tag:blogger.com,1999:blog-12401045.post-71662468299415040292012-11-14T02:04:00.000-08:002013-02-01T01:20:27.770-08:00One Laptop Per Child: Here we go!!!!About 3 weeks ago, my old high school friend Jenn showed up in San Francisco for the amazing OLPC summit, and kindly invited me along. I've been keen to contribute to the OLPC (One Laptop Per Child) foundation (<a href="http://one.laptop.org/">http://one.laptop.org</a>) for a good 6 months already since I first was inspired towards their efforts back in March 2012. (See more details here: <a href="http://jutanclan.blogspot.com/2012/10/olpc-san-francisco-weekend.html">http://jutanclan.blogspot.com/2012/10/olpc-san-francisco-weekend.html</a>) Anyhow, what better way to "learn about how to volunteer my time" than to just START DOING IT?! :)<br /> <br /> Right off the bat, the organization and sheer quality of user documentation on the Sugar operating system is top-notch. You can see this is a SUPER pro effort. MIT, Fedora/Redhat involvement, "Sugar on a Stick" OS images along with very clear and surprisingly up-to-date Virtual Machine instructions. This stuff goes out of date all the darn time, and I was blown away to see a website with every installation detail totally up-to-date, old stuff deprecated... WOW. I don't ever see this good a job of deprecating old documentation and keeping the instructions clean for new contributors. Amazing. Well done, folks :)<br /> <br /> So why did I want to do this in the first place?<br /> <br />Well, I've wanted to contribute in some way or another for a while, really since the moment I saw this clip from Ridley Scott's film "Life in a Day". This is one of the most unexpected and beautiful clips of the film. Only 50 seconds long, and it's worth every second:<br /> <iframe allowfullscreen="allowfullscreen" frameborder="0" height="360" src="http://www.youtube.com/embed/JnKhVajQ6rw" width="640"></iframe><br /> <br /> Wow that rocks. If you are also a Computer Scientist interested in Philanthropy and Education, I suspect you'll also hit the ceiling when you see that clip, just like I did. HOW did he get the laptop?! How is the world does he have access to Wikipedia?! How does he charge this laptop when he's living so far from a big city with large infrastructure?! The questions abound. But my one major "to do" I had after watching this clip... <u><b>I NEED TO </b><b>FIND OUT WHO IS DOING THIS, AND I NEED TO HELP.</b></u> :)<br /> <br /> Fast forward to a few weeks ago, and my friend Jenn (who is the Director of OLPC Canada) arrives here in SF for the OLPC summit and I attended and hung out with a bunch of amazing and inspiring people. It was glorious, inspiring, and awesome.<br /> <br /> My CS brain started asking a lot of CS-y questions of the fine volunteers there: what platform is the OS? What are programs written in? What UI capabilities does the XO laptop have? How much hard drive space and RAM is there? What are our audio card and video capture capabilities? Where is data saved in the operating system? How do we write an application (called an "Activity") and how do you distribute those apps to the huge amount of XOs already deployed in developing nations? Everyone kindly answered my bazillion questions and off I went, jazzed up about contributing my skills in Linux Python development, UI interaction and design, and maybe even some Software Engineering leadership. That all would rock.<br /> <br /> Guess what arrived in the mail yesterday?<br /> <br /> <div class="separator" style="clear: both; text-align: center;"> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlu9luKrRgO2EZ2h6HjsHvcPCPfV_qN2c-bi5yQZ_JRm3cIKiBPygH9pYJThLW7PEHsbe9as8BNKYII3szRoJ12jdQUoqJ7DE79-W6IGG9qgYBR2gi_BGv4VPeT1NmHGlW773m6g/s1600/131932_10100380975624817_1125987246_o.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div> My very own XO Laptop!<br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtyZ-lBHHHb1Uzep5r560LFlCre1Bz_3nyGgmil8ic4Rm7lKyDDM8qjXxa7hyMCORhsHSB-8g6OTai8UEBh4Yb6tZLOqzUn_DAX6kPg17s4Vqime_c6NA6juJ-KyJwYOqYpar3tQ/s1600/311406_10100380232998047_1253119812_n.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtyZ-lBHHHb1Uzep5r560LFlCre1Bz_3nyGgmil8ic4Rm7lKyDDM8qjXxa7hyMCORhsHSB-8g6OTai8UEBh4Yb6tZLOqzUn_DAX6kPg17s4Vqime_c6NA6juJ-KyJwYOqYpar3tQ/s1600/311406_10100380232998047_1253119812_n.jpg" height="240" width="320" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">Checking out the video recording capabilities</td></tr> </tbody></table> This makes it a LOT easier to get excited about coding for the laptop now that I have one I can use. It makes it a lot better for testing/QA and also to use the actual camera on the device itself and test it's capabilities, so I know where I can push it and where I need to go with the flow. Good times.<br /> <br /> The laptop arrived yesterday, and even though it was a stupendously busy day, I got home about 11:30pm and just started playing with it for a couple hours. It's a very exciting tool and you can see why kids LOVE it. There are some pre-installed activities on there, and I opened a bunch of them to get a feel for the expected common look-and-feel between apps and interop requirements and general features.<br /> <br /> Tonight I got back from work, had dinner, and have then spent the past 5 hours playing with this awesome thing. My poor brand new iPad 4 is sitting sadly on the table while I enjoy the company of his much lower-cost, philanthropic cousin, the XO Laptop :)<br /> <br /> After learning some more about the apps, I switched the laptop over to Gnome mode so I could explore the filesystem. I wanted to see where files were saved, and also verify some details about the movie files that the "Record" activity saves. (Yep, they are in .ogg format... so Open Source-y!) Switching to root user (and feeling very much like a "hacker"), I was able to peruse the Activity program launch folders themselves, and look at some of the code.<br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaBuaMlU0GEj3fGopHIbCLO5xm2_bTKWengnOvXWnn7SNH4PvRCYqmYA4XYo0YfjBkHX_P-NYQdNJdVCMeCUwNeJLzNFs45Id-Gzudgf3dRgJpbaacTS9SJbh1O3ANz6wcxyNrIA/s1600/177601_10100380950390387_516708597_o.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaBuaMlU0GEj3fGopHIbCLO5xm2_bTKWengnOvXWnn7SNH4PvRCYqmYA4XYo0YfjBkHX_P-NYQdNJdVCMeCUwNeJLzNFs45Id-Gzudgf3dRgJpbaacTS9SJbh1O3ANz6wcxyNrIA/s1600/177601_10100380950390387_516708597_o.jpg" height="240" width="320" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">Gnome mode on the XO Laptop, running a standard Linux shell</td></tr> </tbody></table> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiILQ-nq6zOKn9A7uluRRlQcGxAuIpBdengJ3TTAXT1JQX9i8x0mRgRU2nXBzMMgYdtSvYqqxeOcd0nYAkx9cr_Bit0Jab6kpu3T_bQHo89np7XQnbmPscfoJkqOnRMPm7TDWygEw/s1600/177039_10100380953134887_529174366_o.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiILQ-nq6zOKn9A7uluRRlQcGxAuIpBdengJ3TTAXT1JQX9i8x0mRgRU2nXBzMMgYdtSvYqqxeOcd0nYAkx9cr_Bit0Jab6kpu3T_bQHo89np7XQnbmPscfoJkqOnRMPm7TDWygEw/s1600/177039_10100380953134887_529174366_o.jpg" height="240" width="320" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">Reading through some code for recording video</td></tr> </tbody></table> The professionalism and quality of this effort shines through in every detail. The code is tight and well managed, the apps are generally following the same look-and-feel guidelines, and integration of this "Neighbourhood" sharing idea is throughout the Sugar OS. It is great.<br /> <br /> Particularly amazing is that they chose Python to be the language of choice for writing these applications, and I literally want to high five the person who made that decision. This makes my life about 100,000x easier as a software contributor for this program, and I'm just so psyched they didn't choose something absurd and computer sciencey or some laugauge that is complicated-for-the-sake-of-complicated just to prove some silly Computer Sciencey thing. I know enough CS peeps to know that this is a common issue, and it was a ray of glorious sunshine that they chose to use Python, literally my favourite language. I also believe Python to be one of the languages with the best inherent readability... so adding code to an existing codebase when it's written in Python is going to increase my productivity by like 10x. Good move, OLPC folks :)<br /> <br /> So yes, there is some really powerful stuff here, and it's in Python which is a friggin' dream come true. The video recording is done with some open source libraries and some PyGTK code connected to Python backend. Beautiful. Not sure if there is any support for Qt (that would be awesome), but I can get by fine with GTK if not. I might investigate that though first before I really get my feet wet.<br /> <br /> Then, instead of going to bed at a reasonable time (like I ever do that anyway), I spent some time on the Sugar Labs site ("Sugar" is the Linux distro used by the XO Laptop), reading and learning. There is a really interesting and fun-looking manual there, I think it was 150 pages. So I gotta drop that puppy on my Kindle or my poor neglected new iPad 4 so I can read that as I keep working on this OLPC stuff in the spare time I can scrounge together for it over the next while!<br /> <br /> The website was great and helped me with some setup questions to get a Virtualized version of the Sugar OS running on my Windows machine via Oracle's VirtualBox software. This is excellent, as it'll allow me to use my main computer (and full-sized keyboard and mouse) for development which is a definite necessity, and I'll also be able to swing back to the XO Laptop to test. One other thing that is interesting is there is an idea of "Neighbourhoods" in the XO, and you can "Share" certain activities with other friends, which is awesome. So I want to keep that in mind in case I want people to be able to "Share" the results of the software I end up writing for the XO. I had&nbsp; originally thought an "Upload to Youtube" option might be possible, but watching a few more videos about the remote areas where these laptops are used... it's probably wiser to just stick with their existing model of networked sharing amongst a peer group, rather than attempting to share Internet-wide. That said, it looks like I could probably subprocess off a Google API call to package up a .ogg file and send it off to Youtube as a video upload... that would be pretty awesome if it worked. And who knows, maybe some schools have more active internet and it sure would be cool if OLPC could see some more of the video projects that kids are making around the world.<br /> <div class="separator" style="clear: both; text-align: center;"> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqdqqqNQdC4t-m__3gNUM_RjHvvwsNmQcInbu7Hp3ngMVEB09ql9pOeGoHZsoqXy85JIiE1URl5Xr06TOPbai4AB51aD5ovIwJKmKfnATfisc0PKR2mQX5pHb3Jap57kE5MC3NTA/s1600/52684_10100380976118827_189846030_o.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlu9luKrRgO2EZ2h6HjsHvcPCPfV_qN2c-bi5yQZ_JRm3cIKiBPygH9pYJThLW7PEHsbe9as8BNKYII3szRoJ12jdQUoqJ7DE79-W6IGG9qgYBR2gi_BGv4VPeT1NmHGlW773m6g/s1600/131932_10100380975624817_1125987246_o.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlu9luKrRgO2EZ2h6HjsHvcPCPfV_qN2c-bi5yQZ_JRm3cIKiBPygH9pYJThLW7PEHsbe9as8BNKYII3szRoJ12jdQUoqJ7DE79-W6IGG9qgYBR2gi_BGv4VPeT1NmHGlW773m6g/s1600/131932_10100380975624817_1125987246_o.jpg" height="240" width="320" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">XO network and my Windows machine running Sugar and logging into the same network</td></tr> </tbody></table> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqdqqqNQdC4t-m__3gNUM_RjHvvwsNmQcInbu7Hp3ngMVEB09ql9pOeGoHZsoqXy85JIiE1URl5Xr06TOPbai4AB51aD5ovIwJKmKfnATfisc0PKR2mQX5pHb3Jap57kE5MC3NTA/s1600/52684_10100380976118827_189846030_o.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqdqqqNQdC4t-m__3gNUM_RjHvvwsNmQcInbu7Hp3ngMVEB09ql9pOeGoHZsoqXy85JIiE1URl5Xr06TOPbai4AB51aD5ovIwJKmKfnATfisc0PKR2mQX5pHb3Jap57kE5MC3NTA/s1600/52684_10100380976118827_189846030_o.jpg" height="240" width="320" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">Chatting between my Virtualized Sugar OS and my XO Laptop!!</td></tr> </tbody></table> This rocks. I'll be sure to post more stuff as I continue to investigate the capabilities of the XO, learn more about the Sugar OS, and ultimately write some code for this laptop that I hope to one day get deployed far and wide around the world. So psyched to be jumping into this. I really believe in the cause, and it's so awesome that I have skills I can contribute.Mike Jutanhttp://www.blogger.com/profile/13692386796675585659noreply@blogger.com4tag:blogger.com,1999:blog-12401045.post-33405551952230021622012-10-26T01:34:00.001-07:002013-02-01T01:20:55.295-08:00OLPC San Francisco weekendI had the pleasure of attending a couple of OLPC events in San Francisco this weekend with the OLPC San Francisco chapter.<br /> <br /> My friend Jenn from wayyyy back in high school is now working with OLPC in Canada and she let me know about the yearly summit here in SF... what an awesome circumstance.<br /> <br /> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody> <tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2qKUY_rRdx3-u40AhuF0KT6M6NPKY5UQWiW4YsaEZys06vgREWv2zP6bQHio9QoxNZZS3eo5VCbNSNLLXNWLPLiZXP-IzXXcWvAjQoYZ1qWZAQyeljvJ3qfvDmtV8M9r5qLW7Bg/s1600/398277_10151100715586645_1806291119_n.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2qKUY_rRdx3-u40AhuF0KT6M6NPKY5UQWiW4YsaEZys06vgREWv2zP6bQHio9QoxNZZS3eo5VCbNSNLLXNWLPLiZXP-IzXXcWvAjQoYZ1qWZAQyeljvJ3qfvDmtV8M9r5qLW7Bg/s1600/398277_10151100715586645_1806291119_n.jpg" width="320" /></a></td></tr> <tr><td class="tr-caption" style="text-align: center;">High school reunion after 13 years! (Also, Jenn -- you are tall and/or I am short)</td></tr> </tbody></table> Since seeing this absolutely adorable and very moving <a href="http://www.youtube.com/watch?v=JnKhVajQ6rw">clip of Abel</a>, a young Peruvian boy, talking about his OLPC Laptop in Ridley Scott's Life in a Day film, <a href="http://jutanclan.blogspot.com/2012/04/one-laptop-per-child.html">I knew I wanted to learn more</a> about OLPC and get involved in some way or another. When I was in Peru, deep in the Amazon near Iquitos, I met some kids who lived in a very remote area and <a href="http://jutanclan.blogspot.com/2012/09/perubrazilargentina-day-15-amazonian.html">my thoughts danced back to the OLPC program</a>. It's really amazing and I want to help with their noble (and kick ass) efforts.<br /> <br /> Finding time is always hard these days with so many things on the go, but this seems an incredible and very much worthwhile adventure to embark upon. I'm sure I can donate some of my time for some software architecture or design knowledge, but I'm hoping to be able to carve out a larger amount of my time to code a new "Activity" (aka "App") for their Sugar Linux distro (the operating system that runs on the XO laptops, which are deployed to many many developing nations around the world).<br /> <br /> I spent some of Friday and again on Sunday chatting with a lot of people involved in OLPC around the world: the guy who writes huge portions of the OS, a guy who is from Chad and was educated in Montreal, Canada... and who is now moving back to Chad to roll out the laptops to 3 schools, the first ever deployment in Chad. I met many dedicated people who live in Kenya, have been to Haiti, live in Nicaragua... all for the noble and awesome aim of sharing technology to the developing world and with that, the power of knowledge. This TOTALLY ROCKS.<br /> <br /> So I was definitely blown away by the dedication and excitement of everyone there... that was to be expected. :) But I also wanted to know, more pragmatically, what kind of effect I can personally have from a Software development point-of-view. I asked a lot of technical questions about the operating system, how new applications are distributed to all the deployed laptops in these far-away places, how the laptops are powered, what file format the camera records video in... etc. As it turns out, this is a great setup (to be expected, MIT started this!) - the OS is a Linux distro called Sugar and the Apps are called "Activities" and are built with Python (OMG YES) and GTK (not too shabby!). I have some GTK experience, much more in Qt at this point, but GTK is fine. But I literally program in Python EVERY SINGLE DAY. So this is pretty amazing. The file formats are all open-source as you might suspect - Ogg Vorbis for the video/audio formats. So if I want to do something in the video/animation/editing/film software space, it'll prob need some Ogg Vorbis support. Next step is to get an XO laptop (someone is going to send me one) and to start fiddling. I need to see what kind of Dev tools we have on there, and also what kind of Open Source streaming/playback libraries are already available, so I can work from there. Kick ass.<br /> <br /> I've had an item on my personal todo list since the day I saw that OLPC clip in April: "Look into contributing software to OLPC". It was fortuitous to have a personal connection to the organization, and definitely this weekend threw me right into the fast lane re: learning about what they do and how I might personally make the best impact right now given their specific software needs. Seems amazing. Now I gotta get this laptop, start fiddling, and then come up with a development plan. I gotta keep the scope of this reasonable for my intensely packed schedule, but maybe I can find a way to get a team of developers to help me with this... that would rock. Anyhoo. This is pretty amazing, and I gotta find a way to fit this in.Mike Jutanhttp://www.blogger.com/profile/13692386796675585659noreply@blogger.com1