Use ffmpeg to encode a 3GP video to more portable formats

The BlackBerry records videos in 3GPP format (.3GP extension), which isn't the most portable format. If you send a .3GP video to someone, the odds aren't great they'll be able to play it. Xvid, with an encoding example below, isn't most portable either, but VLC will play it on all platforms, recent versions of Windows Media Player support it, and QuickTime on OS X will play it with the Perian components installed.

Get FFmpeg

FFmpeg is a fantastic cross-platform audio/video encoding solution. In fact it's so good that many commercial applications like to use it without paying license fees to the appropriate patent holders.

Download Windows ffmpeg binaries from http://ffmpeg.arrozcru.org/autobuilds/

On some Linux distros, like Ubuntu, you'll likely need the -unstripped builds.

There aren't many binary releases of ffmpeg for OS X, but the Audacity Project has a build from July, 2009 available. You can also compile it yourself, or use MacPorts.

Conversions

When quality is not a concern – and with such a low quality source, it isn't – you let ffmpeg use it's default settings without issue. Codec names will vary based on the age/version of your ffmpeg build. Run ffmpeg -codecs to see all the available codecs. If you want to keep the video bitrate the same, pass the -sameq parameter to ffmpeg.

Convert .3GP to Xvid

libxvid may just be xvid, and libmp3lame may be called mp3 instead.

ffmpeg -i MOVIE.3GP -f avi -vcodec libxvid -acodec libmp3lame MOVIE.AVI

A 4.3 MB .3GP file was encoded to a 783 KB .avi, 82% reduction in size.

Convert .3GP to MPEG1

ffmpeg -i MOVIE.3GP MOVIE.MPG

A 4.3 MB .3GP file was encoded to a 910 KB .mpg, 79% reduction in size.

Convert .3GP to standard MPEG4

ffmpeg -i MOVIE.3GP MOVIE.MP4

A 4.3 MB .3GP file was encoded to an 825 KB .mp4, 81% reduction in size.

Convert .3GP to standard Windows Media 7

ffmpeg -i MOVIE.3GP -vcodec wmv2 -acodec wmav2 MOVIE.WMV

A 4.3 MB .3GP file was encoded to an 885 KB .wmv, 80% reduction in size.

Macmillan shot first – ebooks should cost more

Amazon was completely wrong, and obviously disregarded the effort that publishers like Macmillan put into producing high-quality ebooks. It's apparent that the publishers truly are looking out for consumers, and being truthful about the high costs of producing quality electronic copies of books.

Blood Ties - Hardcover

Blood Ties - ebook

The Butcher's Boy - Hardcover

The Butcher's Boy - ebook

The Fellowship of the Ring - Hardcover

The Fellowship of the Ring - ebook

The Long Fall - Hardcover

The Long Fall - ebook

Kindle vs iPad – Quick Thoughts

I just said to Tracy "I'm going to read my book" and picked up my Kindle.

I don't think I'd ever say that about an iPad – even if the reading experience was superior – because an iPad will always be a computer first; everything else is secondary. The Kindle was designed to replace books, not let you read books, watch movies, listen to music, browse the web and play games.

If you're building a single-purpose device there shouldn't be any compromises with the design, and the overall experience while using it for its sole task should always be more enjoyable than with a multipurpose competitor.

I don't want my Kindle to do more, I just want it to be better at what it already does.

AppleScript to generate a SecurID token and automatically connect to a Cisco VPN

Apple obviously hates copy and paste. They didn't add it to the iPhone for years, and even when they did add it, they only briefly allowed users to paste into the VPN password field, removing it with one of the first incremental updates to OS 3.0. Luckily there's an app for that – CopyPasteFix, only for jailbroken iPhones.

And then came Snow Leopard, OS X 10.6. They included built-in IPSEC VPN, freeing users from the shackles of the horrible Cisco IPSEC client. But yet again, Apple decided that users don't need to copy and paste text into the password field.

For anyone with a OTP soft token (like a RSA SecurID), this is a pain in the ass. Half the benefits of generating a passcode on the same device that you're using it on, are not having to type it.

Enter AppleScript, everyone's favorite natural language that thinks it's acceptable to use apostrophes when referencing variables. I've never actually written an AppleScript longer than tell application "iTunes" to playpause so this was new ground for me. Joe mentioned he has a similar script for junky non-RSA soft token solution he uses, but he left the country immediately after taunting me with the prospect of getting the code.

If you're doing any moderately serious AppleScript development, I highly recommend Script Debugger from Late Night Software. It was invaluable to seeing what objects and properties were really available, and troubleshooting errors.

What it does

  • Prompts for your SecurID PIN (you can save this in the script, I highly recommend you NOT do that)
  • Launches the SecurID application (it if it's running it will quit it first), generates a token, stores the token in a variable, and then quits the SecurID application
  • Kicks off the VPN connection process, types in the generated passcode when the window is available, and logs in.

If there's any type of a banner with terms to accept, it won't click OK there.

Download the script, view the source code and read more at the project page.


© 2007-2010, Corey Gilmore | Posts RSS Feed | Comments RSS Feed | Contact

 

The views expressed on these pages are mine alone and not those of any past or present employer. All information presented on this site was obtained lawfully and not through disclosure under the terms of an NDA.