Skip to content

MIK fork: up to v0.5.5 #138

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 46 commits into from
Apr 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
56f322e
util: get format/videoCodec/audioCodec names with a map
Mar 25, 2015
c47b8ed
util: AvExport all functions
Mar 25, 2015
6cc5add
Option: add SWIG interface
Mar 25, 2015
5cf90ee
util: add SWIG interface
Mar 25, 2015
05389cd
Merge pull request #142 from cchampet/hotfix_getFormatsAndCodecsName
valnoel Mar 25, 2015
ce30cb8
CMake: deploy avtranscoder python lib with python interface
Mar 31, 2015
44db4a5
ProfileLoader: load only files with extension .prf
Apr 1, 2015
01eec19
Transcoder: can call process without argument
Apr 1, 2015
c0aed47
mediaProperty: rename typedef PropertiesMap to PropertyVector
Apr 1, 2015
a5ceb7f
mediaProperty: can get video and audio properties by a vector or a map
Apr 1, 2015
b66c7bc
Transcoder: fix addInputFile check if stream isActivated
Apr 2, 2015
b493e58
CMake: set rpath of avtranscoder-python lib
Mar 31, 2015
dbd4c6e
CMake: deploy java libs in lib/java
Apr 2, 2015
629a7a8
CMake: add build path in the linker search for avtranscoder shared li…
Apr 2, 2015
1d1d9ad
Travis: clean PYTHONPATH before launch tests
Apr 2, 2015
c5d847a
Merge pull request #152 from cchampet/fix_TranscoderaddInputFile
valnoel Apr 2, 2015
79e8bb9
Travis: use matrix to build with ffmpeg/libav
Apr 2, 2015
8732cbe
pyTest: update testTranscoderRewrap
Apr 3, 2015
7bbbdac
mediaProperty: add based class StreamProperties
Apr 3, 2015
e53ed0f
mediaProperty: add streamIndex when access all properties
Apr 3, 2015
469bcb2
Merge pull request #150 from cchampet/dev_mediaPropertiesGetMapOrVector
valnoel Apr 8, 2015
152dd48
Merge pull request #149 from cchampet/dev_transcoderProcessWithoutArg…
valnoel Apr 8, 2015
bede28c
VideoProperties: get size from AVPacket if not available in AVFrame
Apr 7, 2015
606e043
VideoProperties: get pkt_size with function when getBitRate
Apr 7, 2015
a262d51
Travis: launch tests only when build with ffmpeg
Apr 9, 2015
77d8f64
Ressource: add presets for h264 low/hq
Apr 1, 2015
5633b19
Merge pull request #148 from cchampet/ressource_addPresetsh264
valnoel Apr 9, 2015
6832c31
Merge pull request #153 from cchampet/build_TravisMatrixBuild
valnoel Apr 9, 2015
3063edb
Merge pull request #146 from cchampet/build_pythonLibWithPythonInterface
valnoel Apr 9, 2015
5c5f4c8
Transcoder: can get array of StreamTranscoder
Apr 16, 2015
1e022d3
Transcoder: can get ProcessMethod
Apr 16, 2015
16fcadb
Encoders: log profile in debug
Apr 16, 2015
778635c
Decoders: log profile in debug
Apr 16, 2015
45696d1
Formats: log profile in debug
Apr 16, 2015
f14cddf
util - getVideo/AudioCodecOptions: don't skip codecs without encode f…
Apr 16, 2015
7efb612
util - getOutputFormatOptions: clean
Apr 16, 2015
ed6eaf0
util: getVideo/AudioCodecsNames: don't skip codecs without encode fun…
Apr 16, 2015
1127853
util: getVideo/AudioCodecsNames: clean
Apr 16, 2015
b826dc2
util: getVideo/AudioCodecsNames: skip duplicates
Apr 16, 2015
c67abcb
Merge pull request #161 from cchampet/dev_setProfileAddLog
valnoel Apr 16, 2015
f1824d7
Merge pull request #162 from cchampet/fix_utilFunctions
valnoel Apr 16, 2015
40680fa
StreamTranscoder: can get encoder, transform, input stream, output st…
Apr 16, 2015
8b4a5cc
Merge pull request #160 from cchampet/dev_updateTranscoderAPI
valnoel Apr 16, 2015
49d3554
Merge branch 'release/v0.5.4' into develop
Apr 17, 2015
5c08d96
Merge branch 'develop' of https://github.com/mikrosimage/avTranscoder…
Apr 17, 2015
469f4d8
Up to v0.5.5
Apr 17, 2015
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(AvTranscoder)
# Set AvTranscoder versions
set(AVTRANSCODER_VERSION_MAJOR "0")
set(AVTRANSCODER_VERSION_MINOR "5")
set(AVTRANSCODER_VERSION_MICRO "4")
set(AVTRANSCODER_VERSION_MICRO "5")
set(AVTRANSCODER_VERSION ${AVTRANSCODER_VERSION_MAJOR}.${AVTRANSCODER_VERSION_MINOR}.${AVTRANSCODER_VERSION_MICRO})

