Export Stills from Adobe Premiere Pro using JavaScript

April 13, 2017 | JavaScript, Utilities, Video | 0 Comments

Most of the products in the Adobe Creative Cloud suite of applications have a scripting API that allows you to write JavaScript to automate tasks like moving layers around, adding patterns, or exporting images (e.g., Background repeats with Illustrator).

However, while Illustrator, Photoshop, After Effects, and other apps have a menu option to run a script, Adobe Premiere Pro doesn’t have this. Instead requires that you use their C++ SDK or package Javascript code into Panel and that must be signed before it can be distributed and used (Preimere DevNet, ProPanel example on Github). There are several marketplaces for these panels, but I just needed to do something quick – export still and timecodes from markers – and the panels available didn’t use the format we needed.

The good news is that you can use JavaScript in Adobe Premiere just by opening up the ExtendScript app and running it from there. It’s a little tricky to write these because the documentation is hard to find (the method activeSequence.exportFrameJPEG was not in the documentation and I had to guess it from the exportFrameJPEG used in the github example.

Here’s the current script:

Optimizing CSS with Base64 Embedded Images (with Bonus Utility!)

January 26, 2010 | HTML/CSS, Utilities | 11 Comments


As I design a new site (current site | early demo of new site), I am working through what combination of technologies (CDN, sprites, caching, gzipping, etc.) we want to use to optimize it. One tool I’m looking at is embedding images in CSS with base64 strings. Instead of the browser needing to make several calls, one for the CSS file and then one for each image, base64 embedding means that all of the images are embedded within the CSS file itself.

It’s great for small images or images that only show up on :hover or mouseover and you don’t want there to be any delay in the image appearing. Here’s what it looks like:

Normal CSS

.myclass {
width: 45px;
background: transparent url(myimage.jpg) top left no-repeat;

CSS with Base64 Embedded Image

.myclass {
width: 45px;
background: transparent url(data:image/png;base64,LONG-STRING-OF-BASE64-TEXT) top left no-repeat;

Problems with Base64

  1. Works in all browsers except IE6 and IE7. Solution: use a conditional comments to give IE6/7 a stylesheet that still references the images.
  2. Base64 is bigger than real images: In my tests a base64 encoded string image is somewhere around 150% the size of a regular image. This means it’s unusable for large images.
  3. Hard to manage: If you change the image, you’ll need to reembed the base64 string. You also have to maitain a separate IE stylesheet.

How to manage it

To help figure out which images were worth embedded and help

manage it, I developed a small utility that analyzes a CSS file and allows you to select which images you want to embed. You can also preselect them by adding a comment somewhere within your CSS declaration that says /*embed*/

What It Does

  • Finds all image URLs in your CSS file (note: no CSS3 multiples or borders)
  • Shows the size difference between the image and the base64 string
  • Shows the final size output size and the GZipped size for comparison to the original
  • Removes comments and whitespace if you want
  • Creates a new base64 stylesheet and a IE6/7 stylesheet with references to the original image


iTunesU Manager App Source Released

February 20, 2009 | Utilities | 1 comment

A while back, I created an iTunesU Manager application for DTS's iTunesU site, and I finally got around to putting up the source code and executables. Below is a screenshot of the app and links to the Google code repository. The app requires .NET 2.0 (it's written in C#) and an iTunesU administrative account.

iTunesU Manager

Hi, I'm John Dyer. In my day job, I build websites and create online seminary software for a seminary in Dallas. I also like to release open source tools including a pretty popular HTML5 video player and build tools that help people find best bible commentaries and do bible study. And just for fun, I also wrote a book on the theology of technology and media.

Fork me on GitHub

Social Widgets powered by AB-WebLog.com.