Skip to content

Travis: use matrix to build with ffmpeg/libav #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
env:
matrix:
- DEPENDENCY_MODE=libav
- DEPENDENCY_MODE=ffmpeg

language: cpp

os:
- linux
- osx

language: cpp

compiler:
- gcc
- clang
Expand All @@ -28,4 +33,4 @@ script:
# Launch tests
- cd ..
- chmod +x tools/travis.python.nosetests.sh
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./tools/travis.python.nosetests.sh; fi
- if [ "${TRAVIS_OS_NAME}" = "linux" && "${DEPENDENCY_MODE}" = "ffmpeg" ]; then ./tools/travis.python.nosetests.sh; fi
8 changes: 6 additions & 2 deletions src/AvTranscoder/mediaProperty/VideoProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ size_t VideoProperties::getBitRate() const

if( ! _codecContext->width || ! _codecContext->height )
throw std::runtime_error( "cannot compute bit rate: invalid frame size" );

// discard no frame type when decode
_codecContext->skip_frame = AVDISCARD_NONE;

Expand All @@ -429,7 +429,11 @@ size_t VideoProperties::getBitRate() const
avcodec_decode_video2( _codecContext, frame, &gotFrame, &pkt );
if( gotFrame )
{
gopFramesSize += frame->pkt_size;
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( 54, 7, 100 )
gopFramesSize += av_frame_get_pkt_size( frame );
#else
gopFramesSize += pkt.size;
#endif
++count;
}
}
Expand Down
22 changes: 16 additions & 6 deletions tools/travis.linux.install.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,19 @@ sudo apt-get install -qq python-dev doxygen
sudo apt-get install -qq freeglut3-dev libxmu-dev
sudo apt-get install -qq python-nose

# Build FFmpeg 2.2.9
sudo wget https://www.ffmpeg.org/releases/ffmpeg-2.2.9.tar.bz2
sudo bunzip2 ffmpeg-2.2.9.tar.bz2
sudo tar -xvf ffmpeg-2.2.9.tar
cd ffmpeg-2.2.9
./configure --disable-yasm --enable-shared --disable-static && make && sudo make install
if [[ ${DEPENDENCY_MODE} == "ffmpeg" ]]; then
export FFMPEG_VERSION=2.2.9
sudo wget https://www.ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2
sudo bunzip2 ffmpeg-${FFMPEG_VERSION}.tar.bz2
sudo tar -xvf ffmpeg-${FFMPEG_VERSION}.tar
cd ffmpeg-${FFMPEG_VERSION}
sudo ./configure --disable-yasm --enable-shared --disable-static && sudo make && sudo make install

elif [[ ${DEPENDENCY_MODE} == "libav" ]]; then
export LIBAV_VERSION=11.3
sudo wget https://libav.org/releases/libav-${LIBAV_VERSION}.tar.gz
sudo tar -xvf libav-${LIBAV_VERSION}.tar.gz
cd libav-${LIBAV_VERSION}
sudo ./configure --disable-yasm --enable-shared --disable-static && sudo make && sudo make install

fi
8 changes: 7 additions & 1 deletion tools/travis.osx.install.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@
brew update

brew install gcc cmake swig
brew install ffmpeg freeglut doxygen
brew install freeglut doxygen

if [[ ${DEPENDENCY_MODE} == "ffmpeg" ]]; then
brew install ffmpeg

elif [[ ${DEPENDENCY_MODE} == "libav" ]]; then
brew install libav