# Define AvTranscoder versions
Expand Down
5 changes: 0 additions & 5 deletions ressource/v_h264.prf

This file was deleted.

9 changes: 9 additions & 0 deletions ressource/v_h264_hq.prf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
avProfileName=h264-hq
avProfileLongName=H.264 High Quality
avProfileType=avProfileTypeVideo
codec=h264
pix_fmt=yuv422p
profile=high422
preset=slow
tune=fastdecode,zerolatency
level=5
9 changes: 9 additions & 0 deletions ressource/v_h264_lq.prf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
avProfileName=h264-lq
avProfileLongName=H.264 Low Quality
avProfileType=avProfileTypeVideo
codec=h264
pix_fmt=yuv420p
profile=baseline
preset=ultrafast
tune=fastdecode,zerolatency
level=3
8 changes: 2 additions & 6 deletions src/AvTranscoder/avTranscoder.i
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,19 @@

%{
#include <AvTranscoder/Library.hpp>
#include <AvTranscoder/Option.hpp>
#include <AvTranscoder/log.hpp>
%}

namespace std {
%template(IntPair) pair< size_t, size_t >;
}

%include "AvTranscoder/progress/progress.i"
%include "AvTranscoder/mediaProperty/mediaProperty.i"
%include "AvTranscoder/frame/frame.i"
%include "AvTranscoder/profile/profile.i"

%include <AvTranscoder/Library.hpp>
%include <AvTranscoder/Option.hpp>
%include <AvTranscoder/log.hpp>

%include "AvTranscoder/option.i"
%include "AvTranscoder/util.i"
%include "AvTranscoder/codec/codec.i"
%include "AvTranscoder/stream/stream.i"
%include "AvTranscoder/decoder/decoder.i"
Expand Down
2 changes: 2 additions & 0 deletions src/AvTranscoder/decoder/AudioDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ bool AudioDecoder::decodeNextFrame()

void AudioDecoder::setProfile( const ProfileLoader::Profile& profile )
{
LOG_DEBUG( "Set profile of audio decoder with:\n" << profile )

AudioCodec& codec = _inputStream->getAudioCodec();

// set threads before any other options
Expand Down
4 changes: 3 additions & 1 deletion src/AvTranscoder/decoder/VideoDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ void VideoDecoder::flushDecoder()
}

