Skip to content

Using avalon bundle with Amazon Elastic Transcoder

Phil Dinh edited this page Feb 15, 2019 · 5 revisions

Prerequisites

  • Have AWS credentials setup
  • Have aws-sdk gem installed: bundle install --with aws
  • Create active_encode required resources
  • Create CloudFront Web endpoint
  • Make derivatives bucket readable by CloudFront
  • Set CORS on bucket

Configuration

In config/hyrax.rb:

Hyrax::ActiveEncode::WatchedEncode.engine_adapter = :elastic_transcoder
Hyrax::ActiveEncode::ActiveEncodeDerivativeService.default_options_service_class = ElasticTranscoderOptionService
Hyrax::ActiveEncode::ActiveEncodeDerivativeService.default_encode_class = Hyrax::ActiveEncode::WatchedEncode
Hyrax::ActiveEncode::ActiveEncodeDerivativeService.default_local_streaming = false # So that hyrax-active_encode doesn't try to move it
Hyrax::IiifAv.config.iiif_av_url_builder = lambda do |file_location_uri, _base_url|
  path = file_location_uri.sub(/s3:\/\/[\w-]+\//, '')
  "#{Settings.streaming.base_url}#{path}"
end

In config/settings.yml:

aws:
  pipeline_id: example-id
  masterfile_bucket: example-bucket-name
streaming:
  base_url: https://example.cloudfront.net/
Clone this wiki locally