diff --git a/.travis.yml b/.travis.yml index eae9f8ef..9c8717aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,14 +18,29 @@ env: - AVTRANSCODER_BUILD_PATH=${TRAVIS_BUILD_DIR}/build-avtranscoder - AVTRANSCODER_INSTALL=install-avtranscoder - AVTRANSCODER_INSTALL_PATH=${TRAVIS_BUILD_DIR}/${AVTRANSCODER_INSTALL} + - DEPENDENCY_INSTALL=install-dependency - DEPENDENCY_INSTALL_PATH=${TRAVIS_BUILD_DIR}/${DEPENDENCY_INSTALL} + + - DEPENDENCY_LOG_FILE=${TRAVIS_BUILD_DIR}/build-dependencies-log.txt + + - YASM_VERSION=1.3.0 + - LAME_VERSION=3.99.5 + - FAAC_VERSION=1.28 + - XVID_VERSION=1.3.3 + - FDKAAC_VERSION=0.1.3 + - OGG_VERSION=1.3.2 + - VORBIS_VERSION=1.3.4 + - VPX_VERSION=1.4.0 matrix: - DEPENDENCY_NAME=libav DEPENDENCY_VERSION=11.3 ENABLE_COVERAGE=true - DEPENDENCY_NAME=libav DEPENDENCY_VERSION=11.3 ENABLE_COVERAGE=false - DEPENDENCY_NAME=ffmpeg DEPENDENCY_VERSION=2.4.2 ENABLE_COVERAGE=true - DEPENDENCY_NAME=ffmpeg DEPENDENCY_VERSION=2.4.2 ENABLE_COVERAGE=false - DEPENDENCY_NAME=ffmpeg DEPENDENCY_VERSION=2.5.7 ENABLE_COVERAGE=false + - DEPENDENCY_NAME=ffmpeg DEPENDENCY_VERSION=2.6.8 ENABLE_COVERAGE=false + - DEPENDENCY_NAME=ffmpeg DEPENDENCY_VERSION=2.7.6 ENABLE_COVERAGE=false + - DEPENDENCY_NAME=ffmpeg DEPENDENCY_VERSION=2.8.6 ENABLE_COVERAGE=false matrix: exclude: @@ -39,6 +54,12 @@ matrix: env: DEPENDENCY_NAME=libav DEPENDENCY_VERSION=11.3 ENABLE_COVERAGE=true - os: osx env: DEPENDENCY_NAME=ffmpeg DEPENDENCY_VERSION=2.4.2 ENABLE_COVERAGE=true + allow_failures: + # build with libav + - env: DEPENDENCY_NAME=libav DEPENDENCY_VERSION=11.3 ENABLE_COVERAGE=true + - env: DEPENDENCY_NAME=libav DEPENDENCY_VERSION=11.3 ENABLE_COVERAGE=false + # build with ffmpeg-2.8.6 + - env: DEPENDENCY_NAME=ffmpeg DEPENDENCY_VERSION=2.8.6 ENABLE_COVERAGE=false fast_finish: true # This results in a 2×2×2x2 build matrix. @@ -83,12 +104,16 @@ script: - ./tools/travis/build.sh # launch tests - - if [ ${TRAVIS_OS_NAME} = "linux" ] && [ ${DEPENDENCY_NAME} = "ffmpeg" ]; then ./tools/travis/python.nosetests.sh; fi + - if [ ${TRAVIS_OS_NAME} = "linux" ]; then ./tools/travis/python.nosetests.sh; fi after_success: # generate coverage for coveralls - if [ ${ENABLE_COVERAGE} ]; then ./tools/travis/gcc.generate.coverage.sh; fi +after_failure: + - cat ${AVTRANSCODER_BUILD_PATH}/CMakeFiles/CMakeOutput.log + - cat ${DEPENDENCY_LOG_FILE} + before_deploy: # copy libbz2, external dependency of libavformat - if [ ${TRAVIS_OS_NAME} = "linux" ]; then cp /lib/x86_64-linux-gnu/{libbz2.so.1,libbz2.so.1.0,libbz2.so.1.0.4} ${DEPENDENCY_INSTALL_PATH}/lib; fi diff --git a/INSTALL.md b/INSTALL.md index acb110e8..855fe534 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -4,8 +4,8 @@ AvTranscoder uses CMake as build system. #### Dependencies AvTranscoder can depend on ffmpeg, libav, or any fork of these projects that follow the same API. -* Recommended ffmpeg versions: 2.4.2, 2.4.5, 2.5.7 -* Recommended libav versions: 11.3 +* Tested ffmpeg versions: 2.4.2, 2.4.5, 2.5.7, 2.6.8, 2.7.6 +* Recommended libav versions: none #### To build ``` diff --git a/README.md b/README.md index bc78abbf..9f364fdd 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # avTranscoder -C++ API for Libav / FFmpeg +C++ API for FFmpeg / Libav -Based on Libav/FFmpeg libraries to support various video and audio formats, avTranscoder provides the high level API to re-wrap or transcode media easily. +Based on FFmpeg/Libav libraries to support various video and audio formats, avTranscoder provides the high level API to re-wrap or transcode media easily. [![Build Status](https://travis-ci.org/avTranscoder/avTranscoder.svg?branch=develop)](https://travis-ci.org/avTranscoder/avTranscoder) [![Build status](https://ci.appveyor.com/api/projects/status/6urf0otyhtj8xuny?svg=true)](https://ci.appveyor.com/project/cchampet/avtranscoder) @@ -13,6 +13,8 @@ Based on Libav/FFmpeg libraries to support various video and audio formats, avTr [![Stories in Progress](https://badge.waffle.io/avTranscoder/avTranscoder.svg?label=2 - Working&title=In Progress)](http://waffle.io/avTranscoder/avTranscoder) Click on the badge above to have a big picture view of what's in progress and how you can help. +:warning: The latest avTranscoder API does not fit with libav. + #### What you need to know * C++ library * Java and Python bindings generated with SWIG diff --git a/appveyor.yml b/appveyor.yml index 14eb8413..fed23628 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,6 +7,8 @@ platform: environment: FFMPEG_VERSION: 2.4.5 + DEPENDENCY_INSTALL_PATH: C:\ProgramData\ffmpeg-2.4.5 + AVTRANSCODER_INSTALL_PATH: C:\projects\avtranscoder\build\install matrix: fast_finish: true @@ -33,23 +35,24 @@ on_failure: - type "C:\ProgramData\chocolatey\logs\chocolatey.log" - type "C:\projects\avtranscoder\build\CMakeFiles\CMakeOutput.log" -#on_success: -# - create archives - -#artifacts: -# - path: C:\ProgramData\ffmpeg-2.2.11 -# name: ffmpeg -# type: zip - -# - path: C:\projects\avtranscoder\build -# name: avtranscoder -# type: zip - -#deploy: -# - provider: GitHub -# artifact: ffmpeg,avtranscoder -# auth_token: -# secure: -# on: -# branch: master -# appveyor_repo_tag: true +on_success: + - 7z a ffmpeg.zip %DEPENDENCY_INSTALL_PATH% + - 7z a avtranscoder.zip %AVTRANSCODER_INSTALL_PATH% + +artifacts: + - path: ffmpeg.zip + name: ffmpeg + type: zip + + - path: avtranscoder.zip + name: avtranscoder + type: zip + +deploy: + - provider: GitHub + artifact: ffmpeg,avtranscoder + auth_token: + secure: sApasbQe2i7Uu+XNhlkXg+F6zI0VNHUjhq5QfK6/+NSs4lX/9BwhkLvibQc6bmMv + on: + branch: master + appveyor_repo_tag: true diff --git a/src/AvTranscoder/codec/AudioCodec.hpp b/src/AvTranscoder/codec/AudioCodec.hpp index 9b380171..eea6d290 100644 --- a/src/AvTranscoder/codec/AudioCodec.hpp +++ b/src/AvTranscoder/codec/AudioCodec.hpp @@ -20,4 +20,4 @@ class AvExport AudioCodec : public ICodec }; } -#endif \ No newline at end of file +#endif diff --git a/src/AvTranscoder/codec/DataCodec.hpp b/src/AvTranscoder/codec/DataCodec.hpp index 3e1c6494..819163a2 100644 --- a/src/AvTranscoder/codec/DataCodec.hpp +++ b/src/AvTranscoder/codec/DataCodec.hpp @@ -15,4 +15,4 @@ class AvExport DataCodec : public ICodec }; } -#endif \ No newline at end of file +#endif diff --git a/src/AvTranscoder/codec/VideoCodec.hpp b/src/AvTranscoder/codec/VideoCodec.hpp index aec23e43..642db5fe 100644 --- a/src/AvTranscoder/codec/VideoCodec.hpp +++ b/src/AvTranscoder/codec/VideoCodec.hpp @@ -20,4 +20,4 @@ class AvExport VideoCodec : public ICodec }; } -#endif \ No newline at end of file +#endif diff --git a/src/AvTranscoder/decoder/AudioGenerator.hpp b/src/AvTranscoder/decoder/AudioGenerator.hpp index 16b6e16e..5c5631ad 100644 --- a/src/AvTranscoder/decoder/AudioGenerator.hpp +++ b/src/AvTranscoder/decoder/AudioGenerator.hpp @@ -27,4 +27,4 @@ class AvExport AudioGenerator : public IDecoder }; } -#endif \ No newline at end of file +#endif diff --git a/src/AvTranscoder/encoder/AudioEncoder.hpp b/src/AvTranscoder/encoder/AudioEncoder.hpp index 50f3246d..149fb8f6 100644 --- a/src/AvTranscoder/encoder/AudioEncoder.hpp +++ b/src/AvTranscoder/encoder/AudioEncoder.hpp @@ -29,4 +29,4 @@ class AvExport AudioEncoder : public IEncoder }; } -#endif \ No newline at end of file +#endif diff --git a/src/AvTranscoder/encoder/IEncoder.hpp b/src/AvTranscoder/encoder/IEncoder.hpp index 55e8d3fa..1ba57a74 100644 --- a/src/AvTranscoder/encoder/IEncoder.hpp +++ b/src/AvTranscoder/encoder/IEncoder.hpp @@ -44,4 +44,4 @@ class AvExport IEncoder }; } -#endif \ No newline at end of file +#endif diff --git a/src/AvTranscoder/encoder/VideoEncoder.cpp b/src/AvTranscoder/encoder/VideoEncoder.cpp index 8c7f14e8..dc6e2973 100644 --- a/src/AvTranscoder/encoder/VideoEncoder.cpp +++ b/src/AvTranscoder/encoder/VideoEncoder.cpp @@ -170,4 +170,4 @@ bool VideoEncoder::encodeFrame(CodedData& codedFrame) return ret == 0; #endif } -} \ No newline at end of file +} diff --git a/src/AvTranscoder/encoder/VideoEncoder.hpp b/src/AvTranscoder/encoder/VideoEncoder.hpp index 6f8a910d..05d513ce 100644 --- a/src/AvTranscoder/encoder/VideoEncoder.hpp +++ b/src/AvTranscoder/encoder/VideoEncoder.hpp @@ -29,4 +29,4 @@ class AvExport VideoEncoder : public IEncoder }; } -#endif \ No newline at end of file +#endif diff --git a/src/AvTranscoder/file/InputFile.cpp b/src/AvTranscoder/file/InputFile.cpp index 433a7baa..6d880b2b 100644 --- a/src/AvTranscoder/file/InputFile.cpp +++ b/src/AvTranscoder/file/InputFile.cpp @@ -250,4 +250,4 @@ std::ostream& operator<<(std::ostream& flux, const InputFile& input) return flux; } -} \ No newline at end of file +} diff --git a/src/AvTranscoder/progress/IProgress.hpp b/src/AvTranscoder/progress/IProgress.hpp index 653e0a12..08cce7aa 100644 --- a/src/AvTranscoder/progress/IProgress.hpp +++ b/src/AvTranscoder/progress/IProgress.hpp @@ -35,4 +35,4 @@ class AvExport IProgress }; } -#endif \ No newline at end of file +#endif diff --git a/src/AvTranscoder/progress/NoDisplayProgress.hpp b/src/AvTranscoder/progress/NoDisplayProgress.hpp index ee66333f..2dbcd5f6 100644 --- a/src/AvTranscoder/progress/NoDisplayProgress.hpp +++ b/src/AvTranscoder/progress/NoDisplayProgress.hpp @@ -18,4 +18,4 @@ class AvExport NoDisplayProgress : public IProgress }; } -#endif \ No newline at end of file +#endif diff --git a/src/AvTranscoder/stream/IInputStream.hpp b/src/AvTranscoder/stream/IInputStream.hpp index f1752e2c..07ad1d1a 100644 --- a/src/AvTranscoder/stream/IInputStream.hpp +++ b/src/AvTranscoder/stream/IInputStream.hpp @@ -59,4 +59,4 @@ class AvExport IInputStream }; } -#endif \ No newline at end of file +#endif diff --git a/src/AvTranscoder/stream/IOutputStream.hpp b/src/AvTranscoder/stream/IOutputStream.hpp index 3bf279ee..3c7393c9 100644 --- a/src/AvTranscoder/stream/IOutputStream.hpp +++ b/src/AvTranscoder/stream/IOutputStream.hpp @@ -44,4 +44,4 @@ class AvExport IOutputStream }; } -#endif \ No newline at end of file +#endif diff --git a/src/AvTranscoder/stream/InputStream.hpp b/src/AvTranscoder/stream/InputStream.hpp index 7603789e..6b7f1778 100644 --- a/src/AvTranscoder/stream/InputStream.hpp +++ b/src/AvTranscoder/stream/InputStream.hpp @@ -47,4 +47,4 @@ class AvExport InputStream : public IInputStream }; } -#endif \ No newline at end of file +#endif diff --git a/test/pyTest/testOutputFile.py b/test/pyTest/testOutputFile.py index 6edfaf27..2a5dddb8 100644 --- a/test/pyTest/testOutputFile.py +++ b/test/pyTest/testOutputFile.py @@ -14,7 +14,6 @@ def testCreateOutputFileWithExtension(): assert_equals( ouputFile.getFilename(), outputFileName ) assert_equals( ouputFile.getFormatName(), formatName ) - assert_equals( ouputFile.getFormatLongName(), formatLongName ) @raises(IOError) @@ -38,7 +37,6 @@ def testCreateOutputFileWithoutExtensionWithFormat(): assert_equals( ouputFile.getFilename(), outputFileName ) assert_equals( ouputFile.getFormatName(), formatName ) - assert_equals( ouputFile.getFormatLongName(), formatLongName ) def testCreateOutputFileWithoutExtensionWithMimeType(): @@ -68,5 +66,4 @@ def testCreateOutputFileWithoutExtensionWithInconsistentFormatAndMimeType(): assert_equals( ouputFile.getFilename(), outputFileName ) assert_equals( ouputFile.getFormatName(), formatName ) - assert_equals( ouputFile.getFormatLongName(), formatLongName ) diff --git a/test/pyTest/testSetFrame.py b/test/pyTest/testSetFrame.py index 513167d5..b0807d03 100644 --- a/test/pyTest/testSetFrame.py +++ b/test/pyTest/testSetFrame.py @@ -49,7 +49,6 @@ def testSetVideoFrame(): dst_videoStream = dst_properties.getVideoProperties()[0] assert_equals( "mpeg2video", dst_videoStream.getCodecName() ) - assert_equals( "MPEG-2 video", dst_videoStream.getCodecLongName() ) assert_equals( 1920, dst_videoStream.getWidth() ) assert_equals( 1080, dst_videoStream.getHeight() ) assert_equals( 16, dst_videoStream.getDar().num ) @@ -102,7 +101,6 @@ def testSetAudioFrame(): dst_audioStream = dst_properties.getAudioProperties()[0] assert_equals( "pcm_s24le", dst_audioStream.getCodecName() ) - assert_equals( "PCM signed 24-bit little-endian", dst_audioStream.getCodecLongName() ) assert_equals( "s32", dst_audioStream.getSampleFormatName() ) assert_equals( "signed 32 bits", dst_audioStream.getSampleFormatLongName() ) assert_equals( 48000, dst_audioStream.getSampleRate() ) diff --git a/test/pyTest/testTranscoderRewrap.py b/test/pyTest/testTranscoderRewrap.py index 62833957..1e4b64e1 100644 --- a/test/pyTest/testTranscoderRewrap.py +++ b/test/pyTest/testTranscoderRewrap.py @@ -20,7 +20,6 @@ def checkFormat(src_properties, dst_properties): Check the values of the given format headers. """ assert_equals( src_properties.getFormatName(), dst_properties.getFormatName() ) - assert_equals( src_properties.getFormatLongName(), dst_properties.getFormatLongName() ) assert_equals( src_properties.getStartTime(), dst_properties.getStartTime() ) assert_equals( src_properties.getDuration(), dst_properties.getDuration() ) assert_greater_equal( src_properties.getBitRate(), dst_properties.getBitRate() ) diff --git a/test/pyTest/testTranscoderTranscodeAudioMov.py b/test/pyTest/testTranscoderTranscodeAudioMov.py index be578819..114466fc 100644 --- a/test/pyTest/testTranscoderTranscodeAudioMov.py +++ b/test/pyTest/testTranscoderTranscodeAudioMov.py @@ -47,7 +47,6 @@ def testTranscodeMovVariableNbSamplesPerFrame(): dst_audioStream = dst_properties.getAudioProperties()[0] assert_equals( "pcm_s24le", dst_audioStream.getCodecName() ) - assert_equals( "PCM signed 24-bit little-endian", dst_audioStream.getCodecLongName() ) def testTranscodeMovExtractChannels(): diff --git a/test/pyTest/testTranscoderTranscodeAudioWave.py b/test/pyTest/testTranscoderTranscodeAudioWave.py index 46b80499..9aceeb30 100644 --- a/test/pyTest/testTranscoderTranscodeAudioWave.py +++ b/test/pyTest/testTranscoderTranscodeAudioWave.py @@ -38,7 +38,6 @@ def testTranscodeWave24b48k5_1(): dst_audioStream = dst_properties.getAudioProperties()[0] assert_equals( "pcm_s24le", dst_audioStream.getCodecName() ) - assert_equals( "PCM signed 24-bit little-endian", dst_audioStream.getCodecLongName() ) assert_equals( "s32", dst_audioStream.getSampleFormatName() ) assert_equals( "signed 32 bits", dst_audioStream.getSampleFormatLongName() ) assert_equals( 48000, dst_audioStream.getSampleRate() ) @@ -72,7 +71,6 @@ def testTranscodeWave24b48kstereo(): dst_audioStream = dst_properties.getAudioProperties()[0] assert_equals( "pcm_s24le", dst_audioStream.getCodecName() ) - assert_equals( "PCM signed 24-bit little-endian", dst_audioStream.getCodecLongName() ) assert_equals( "s32", dst_audioStream.getSampleFormatName() ) assert_equals( "signed 32 bits", dst_audioStream.getSampleFormatLongName() ) assert_equals( 48000, dst_audioStream.getSampleRate() ) @@ -106,7 +104,6 @@ def testTranscodeWave24b48kmono(): dst_audioStream = dst_properties.getAudioProperties()[0] assert_equals( "pcm_s24le", dst_audioStream.getCodecName() ) - assert_equals( "PCM signed 24-bit little-endian", dst_audioStream.getCodecLongName() ) assert_equals( "s32", dst_audioStream.getSampleFormatName() ) assert_equals( "signed 32 bits", dst_audioStream.getSampleFormatLongName() ) assert_equals( 48000, dst_audioStream.getSampleRate() ) @@ -140,7 +137,6 @@ def testTranscodeWave16b48kmono(): dst_audioStream = dst_properties.getAudioProperties()[0] assert_equals( "pcm_s16le", dst_audioStream.getCodecName() ) - assert_equals( "PCM signed 16-bit little-endian", dst_audioStream.getCodecLongName() ) assert_equals( "s16", dst_audioStream.getSampleFormatName() ) assert_equals( "signed 16 bits", dst_audioStream.getSampleFormatLongName() ) assert_equals( 48000, dst_audioStream.getSampleRate() ) diff --git a/test/pyTest/testTranscoderTranscodeVideo.py b/test/pyTest/testTranscoderTranscodeVideo.py index 9b77dc59..9bdcfb63 100644 --- a/test/pyTest/testTranscoderTranscodeVideo.py +++ b/test/pyTest/testTranscoderTranscodeVideo.py @@ -39,7 +39,6 @@ def testTranscodeDnxhd120(): dst_videoStream = dst_properties.getVideoProperties()[0] assert_equals( "dnxhd", dst_videoStream.getCodecName() ) - assert_equals( "VC3/DNxHD", dst_videoStream.getCodecLongName() ) expectedBitRate = 120000000 deltaBitRate = expectedBitRate * 0.05 assert_almost_equals( expectedBitRate, dst_videoStream.getBitRate(), delta=deltaBitRate ) @@ -75,7 +74,6 @@ def testTranscodeDnxhd185(): dst_videoStream = dst_properties.getVideoProperties()[0] assert_equals( "dnxhd", dst_videoStream.getCodecName() ) - assert_equals( "VC3/DNxHD", dst_videoStream.getCodecLongName() ) expectedBitRate = 185000000 deltaBitRate = expectedBitRate * 0.05 assert_almost_equals( expectedBitRate, dst_videoStream.getBitRate(), delta=deltaBitRate ) @@ -111,7 +109,6 @@ def testTranscodeDnxhd185x(): dst_videoStream = dst_properties.getVideoProperties()[0] assert_equals( "dnxhd", dst_videoStream.getCodecName() ) - assert_equals( "VC3/DNxHD", dst_videoStream.getCodecLongName() ) expectedBitRate = 185000000 deltaBitRate = expectedBitRate * 0.05 assert_almost_equals( expectedBitRate, dst_videoStream.getBitRate(), delta=deltaBitRate ) diff --git a/tools/appveyor/build.bat b/tools/appveyor/build.bat index de875805..e71e0850 100755 --- a/tools/appveyor/build.bat +++ b/tools/appveyor/build.bat @@ -4,7 +4,7 @@ MKDIR build cd build :: Configure -call cmake.exe .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%CD% -DCMAKE_PREFIX_PATH=C:\ProgramData\ffmpeg-%FFMPEG_VERSION% -DAVTRANSCODER_PYTHON_VERSION_OF_BINDING=2.7 +call cmake.exe .. -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%%AVTRANSCODER_INSTALL_PATH%% -DCMAKE_PREFIX_PATH=%DEPENDENCY_INSTALL_PATH% -DAVTRANSCODER_PYTHON_VERSION_OF_BINDING=2.7 :: Build & Install call nmake /F Makefile diff --git a/tools/appveyor/python.nosetests.bat b/tools/appveyor/python.nosetests.bat index ac5ad016..d9904512 100755 --- a/tools/appveyor/python.nosetests.bat +++ b/tools/appveyor/python.nosetests.bat @@ -3,11 +3,11 @@ set PWD=C:\projects\avtranscoder :: Get avtranscoder library -set PYTHONPATH=%PWD%\build\lib\python2.7\site-packages;%PYTHONPATH% -set PATH=C:\ProgramData\ffmpeg-%FFMPEG_VERSION%\bin;%PWD%\build\lib;%PATH% +set PYTHONPATH=%AVTRANSCODER_INSTALL_PATH%\lib\python2.7\site-packages;%PYTHONPATH% +set PATH=%DEPENDENCY_INSTALL_PATH%\bin;%AVTRANSCODER_INSTALL_PATH%\lib;%PATH% :: Get avtranscoder profiles -set AVPROFILES=%PWD%\build\share\avprofiles +set AVPROFILES=%AVTRANSCODER_INSTALL_PATH%\share\avprofiles :: Get assets git clone https://github.com/avTranscoder/avTranscoder-data.git diff --git a/tools/travis/build.sh b/tools/travis/build.sh index a3fd015d..336c66f7 100755 --- a/tools/travis/build.sh +++ b/tools/travis/build.sh @@ -1,5 +1,7 @@ #!/bin/bash +# Exit immediately if a command exits with a non-zero status +set -e # Print commands and their arguments as they are executed. set -x diff --git a/tools/travis/linux.install.deps.sh b/tools/travis/linux.install.deps.sh index d2ba5c0d..88e327ad 100755 --- a/tools/travis/linux.install.deps.sh +++ b/tools/travis/linux.install.deps.sh @@ -1,24 +1,186 @@ #!/bin/bash +# Exit immediately if a command exits with a non-zero status +set -e # Print commands and their arguments as they are executed. set -x -if [ ! -d "${DEPENDENCY_INSTALL_PATH}/lib/" ]; then +# Use TRAVIS_JOB_ID to detect that we are in travis. +# In that case, use a simple check to detect if the cache is already there. +if [ -z ${TRAVIS_JOB_ID} ] || [ ! -d "${DEPENDENCY_INSTALL_PATH}/lib/" ]; then + + export LD_LIBRARY_PATH=${DEPENDENCY_INSTALL_PATH}/lib:${DEPENDENCY_INSTALL_PATH}/lib64 + export PKG_CONFIG_PATH=${DEPENDENCY_INSTALL_PATH}/lib/pkgconfig:${DEPENDENCY_INSTALL_PATH}/lib64/pkgconfig + export PATH=$PATH:${DEPENDENCY_INSTALL_PATH}/bin + + # yasm + echo "Building YASM (${YASM_VERSION})" + DIR=$(mktemp -d yasmXXX) && cd ${DIR} && \ + curl -Os http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \ + tar xzf yasm-${YASM_VERSION}.tar.gz && \ + cd yasm-${YASM_VERSION} && \ + ./configure --prefix="$DEPENDENCY_INSTALL_PATH" --bindir="${DEPENDENCY_INSTALL_PATH}/bin" && \ + make -k > ${DEPENDENCY_LOG_FILE} 2>&1 && \ + make install && \ + rm -rf ${DIR} + + # x264 + echo "" + echo "Building x264 (last version)" + DIR=$(mktemp -d x264XXX) && cd ${DIR} && \ + git clone --depth 1 git://git.videolan.org/x264 && \ + cd x264 && \ + ./configure --prefix="$DEPENDENCY_INSTALL_PATH" --bindir="${DEPENDENCY_INSTALL_PATH}/bin" --enable-shared --disable-asm && \ + make -k > ${DEPENDENCY_LOG_FILE} 2>&1 && \ + make install && \ + rm -rf ${DIR} + + # libmp3lame + echo "" + echo "Building libmp3lame (${LAME_VERSION})" + DIR=$(mktemp -d libmp3lameXXX) && cd ${DIR} && \ + curl -L -Os http://downloads.sourceforge.net/project/lame/lame/${LAME_VERSION%.*}/lame-${LAME_VERSION}.tar.gz && \ + tar xzf lame-${LAME_VERSION}.tar.gz && \ + cd lame-${LAME_VERSION} && \ + ./configure --prefix="${DEPENDENCY_INSTALL_PATH}" --bindir="${DEPENDENCY_INSTALL_PATH}/bin" --enable-nasm && \ + make -k > ${DEPENDENCY_LOG_FILE} 2>&1 && \ + make install && \ + rm -rf ${DIR} + + + # faac + # http://stackoverflow.com/a/4320377 + # http://sourceforge.net/p/faac/bugs/162/#46a0 + echo "" + echo "Building faac (${FAAC_VERSION})" + DIR=$(mktemp -d faacXXX) && cd ${DIR} && \ + curl -L -Os http://downloads.sourceforge.net/faac/faac-${FAAC_VERSION}.tar.gz && \ + tar xzf faac-${FAAC_VERSION}.tar.gz && \ + cd faac-${FAAC_VERSION} && \ + #sed -i '126d' common/mp4v2/mpeg4ip.h && \ + ./bootstrap && \ + ./configure --prefix="${DEPENDENCY_INSTALL_PATH}" --bindir="${DEPENDENCY_INSTALL_PATH}/bin" --enable-shared --with-mp4v2=no && \ + make -k > ${DEPENDENCY_LOG_FILE} 2>&1 && \ + make install && \ + rm -rf ${DIR} + + # xvid + echo "" + echo "Building xvid (${XVID_VERSION})" + DIR=$(mktemp -d xvidXXX) && cd ${DIR} && \ + curl -L -Os http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ + tar xzf xvidcore-${XVID_VERSION}.tar.gz && \ + cd xvidcore/build/generic && \ + ./configure --prefix="${DEPENDENCY_INSTALL_PATH}" --bindir="${DEPENDENCY_INSTALL_PATH}/bin" && \ + make -k > ${DEPENDENCY_LOG_FILE} 2>&1 && \ + make install && \ + rm -rf ${DIR} + + + # fdk-aac + # Warning: need automake + libtool + echo "" + echo "Building fdk-aac (${FDKAAC_VERSION})" + DIR=$(mktemp -d fdk-aacXXX) && cd ${DIR} && \ + curl -s https://codeload.github.com/mstorsjo/fdk-aac/tar.gz/v${FDKAAC_VERSION} | tar zxf - && \ + cd fdk-aac-${FDKAAC_VERSION} && \ + autoreconf -fiv && \ + ./configure --prefix="${DEPENDENCY_INSTALL_PATH}" --enable-shared && \ + make -k > ${DEPENDENCY_LOG_FILE} 2>&1 && \ + make install && \ + rm -rf ${DIR} + + # libogg + echo "" + echo "Building libogg (${OGG_VERSION})" + DIR=$(mktemp -d liboggXXX) && cd ${DIR} && \ + curl -O http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \ + tar xzf libogg-${OGG_VERSION}.tar.gz && \ + cd libogg-${OGG_VERSION} && \ + ./configure --prefix="${DEPENDENCY_INSTALL_PATH}" --disable-shared --with-pic && \ + make -k > ${DEPENDENCY_LOG_FILE} 2>&1 && \ + make install && \ + rm -rf ${DIR} + + # libvorbis + echo "" + echo "Building libvorbis (${VORBIS_VERSION})" + DIR=$(mktemp -d libvorbisXXX) && cd ${DIR} && \ + curl -O http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \ + tar xzf libvorbis-${VORBIS_VERSION}.tar.gz && \ + cd libvorbis-${VORBIS_VERSION} && \ + ./configure --prefix="${DEPENDENCY_INSTALL_PATH}" --with-ogg="${DEPENDENCY_INSTALL_PATH}" --disable-shared --with-pic && \ + make -k > ${DEPENDENCY_LOG_FILE} 2>&1 && \ + make install && \ + rm -rf ${DIR} + + # libvpx + # https://trac.ffmpeg.org/ticket/4956 + echo "" + echo "Building libvpx (${VPX_VERSION})" + DIR=$(mktemp -d libvpxXXX) && cd ${DIR} && \ + git clone https://github.com/webmproject/libvpx.git && \ + cd libvpx && \ + git checkout v${VPX_VERSION} && \ + ./configure --prefix="${DEPENDENCY_INSTALL_PATH}" --disable-examples --enable-pic && \ + make -k > ${DEPENDENCY_LOG_FILE} 2>&1 && \ + make install && \ + rm -rf ${DIR} + + # libopus + # Compile error on OSX +# echo "" +# echo "Building libopus (last version)" +# DIR=$(mktemp -d libopusXXX) && cd ${DIR} && \ +# git clone git://git.opus-codec.org/opus.git && \ +# cd opus && \ +# autoreconf -fiv && \ +# ./configure --prefix="${DEPENDENCY_INSTALL_PATH}" --enable-shared --with-pic && \ +# make -k > ${DEPENDENCY_LOG_FILE} 2>&1 && \ +# make install && \ +# rm -rf ${DIR} + + export COMPILE_OPTIONS=--extra-libs=-ldl\ --enable-small\ --enable-shared\ --disable-static + export RELEASE_OPTIONS=--disable-debug + export DEBUG_OPTIONS=--enable-debug=3\ --disable-optimizations\ --disable-sse\ --disable-stripping + export LICENSING_OPTIONS=--enable-gpl\ --enable-nonfree + export THIRD_PARTIES_OPTIONS=--enable-libfaac\ --enable-libmp3lame\ --enable-libx264\ --enable-libxvid\ --enable-avresample\ --enable-libfdk_aac\ --enable-libvorbis\ --enable-libvpx if [[ ${DEPENDENCY_NAME} == "ffmpeg" ]]; then - wget https://www.ffmpeg.org/releases/ffmpeg-${DEPENDENCY_VERSION}.tar.bz2 - bunzip2 ffmpeg-${DEPENDENCY_VERSION}.tar.bz2 - tar -xvf ffmpeg-${DEPENDENCY_VERSION}.tar - cd ffmpeg-${DEPENDENCY_VERSION} - ./configure --prefix=${DEPENDENCY_INSTALL_PATH} --disable-yasm --enable-shared --disable-static && make -k && make install + echo "" + echo "Building ffmpeg (${DEPENDENCY_VERSION})" + DIR=$(mktemp -d ffmpegXXX) && cd ${DIR} && \ + curl -Os http://ffmpeg.org/releases/ffmpeg-${DEPENDENCY_VERSION}.tar.gz && \ + tar xzf ffmpeg-${DEPENDENCY_VERSION}.tar.gz && \ + cd ffmpeg-${DEPENDENCY_VERSION} && \ + ./configure --prefix="${DEPENDENCY_INSTALL_PATH}" \ + --extra-cflags="-I${DEPENDENCY_INSTALL_PATH}/include" --extra-ldflags="-L${DEPENDENCY_INSTALL_PATH}/lib64 -L${DEPENDENCY_INSTALL_PATH}/lib" --bindir="${DEPENDENCY_INSTALL_PATH}/bin" \ + $COMPILE_OPTIONS \ + $RELEASE_OPTIONS \ + $LICENSING_OPTIONS \ + $THIRD_PARTIES_OPTIONS --enable-postproc && \ + make -k > ${DEPENDENCY_LOG_FILE} 2>&1 && \ + make install && \ + rm -rf ${DIR} elif [[ ${DEPENDENCY_NAME} == "libav" ]]; then - wget https://libav.org/releases/libav-${DEPENDENCY_VERSION}.tar.gz - tar -xvf libav-${DEPENDENCY_VERSION}.tar.gz - cd libav-${DEPENDENCY_VERSION} - ./configure --prefix=${DEPENDENCY_INSTALL_PATH} --disable-yasm --enable-shared --disable-static && make -k && make install + echo "" + echo "Building libav (${DEPENDENCY_VERSION})" + DIR=$(mktemp -d libavXXX) && cd ${DIR} && \ + curl -Os https://libav.org/releases/libav-${DEPENDENCY_VERSION}.tar.gz && \ + tar xzf libav-${DEPENDENCY_VERSION}.tar.gz && \ + cd libav-${DEPENDENCY_VERSION} && \ + ./configure --prefix="${DEPENDENCY_INSTALL_PATH}" \ + --extra-cflags="-I${DEPENDENCY_INSTALL_PATH}/include" --extra-ldflags="-L${DEPENDENCY_INSTALL_PATH}/lib64 -L${DEPENDENCY_INSTALL_PATH}/lib" --bindir="${DEPENDENCY_INSTALL_PATH}/bin" \ + $COMPILE_OPTIONS \ + $RELEASE_OPTIONS \ + $LICENSING_OPTIONS \ + $THIRD_PARTIES_OPTIONS && \ + make -k > ${DEPENDENCY_LOG_FILE} 2>&1 && \ + make install && \ + rm -rf ${DIR} fi