Hi! Thanks for visiting my blog. If you've received any value from my content would you mind supporting my new startup by downloading our browser add-on? It's called PriceBlink and makes online shopping a breeze. You can watch it in action here and download it for Chrome, Firefox, IE, or Safari by going to PriceBlink.com. Thank you and I hope you enjoy!

Using FFmpeg to Extract PNG Files

Nov 30

I’ve been playing with FFmpeg over the last year to encode video files for Flash. I’ve mainly experimented with my golf swing and created a little app to compare each frame of my swing to a pro’s. This helps me identify all my many flaws and easily visualize what I’m doing wrong. I’ll post more on the video encoding process later, but wanted to focus on extracting frames from video files.

I’m still struggling with all the many parameters FFmpeg has to offer. Right now there are easily over 100 and using them in the right combination can be tricky. I recently figured out how to pull the first frame from a video file, resize it, and save it to PNG. Not too exciting but I’m really hoping to get JPG extraction working with the ability to extract a frame at any point in time. I know FFmpeg supports it….just need to find out the right combo to make it work. The problem with PNG is that filesizes can get rather large for photos. Take the following photo for example:

this size comes out to about 186kB at 320×240. The command to make this magic happen is:

ffmpeg -i swing.avi -vcodec png -vframes 1 -an -f rawvideo -s 320×240 swing1.png

I won’t go into detail about the parameters listed above and if you want more details then click here. Needless to say, if this were a JPG file we’d be looking at less than 30kB at 80% compression, which would look just as good. Overall I’ve been highly impressed with FFmpeg and what it does for video encoding, especially FLV. I’ll post more on my video ventures in the future.

Read More

Get Your Blog On

Nov 27

I probably spend about 5 hours a week reading blogs and about the same writing. I’d love to spend more writing, but my time has been pretty limited with work and a few projects. At any rate, I found the link below highly interesting and I wish someone could run the same type of numbers for the amount of time we spend on spam!!!

http://www.dallasnews.com/sharedcontent/dws/bus/stories/DN-p2insidebizBlog_27bus.ART.State.Edition1.232ffddf.html

Pretty insane, huh?!?

Read More

Lovin’ HTML Email

Nov 27

Everyone has their opinion on this one so here’s mine. I love HTML email when I’m not dealing with spam or someone spoofing that they’re ebay or PayPal and trying to grab my account information. Then there’s always the people who write malicious scripts hoping that I’ll open the email and let them run. These are very serious threats for those who aren’t sure how to protect themselves.

I get HTML emails all the time from Barnes & Noble, eBags, Audible, Macromedia, Sun, etc. To me, seeing a well designed newsletter or product update is worth its weight in gold. These are like nice ads in a magazine that grab my attention and make me click through to learn more. I’ll take this any day over a plain text email given the sender knows what they’re doing. There are several instances where companies abuse the use of HTML and embed crazy objects and animations directly in the email….this is overkill.

The last point I’d like to make is that support for HTML email has grown tremendously over the last 10 years. This past weekend I designed an HTML newsletter for PolkaDachs and was astounded to find out that all of the major email providers (Gmail, Hotmail, and Yahoo Mail) support it. Most of the major email clients support it as well and it’s just a matter of whether the user has it enabled or not. It’s always good practice to put a link at the top of the email that directs them to an on-line version of the email. Needless to say we’ve come a long way from the early days of the web.

Read More

Job Thankfulness

Nov 26

I’m definitely thankful and blessed with great family, friends, co-workers, and colleagues. But this isn’t about them….today I’m extremely thankful for my job and the fact that I don’t have this one.

Read More

validates_uniqueness_of

Nov 20

I’ve spent a lot of time lately transitioning from ColdFusion to Ruby on Rails. I love CF, but I’ve been looking for a change of pace and RoR provides numerous features that make it extremely attractive. One of the reasons I started using CF was the fact that everything was simple and tag based. You could quickly crank out applications with minimal amounts of code. RoR has gone leaps and bounds towards minimizing the amount of code you have to write. I won’t go into details as there are numerous articles on the web about rails scaffolding.

A perfect example of minimal code is a task that I used to perform often in CF. I would check to see that a record exists in the database and then alert the user of its existence. This would be useful when making sure that a book title or username is unique. If you’ve done this in CF you’ve probably done the following:

[cfquery name="check"]
select count(*) as total from users where username=’#form.username#’;
[/cfquery]

[cfif check.total gt 0]
tell the user the username already exists
[/cfif]

In RoR this is as simple as placing the following statement in your model:

validates_uniqueness_of :username

and that’s it! RoR has some pretty incredible validation routines and also note that it’s more of a natural language syntax than CF. It will be interesting to see if any of the tag/scripting languages will inherit any of what RoR brings to the table.

Read More