Atlanta Ruby User Group Presentation/Code Walkthrough

April 11th, 2008 tkadom Posted in Presentations and screencasts, Rails |

I gave a presentation and code walkthrough on uploading/transcoding, and storing video on s3 for subsequent http streaming back to a client to the atlanta ruby user group last night.  After the presentation, several people thought the material was worth turning into a screencast, so I decided to eat my own dog food, and uploaded and transcoded my own screencast on… well uploading and transcoding my own screencast…

Although the uploaded video shown in the end looks a bit choppy, this is not at all the case with the transcoded result (as everyone saw when the demo was live), but rather is an artifact of the low frame rate used to capture the screencast (to save space).

It was certainly fun doing the presentation, and I can attest that Sam is right.  Outside of the pizza, networking, and information, the presentation portion is definitely fun as well.  Although I would have to say the beer after the meeting was also a highlight, even if the waitress didn’t know her newcastle from her guiness.

I will post the screencast here for a brief time for all the folks who requested it…

 

UPDATE: I moved the video over to blip.tv so I am no longer eating all the bandwidth off my s3 account.  The quality suffered a little, but its still very clear.  Don’t let the awful preview below fool you :)

Presentation:

 

 

You can find the project files here

installation instructions for activemq are here

Installation instructions for activemessaging are here

 

UPDATE 2008:  I updated this project to bring it up to date with more recent plugins/tech.  The new source using paperclip, spawn, AASM, rvideo, and ffmpeg can be found at git://github.com/tkadom/video-transcoder.git

I will probably update the screencast to go over the changes as well in the next few days.

17 Responses to “Atlanta Ruby User Group Presentation/Code Walkthrough”

  1. Very nicely done. It takes a fair amount of guts and a lots of skill to build a project on the fly, describe the interaction between you and amazon in 15 minutes in front of the ruby user group. Wow. This is kind of like hashrocket.com. Don’t blink or you will miss something.

    Great demonstration. Thanks for the slides. It certainly helps piece together the parts.

    Look forward to more presentations,

    David

  2. Thanks a lot for creating this screencast! I’m working on a project right now that can really use some of these methods.

    Would you mind packing up some of the code samples for reference without tracking back and forth through the video? I’m pretty new to working with rails and while I’ll research all what you’ve shown here further (parts about uploading files etc.) it would be nice to be able to look a bit more at the (very little) :-) code you showed here.

    Thanks,
    Chris

  3. I thought there was so little code (all of it shown in the presentation) that it wouldn’t be necessary, but I have created a zip of the project files and uploaded them for the typing impaired… :) (see the link at the end of the post)

    If you are in the Atlanta area, come to the ATL-RUG ruby code meetup this weekend since I will be going over the presentation with some of the members who had further questions.

  4. That was great, thanks.

  5. BrianTheCoder Says:

    Why crate a full class and not a to_payload method?

  6. Good suggestion Brian. I was thinking of serializing the payload as its own object, but i could just have a special to_payload method on video which serializes only the attributes i want. I guess the way I did it is how my brain works. In retrospect, maybe when i redo this screencast down the road to reduce the number of lines a bit more, ill add your suggestion :) I think using paperclip will axe most of the stuff out of the video model…

  7. I downloaded the zip with the project files and ran the example app you included. The conversion doesn’t seem to work for me. I have all the gems and dependencies installed, and I can convert files manually (and through a mongrel), but when doing it in the app with activemessenger it never converts. I commented out the S3 call to test this out.

    However, when booting mongrel to load the app, I do get these messages:

    ActiveMessaging: adapter reliable_msg not loaded: no such file to load — reliable-msg
    ActiveMessaging: adapter wmq not loaded: no such file to load — wmq/wmq
    ActiveMessaging: Loading /Users/Orlando/RoR/atlrug/app/processors/application.rb
    ActiveMessaging: Loading /Users/Orlando/RoR/atlrug/app/processors/transcode_processor.rb

    Could these errors have something to do with the first 2 messages? Do you know of a fix for that? Googling doesn’t seem to turn much up.

  8. Sorry Jonah,

    I didn’t see this question when you first posted it. I don’t think your issue is with the first two messages. Do you see anything else in the logs? i am planning on redoing this screencast with rails 2.1 and backgroundrb to simplify the content even further.

    Tim

  9. Thanks for the great tutorial, extremely helpful. I still have a problem though…
    I have everything fine in my local dev copy transcode and upload works fine, but on my live site the process stops after the video is converted. I have no idea what the problem might be and I can’t seem to trace any output. I’m running “script/poller run” on my production copy, but I only get the ffmpeg output. If I try ‘puts’ or adding logger.info messages, nothing appears.

    Do you have any idea how I can track down what might be going wrong? I’m pulling my hair out!

    thanks again.

  10. actually, ignore that last comment! I realised that I had to run script/poller with RAILS_ENV=production to get things working properly on my live app.

    Now it’s all working a treat.

  11. call me a noob but I can’t run poller. In my terminal I write:

    script/poller run

    but everytime it says: Connect Failes: Connection Refused…

    how do I fix this. Never used poller before and I’m not sure if I have to do more to set this up. I am running on a macbook pro using 10.5

    Thanks for the great screencast!

  12. So I figured out that my problem most likely has to do with the fact that I do not have activemq installed on my computer…now I guess I need to figure out how to do that…

  13. just checking, but when are you going to have the new screencast using rvideo, paperclip, and s3 without ActiveMessaging. I saw your comment on Jim Neath’s blog and I was hoping you’d have the new tutorial? I’m really trying to figure this out myself but I know you know how to do it and I (as well as many) could really use your help.

    Please let me know, Thanks!

  14. I updated the demo for rails 2.2.2 and spawn. I will probably need to redo the screencast as well, and I have not yet decided if I would keep spawn or move to something like ap4r, or workling. At any rate, you can git clone the repo and try the spawn version if you are having trouble with the activemq one. The spawn version should be much simpler to get going.

    (BTW, spawn will not work with thin. It should work with both passenger and mongrel)

  15. test

  16. Every time i come here I am not dissapointed, nice post

  17. Great screencast and great demo app.
    I tried to install your last application version (github), it´s rise an exception:
    spawn requires config.active_record.allow_concurrency=true when used with :method=>:thread
    I looked for in spaw documantation and says:
    When using the :thread setting, spawn will check to make sure that you have set
    allow_concurrency=true in your configuration. If you want this setting then
    put this line in one of your environment config files:

    config.active_record.allow_concurrency = true

    Next Itried to put this code in environment.rb, and this don´t works already.

    My Rails version is 2.2.2.

    May you help me?

    Thanks.

Leave a Reply