bpholt's picture

Transcoding mkv HEVC to mp4 HVC1 for iTunes

In case anyone ever needs to transcode a Matroska h.265 video file to a format supported by an Apple TV, this is how I do it with ffmpeg.

ffmpeg \
    -i {input}.mkv \
    -vcodec copy \
    -acodec ac3 \
    -tag:v hvc1 \   

QuickTime requires an HVC1 container as opposed to the default HEVC, so use -tag:v hvc1 with ffmpeg.

AppleTV / iTunes don't support DTS-HD, but ffmpeg can transcode DTS-HD to AC3, so set the audio codec to ac3 with -acodec ac3.

bpholt's picture

Partial Application of Type Parameters in Scala

Scala doesn’t directly support partial application of type parameters, which can be frustrating when several are required but only a portion can be inferred by the compiler. For example, this implicit class wraps a request object from the Amazon Java SDK and defines a method that accepts an asynchronous function that should be used to execute the request. (This provides a more fluent Scala API than using the Java SDK directly.)

Since the effect type F is not bound anywhere else, it cannot be inferred. I would like to provide just the type of F and let the compiler infer Req and Res. Unfortunately, since Scala doesn’t support partial application of type parameters, the caller has to explicitly provide all three types.

There is a workaround. One can wrap the function in a class paramterized by the unknown types, define an apply() method on the class that is parameterized by the inferrable types, and provide a function returning a new instance of the class. (The details are more fully explained in this blog post by Tony Morris.)

Read the full details in the full post.

bpholt's picture

Matrix Builds with Automatic sbt-release

Following up on yesterday’s post, I ended up modifying the build process for the scala-aws-utils project. The two problems described in the “Caveats / Room for Improvement” section bothered me.

Protected branches help prevent accidental pushes to master, a backstop I didn’t want to lose. The switch from Java 7 to Java 8 for the Scala 2.10 and 2.11 artifacts wouldn’t have impacted our use of the library, but why unnecessarily restrict who can use those artifacts?

bpholt's picture

Automated Releases using sbt-release and Travis CI

At Dwolla, we have several Scala-based open source projects, each of which needs to be automatically tested and built. We have these projects set up to build using Travis CI, which the build results reporting back to GitHub for branches and pull requests. Merges to master are built and artifacts pushed to Bintray automatically as well.

We hadn’t automated the release process, though. Pull requests were responsible for updating the version information correctly, which could be tedious and somewhat error-prone. Concurrent pull requests needed to resolve versioning conflicts. Local development usually proceeds using a ‑SNAPSHOT version, so Ivy knows to overwrite any artifacts being created, but that means I have to remember to change the version in the project’s build definition before committing my changes.

Several Scala-based open source projects use the sbt-release to manage their release process. The plugin ensures no snapshot dependencies are being used, moves the project from a ‑SNAPSHOT version to a release version, commits and tags the version change, and builds and publishes artifacts. In the end, two commits are created (the release version and the next snapshot version).

bpholt's picture

Scala, Docker, and our open-sourced SBT tools and libraries

At Dwolla, the platform team dedicates lots of time to writing tooling, making our teams’ lives easier. What’s particularly exciting is when those tools have wider application beyond the walls of Dwolla. Since our team spends lots of time with Scala microservices deployed using Docker, we’ve written several SBT plugins and helper libraries. These plugins help us manage our services, both in production and locally during development.

All of the projects described below have been released on GitHub using the MIT License—pull requests are welcome! Each project contains a Bintray badge in its README, linked to where its artifacts have been published in one of Dwolla’s Bintray repositories.

bpholt's picture

PlanetHolt’s Git Workflow

For some time now I’ve been using Git to manage the files that make up Prior to switching to git, I was using Mercurial (hg), mainly because we use that at work and as a result I am significantly more familiar with its syntax and general workflow. Because uses git to manage its repositories, I decided to switch to make it easier to pull in updates. I am by no means a git expert, but things are coming along. I thought it might be useful to document my workflow.

bpholt's picture

Cloud on a Desktop

I’ve been experimenting with virtualization technologies a lot lately, and after a conversation with my friend Ken, I decided that it might be a good idea to lay out some explicit goals.

  1. More closely simulate our deployed production environment locally to increase quality by avoiding the old “Works on My Machine” excuse
  2. Improve productivity through automated provisioning, so developers can get their environment set up more quickly
  3. Enable and encourage infrastruction innovation amongst our development teams
  4. Start understanding cloud / elastic scaling techniques, and to prove their useful application in our context

While these goals are all interrelated to a degree, in my mind the first two and last two form natural pairs. While everyone agrees we’d avoid problems by using the same software locally that we do in production, if doing so is painful no one will use it except to debug problems when they arise. Innovation is tough in a space that isn’t well understood.

So far I’ve used VMWare Player and CentOS with Kickstarter to create base images and a local repository containing the software we’re using. I need to spend more time disseminating knowledge, though, because not many of my teammates are aware of my efforts. I think this would start to address the first goal but I’m not sure it’s easy enough for regular use.

On a different track, I’ve also managed to get OpenStack Essex set up on a workstation in our area. Hopefully by next week I’ll be able to demonstrate running our application in my little private cloud. PuppetLabs is hosting a webinar this afternoon that I hope proves useful as well, because I’ve found Puppet to be an extremely useful tool and I hope to understand how it fits into an elastic world.

I am excited about OpenStack in particular. It’s not clear to me yet whether it’s ready for prime time, so to speak, but playing with it so far reminds me of using Linux back in the 1.x kernel days. Huge promise, frustrating at times, fun to play with and to see what one can build.

bpholt's picture

302 Redirect Handling in IE and Firefox

An apparent defect in how IE handled our OAuth consent flow at work turned out to be an interesting difference in how Firefox and IE (Firefox 6 and IE8, in this case) handle content loaded via a 302 HTTP response.

After one of our UI developers beautified our OAuth consent page (where the user authorizes a client application to use data on his or her behalf), one of our testers pointed out that the overall flow stopped working in Internet Explorer. It still worked in Firefox, though, and she told us that if she permanently authorized the client in Firefox, the flow still worked in Internet Explorer.

We allow OAuth clients to provide an image that will be displayed when we ask users for consent. However, it’s not required, and so occasionally on the consent page the IMG tag would have an empty SRC attribute: <img src="" alt="client Logo"/>.

screen capture of OAuth consent page with broken image

bpholt's picture

Free iPhone Ringtones

I ordered the new iPhone 3GS shortly after its announcement earlier this month, as I’ve wanted one for some time. I was mainly waiting for a 32GB version, which provides enough room for a reasonable (Your definition of reasonable may vary.) number of songs and videos. After anxiously awaiting its delivery, a slight mishap on delivery day, and eventual successful delivery, I excitedly unwrapped my new toy, activated it, and started transferring my media library.

Eventually I started looking for a new ringtone. The included choices are decent, including a good “old fashioned” ringer, but I wanted something more flashy—and I certainly was not going to pay $0.99 for something that would only play for up to forty seconds at a time. Luckily, iPhones ringtones are just short AAC clips, and are therefore easily created from the songs already in your music library. This article will share how to do it yourself.

bpholt's picture

Introduction to jQuery

While I’m far from an expert on the subject, I’ve had the opportunity to introduce jQuery to some of my fellow developers here in India. I thought I'd share the presentations in the hopes that someone else might find them useful as well.

Syndicate content