Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require 'open3' | ||
|
||
module Hydra::Derivatives | ||
class CapabilityService | ||
attr_accessor :ffmpeg_output | ||
def capture_output | ||
@ffmpeg_output = Open3.capture3('ffmpeg -codecs').to_s | ||
end | ||
|
||
def fdk_aac? | ||
@ffmpeg_output.include?('--enable-libfdk-aac') || @ffmpeg_output.include?('--with-fdk-aac') | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require 'spec_helper' | ||
|
||
describe Hydra::Derivatives::CapabilityService do | ||
before do | ||
@aac_capability = described_class.new | ||
end | ||
describe 'fdk_aac?' do | ||
it 'tells you if fdk_aac encoder is installed' do | ||
@aac_capability.ffmpeg_output = 'ffmpeg version 2.2.2 Copyright (c) 2000-2014 the FFmpeg developers | ||
built on May 14 2014 11:52:48 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) | ||
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.2.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libvorbis --enable-libvpx --enable-libfdk-aac' | ||
expect(@aac_capability.fdk_aac?).to eq(true) | ||
end | ||
it 'tells you if fdk_aac encoder is not installed' do | ||
@aac_capability.ffmpeg_output = "ffmpeg version 3.1.7 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 6.3.1 (GCC) 20161221 (Red Hat 6.3.1-1) configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcdio --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --extra-cflags=-I/usr/include/nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enabl e-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect" | ||
expect(@aac_capability.fdk_aac?).to eq(false) | ||
end | ||
end | ||
end |