Quickly Transcoding Video on OS X

I still have an old digital camera that records video in MPEG format (pretty inefficient), 10 seconds of video takes up 11 megabytes of disk space. Not something that you want to send to a friend via email (I know, I’m not on Vine, but who cares?)

I needed a way to quickly convert this video to a more efficient format and OS X has one built in: avconvert. It’s a command line tool, and it’s pretty easy to use.

Here’s what the command line help says about it:

$ avconvert --help
avconvert -p  -s  -o  []

avconvert is a command line application that will transcode a source or group of 
sources to create a destination file output based on a specified preset and with 
a collection of specified settings modifications.

The following flags are required by avconvert:
	-p 
	-s 
	-o 

avconvert will do the best it can to meet all the settings that are specified. 
It will prioritize the settings and the settings actually used in the export 
will be shown and those that could not match the specification settings clearly
noted.

So all you have to do is open a Terminal, change to the directory where your video is stored, and run something like:

$ avconvert -p PresetAppleM4ViPod -s video.mpg -o video.mov
Audio Settings:
	Audio Channel Count = 1
	Audio Channel Layout = Mono
	Audio Converter Quality = 127
	Audio Data Rate = 96000
	Audio Data Rate Control Mode = 2
	Audio Duration = {1001160/90000 = 11.124}
	Audio Format = aac 
	Audio Sample Rate = 32000
	Audio Stream Basic Description =  1 ch,  32000 Hz, 'aac ' (0x00000000) 0 bits/channel, 0 bytes/packet, 1024 frames/packet, 0 bytes/frame

Video Settings:
	Frame Reordering = NO
	Image Height = 480
	Image Width = 640
	Track Height = 480
	Track Width = 640
	Video Average Data Rate = 1500
	Video Codec = avc1
	Video Codec Profile Level = H264_Baseline_3_0
	Video Codec Usage Mode = 6
	Video Color Depth = 24
	Video Color Primaries = SMPTE_C
	Video Duration = {999000/90000 = 11.100}
	Video Frame Rate = 0
	Video Key Frame Frequency = 30
	Video Maximum Frame Rate = 30
	Video Scaling Mode = CropSourceToCleanAperture
	Video Transfer Function = ITU_R_709_2
	Video YCbCr Matrix = ITU_R_601_4

=========================================
avconvert completed with error:0.

When the command finishes, your video is transcoded.

There are a number of different presets that you can use to set the size and quality of the video transcoding, which should be mostly self explanatory:

$ avconvert --listPresets
Presets available for use with avconvert:
     PresetAppleM4VCellular
     PresetAppleM4ViPod
     PresetAppleM4VWiFi
     PresetAppleM4VAppleTV
     PresetAppleM4V480pSD
     PresetAppleM4V720pHD
     PresetAppleM4V1080pHD
     PresetAppleM4A
     Preset640x480
     Preset1280x720
     Preset1920x1080
     PresetAppleProRes422LPCM

The actual bitrate and resolution settings for some of these presets are not clear to me, and I’m not sure where Apple has documented them, if at all. (Seems like there’s a Japanese guy who figured it out, though!)

Atlassian JIRA and Limited User Accounts on Windows 7

I’m doing a bit of mucking around with Atlassian JIRA on a local system, using a 30-day trial license. One thing I noticed on Windows systems is that the general assumption that you’re running as an Administrator all of the time is still being followed. It’s kind of a pain.

For instance, when you go about installing the Atlassian Plugin SDK, it will set all of the necessary environment variables on the installing user’s account only, but the installer requires you to elevate privileges via the User Account Control before it runs. It even attempts to install the files in the Administrator user’s home folder, meaning no one else would even be able to get close to these files.

I created a neutral folder under C:\Atlassian and installed there instead.

Here are the environment variables it sets on the Administrator account only, which you need to add to your usual Limited User Account, so that the rest of their command-line examples will work properly:

ATLAS_HOME
C:\Atlassian\atlassian-plugin-sdk

JAVA_HOME
C:/Program Files/Java/jdk1.7.0_51

M2_REPO
C:\Users\Admin\.m2\repository

Path (spelled oddly, it should be PATH, but cmd.exe doesn't seem to mind)
%JAVA_HOME%\bin;C:\Atlassian\atlassian-plugin-sdk\bin

The M2_REPO environment variable is pretty important because it defines where all your Maven dependencies will be cached.

Once the environment variables are set via the Control Panel, running atlas-version should work fine:

C:\Users\Limited>atlas-version

ATLAS Version:    4.2.20
ATLAS Home:       C:\Atlassian\atlassian-plugin-sdk
ATLAS Scripts:    C:\Atlassian\atlassian-plugin-sdk\bin
ATLAS Maven Home: C:\Atlassian\atlassian-plugin-sdk\apache-maven
--------
Executing: "C:\Atlassian\atlassian-plugin-sdk\apache-maven\bin\mvn.bat" --version -gs C:\Atlassian\atlassian-plugin-sdk\apache-maven/conf/settings.xml

Apache Maven 2.1.0 (r755702; 2009-03-18 20:10:27+0100)
Java version: 1.7.0_51
Java home: C:\Program Files\Java\jdk1.7.0_51\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows"

Sadly, it’s not a typo, a four year-old version of Maven is really being used here.

This Day In Ridiculousness

It’s 2014, and eBay doesn’t have 2-factor authentication. I just changed my password, though, and their password reset page just offered to send a new password to a burner phone I haven’t used since I last visited the United States. Oh wait, and when I go searching for a way to change that number… I can’t find one in eBay’s own settings pages.

Way to make us feel safe, and good to know that PayPal is under the same roof.