void VideoDecoder::setProfile( const ProfileLoader::Profile& profile )
{
{
LOG_DEBUG( "Set profile of video decoder with:\n" << profile )

VideoCodec& codec = _inputStream->getVideoCodec();

// set threads before any other options
Expand Down
2 changes: 2 additions & 0 deletions src/AvTranscoder/encoder/AudioEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ bool AudioEncoder::encodeFrame( Frame& codedFrame )

void AudioEncoder::setProfile( const ProfileLoader::Profile& profile, const AudioFrameDesc& frameDesc )
{
LOG_DEBUG( "Set profile of audio encoder with:\n" << profile )

// set sampleRate, number of channels, sample format
_codec.setAudioParameters( frameDesc );

Expand Down
2 changes: 2 additions & 0 deletions src/AvTranscoder/encoder/VideoEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ bool VideoEncoder::encodeFrame( Frame& codedFrame )

void VideoEncoder::setProfile( const ProfileLoader::Profile& profile, const avtranscoder::VideoFrameDesc& frameDesc )
{
LOG_DEBUG( "Set profile of video encoder with:\n" << profile )

// set width, height, pixel format, fps
_codec.setImageParameters( frameDesc );

Expand Down
4 changes: 3 additions & 1 deletion src/AvTranscoder/file/InputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ double InputFile::getFps()
}

void InputFile::setProfile( const ProfileLoader::Profile& profile )
{
{
LOG_DEBUG( "Set profile of input file with:\n" << profile )

for( ProfileLoader::Profile::const_iterator it = profile.begin(); it != profile.end(); ++it )
{
if( (*it).first == constants::avProfileIdentificator ||
Expand Down
6 changes: 4 additions & 2 deletions src/AvTranscoder/file/OutputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ bool OutputFile::endWrap( )
return true;
}

void OutputFile::addMetadata( const PropertiesMap& dataMap )
void OutputFile::addMetadata( const PropertyVector& data )
{
for( PropertiesMap::const_iterator it = dataMap.begin(); it != dataMap.end(); ++it )
for( PropertyVector::const_iterator it = data.begin(); it != data.end(); ++it )
{
addMetadata( it->first, it->second );
}
Expand All @@ -147,6 +147,8 @@ void OutputFile::addMetadata( const std::string& key, const std::string& value )

void OutputFile::setProfile( const ProfileLoader::Profile& profile )
{
LOG_DEBUG( "Set profile of output file with:\n" << profile )

// check if output format indicated is valid with the filename extension
if( ! matchFormat( profile.find( constants::avProfileFormat )->second, _filename ) )
{
Expand Down
2 changes: 1 addition & 1 deletion src/AvTranscoder/file/OutputFile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class AvExport OutputFile : public IOutputFile
* @brief Add metadata to the output file.
* @note Depending on the format, you are not sure to find your metadata after the transcode.
*/
void addMetadata( const PropertiesMap& dataMap );
void addMetadata( const PropertyVector& data );
void addMetadata( const std::string& key, const std::string& value );

IOutputStream& getStream( const size_t streamId );
Expand Down
44 changes: 0 additions & 44 deletions src/AvTranscoder/mediaProperty/AttachementProperties.cpp

This file was deleted.

26 changes: 5 additions & 21 deletions src/AvTranscoder/mediaProperty/AttachementProperties.hpp
Original file line number Diff line number Diff line change
@@ -1,33 +1,17 @@
#ifndef _AV_TRANSCODER_MEDIA_PROPERTY_ATTACHEMENT_PROPERTIES_HPP
#define _AV_TRANSCODER_MEDIA_PROPERTY_ATTACHEMENT_PROPERTIES_HPP

#include <AvTranscoder/common.hpp>
#include <AvTranscoder/mediaProperty/util.hpp>
#include <AvTranscoder/file/FormatContext.hpp>
#include <AvTranscoder/mediaProperty/StreamProperties.hpp>

namespace avtranscoder
{

class AvExport AttachementProperties
class AvExport AttachementProperties: public StreamProperties
{
public:
AttachementProperties( const FormatContext& formatContext, const size_t index );

size_t getStreamIndex() const { return _streamIndex; }
size_t getStreamId() const;
PropertiesMap& getMetadatas() { return _metadatas; }

#ifndef SWIG
const AVFormatContext& getAVFormatContext() { return *_formatContext; }
#endif

PropertiesMap getPropertiesAsMap() const; ///< Return all attachement properties as a map (name of property: value)

private:
const AVFormatContext* _formatContext; ///< Has link (no ownership)

size_t _streamIndex;
PropertiesMap _metadatas;
AttachementProperties( const FormatContext& formatContext, const size_t index )
: StreamProperties( formatContext, index )
{}
};

}
Expand Down
50 changes: 24 additions & 26 deletions src/AvTranscoder/mediaProperty/AudioProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ namespace avtranscoder
{

AudioProperties::AudioProperties( const FormatContext& formatContext, const size_t index )
: _formatContext( &formatContext.getAVFormatContext() )
, _codecContext( NULL )
, _codec( NULL )
, _streamIndex( index )
: StreamProperties( formatContext, index )
{
if( _formatContext )
_codecContext = _formatContext->streams[index]->codec;
Expand Down Expand Up @@ -202,33 +199,34 @@ double AudioProperties::getDuration() const
return duration;
}

PropertiesMap AudioProperties::getPropertiesAsMap() const
{
PropertiesMap dataMap;

addProperty( dataMap, "streamId", &AudioProperties::getStreamId );
addProperty( dataMap, "codecId", &AudioProperties::getCodecId );
addProperty( dataMap, "codecName", &AudioProperties::getCodecName );
addProperty( dataMap, "codecLongName", &AudioProperties::getCodecLongName );
addProperty( dataMap, "sampleFormatName", &AudioProperties::getSampleFormatName );
addProperty( dataMap, "sampleFormatLongName", &AudioProperties::getSampleFormatLongName );
addProperty( dataMap, "sampleRate", &AudioProperties::getSampleRate );
addProperty( dataMap, "bitRate", &AudioProperties::getBitRate );
addProperty( dataMap, "nbSamples", &AudioProperties::getNbSamples );
addProperty( dataMap, "channels", &AudioProperties::getChannels );
addProperty( dataMap, "channelLayout", &AudioProperties::getChannelLayout );
addProperty( dataMap, "channelName", &AudioProperties::getChannelName );
addProperty( dataMap, "channelDescription", &AudioProperties::getChannelDescription );
addProperty( dataMap, "ticksPerFrame", &AudioProperties::getTicksPerFrame );
addProperty( dataMap, "timeBase", &AudioProperties::getTimeBase );
addProperty( dataMap, "duration", &AudioProperties::getDuration );
PropertyVector AudioProperties::getPropertiesAsVector() const
{
PropertyVector data;

addProperty( data, "streamId", &AudioProperties::getStreamId );
detail::add( data, "streamIndex", getStreamIndex() );
addProperty( data, "codecId", &AudioProperties::getCodecId );
addProperty( data, "codecName", &AudioProperties::getCodecName );
addProperty( data, "codecLongName", &AudioProperties::getCodecLongName );
addProperty( data, "sampleFormatName", &AudioProperties::getSampleFormatName );
addProperty( data, "sampleFormatLongName", &AudioProperties::getSampleFormatLongName );
addProperty( data, "sampleRate", &AudioProperties::getSampleRate );
addProperty( data, "bitRate", &AudioProperties::getBitRate );
addProperty( data, "nbSamples", &AudioProperties::getNbSamples );
addProperty( data, "channels", &AudioProperties::getChannels );
addProperty( data, "channelLayout", &AudioProperties::getChannelLayout );
addProperty( data, "channelName", &AudioProperties::getChannelName );
addProperty( data, "channelDescription", &AudioProperties::getChannelDescription );
addProperty( data, "ticksPerFrame", &AudioProperties::getTicksPerFrame );
addProperty( data, "timeBase", &AudioProperties::getTimeBase );
addProperty( data, "duration", &AudioProperties::getDuration );

for( size_t metadataIndex = 0; metadataIndex < _metadatas.size(); ++metadataIndex )
{
detail::add( dataMap, _metadatas.at( metadataIndex ).first, _metadatas.at( metadataIndex ).second );
detail::add( data, _metadatas.at( metadataIndex ).first, _metadatas.at( metadataIndex ).second );
}

return dataMap;
return data;
}

}
22 changes: 6 additions & 16 deletions src/AvTranscoder/mediaProperty/AudioProperties.hpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
#ifndef _AV_TRANSCODER_MEDIA_PROPERTY_AUDIO_PROPERTIES_HPP
#define _AV_TRANSCODER_MEDIA_PROPERTY_AUDIO_PROPERTIES_HPP

#include <AvTranscoder/common.hpp>
#include <AvTranscoder/mediaProperty/util.hpp>
#include <AvTranscoder/file/FormatContext.hpp>
#include <AvTranscoder/mediaProperty/StreamProperties.hpp>

#include <string>

namespace avtranscoder
{

class AvExport AudioProperties
class AvExport AudioProperties : public StreamProperties
{
public:
AudioProperties( const FormatContext& formatContext, const size_t index );
Expand All @@ -23,7 +21,6 @@ class AvExport AudioProperties
std::string getChannelName() const;
std::string getChannelDescription() const;

size_t getStreamIndex() const { return _streamIndex; }
size_t getStreamId() const;
size_t getCodecId() const;
size_t getSampleRate() const;
Expand All @@ -35,38 +32,31 @@ class AvExport AudioProperties
Rational getTimeBase() const;
double getDuration() const;

PropertiesMap& getMetadatas() { return _metadatas; }

#ifndef SWIG
const AVFormatContext& getAVFormatContext() { return *_formatContext; }
AVCodecContext& getAVCodecContext() { return *_codecContext; }
#endif

PropertiesMap getPropertiesAsMap() const; ///< Return all audio properties as a map (name of property: value)
PropertyVector getPropertiesAsVector() const;

private:
#ifndef SWIG
template<typename T>
void addProperty( PropertiesMap& dataMap, const std::string& key, T (AudioProperties::*getter)(void) const ) const
void addProperty( PropertyVector& data, const std::string& key, T (AudioProperties::*getter)(void) const ) const
{
try
{
detail::add( dataMap, key, (this->*getter)() );
detail::add( data, key, (this->*getter)() );
}
catch( const std::exception& e )
{
detail::add( dataMap, key, e.what() );
detail::add( data, key, e.what() );
}
}
#endif

private:
const AVFormatContext* _formatContext; ///< Has link (no ownership)
AVCodecContext* _codecContext; ///< Has link (no ownership)
AVCodec* _codec; ///< Has link (no ownership)

size_t _streamIndex;
PropertiesMap _metadatas;
};

}
Expand Down
Loading