Monthly Archives: April 2011

AmazonSES API 0.1.5


I finally had a few minutes tonight to finish up the modifications for version 0.1.5.

Improvements for this version:
* Now defaults to a persisted application-scoped component
* No hard error on demo if AwsCredentials.properties is not correctly configured
* Each new request initiates a new connection to the email service
* The setEndPoint function is now called every time the mail service is initiated (if it is not the default address)
* You can now set message headers for outgoing emails

I was hesitant to make this an application-scoped component because I was trying to make this as light-weight as possible.  I did try to make sure it was backwards-compatible with the previous versions so if you did decide that you did not want to create an instance in the application scope, it still works just fine when created in the variables scope.  If you wanted to set any headers or change the end point from the default though you will need to edit the init method and override the default values with the values you would like to use.

Enjoy.

https://github.com/robertz/AmazonSES

Advertisements

Using ffmpeg to encode video with webm


A good friend asked me the other day whether or not ffmpeg supported the new webm (Google VP8) video format.   As it turns out, ffmpeg 0.6 and above does support encoding VP8 video (the actual video codec) and Ogg Theora Vorbis audio (the audio codec) and packaging the two together in a webm container that can be used to embed video for HTML 5 browsers.

Going back to my previous ffmpeg example where I took a bunch of images and stitched them into video in mpeg-4 format I will throw together a quick example where we create a video in webm format.

The command line parameters I am using with ffmpeg:
\ffmpeg\bin\ffmpeg -r 10 -b 1800 -i img%04d.jpg -f webm test1800.webm

So following the previous example, I already have a folder with all my images, etc.  The difference between the two command lines is the new -f webm option I included.  This will tell ffmpeg to force the format to webm on the encoded file.  You can see the results of the output here:

http://dl.dropbox.com/u/868773/test1800.webm

This is not a very serious example, but it should give you a little to go off of.  Also note, encoding for webm takes longer than say, mpeg4.

AmazonSES API updated


Tonight I completed writing the majority of the remaining methods for the AmazonSES API.  I added the ability to set your AWS end point if you are not using the defaut.  You can also get your send quota for the day and delete a previously verified email address.

There are a few methods that I did not implement.  The getSendStatistics method did not make it in just yet but I do plan on getting that added.  I would also like to add in getCachedResponseMetaData as well because the debugging information it provides may be useful.  On the other hand, sendRawEmail will not be added and the shutDown method is not needed.

If you are interested, here are the javadocs for the Amazon simple email service.

There were also a few changes to some of the existing methods.  I renamed the sendMail method to sendEmail to match with the javadocs.  You can also now pass in a CSV string for the recipient, CC and BCC fields.  In version 0.1.0 you could only pass it one recipient and the CC and BCC fields were not functional and this has all been corrected.  Most other changes were around error checking and exception handling.