Skip to content

Commit

Permalink
Merge pull request #956 from scientist-softserv/i852-sack-the-hack
Browse files Browse the repository at this point in the history
i852 Revert temporary hacks that prevent video processing
  • Loading branch information
bkiahstroud authored Feb 14, 2024
2 parents 5b6c954 + 307236a commit 2dacedf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,11 @@ def video_display_content(_url, label = '')
height = solr_document.height&.try(:to_i) || 240
duration = conformed_duration_in_seconds
IIIFManifest::V3::DisplayContent.new(
# Hyrax::IiifAv::Engine.routes.url_helpers.iiif_av_content_url(
# solr_document.id,
# label: label,
# host: request.base_url
# ),
# TODO: This is a hack to pull the download url from hyrax as the video resource.
# Ultimately we want to fix the processing times of the video derivatives so it doesn't take
# hours to days to complete. The draw back of doing it this way is that we're using the original
# video file which is fine if it's already processed, but if it's a raw, then it is not ideal for
# streaming purposes. The good thing is that PALs seem to be processing the video derivatives out
# of band first before ingesting so we shouldn't run into this issue.
Hyrax::Engine.routes.url_helpers.download_url(solr_document.id, host: request.base_url, protocol: 'https'),
Hyrax::IiifAv::Engine.routes.url_helpers.iiif_av_content_url(
solr_document.id,
label: label,
host: request.base_url
),
label: label,
width: width,
height: height,
Expand Down
15 changes: 5 additions & 10 deletions config/initializers/file_set_derivatives_overrides.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,12 @@ def create_video_derivatives(filename)
original_size = "#{width}x#{height}"
size = width.nil? || height.nil? ? DEFAULT_VIDEO_SIZE : original_size
Hydra::Derivatives::Processors::Video::Processor.config.size_attributes = size
# HACK: Commented out the non-thumbnail derivative generation as they are clogging the ecosystem.
# See https://github.com/scientist-softserv/palni-palci/issues/924
# rubocop:disable Style/TrailingCommaInHashLiteral
Hydra::Derivatives::VideoDerivatives.create(filename,
outputs: [{ label: :thumbnail, format: 'jpg',
url: derivative_url('thumbnail') },
# { label: 'webm', format: 'webm',
# url: derivative_url('webm') },
# { label: 'mp4', format: 'mp4',
# url: derivative_url('mp4') }
])
# rubocop:enable Style/TrailingCommaInHashLiteral
{ label: 'webm', format: 'webm',
url: derivative_url('webm') },
{ label: 'mp4', format: 'mp4',
url: derivative_url('mp4') }])
end
end
end

0 comments on commit 2dacedf

Please sign in to comment.