Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5815088

Browse files
Merge pull request#139 from mikrosimage/release/v0.5.6
Merge from Mikros fork: up to v0.5.6
2 parents21a8473 +6323892 commit5815088

File tree

39 files changed

+899
-421
lines changed

39 files changed

+899
-421
lines changed

‎.travis.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
env:
2+
global:
3+
-AVTRANSCODER_BUILD=${TRAVIS_BUILD_DIR}/build
4+
-AVTRANSCODER_INSTALL=${TRAVIS_BUILD_DIR}/install
5+
-J='-j3'
26
matrix:
37
-DEPENDENCY_MODE=libav
48
-DEPENDENCY_MODE=ffmpeg
@@ -18,19 +22,27 @@ before_script:
1822
-date -u
1923
-uname -a
2024

21-
-chmod +x tools/travis.linux.install.deps.sh
22-
-chmod +x tools/travis.osx.install.deps.sh
23-
25+
-cd ${TRAVIS_BUILD_DIR}
26+
27+
# install coverage tools
28+
-./tools/travis.gcc.install.coverage.sh
29+
30+
# install avtranscoder dependencies
2431
-if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./tools/travis.linux.install.deps.sh; fi
2532
-if [ "${TRAVIS_OS_NAME}" = "osx" ]; then ./tools/travis.osx.install.deps.sh; fi
2633

2734
script:
2835
# Build
29-
-mkdir build
30-
-cd build
31-
-cmake .. -DCMAKE_INSTALL_PREFIX=`pwd`/dist
32-
-make install
36+
-mkdir -p ${AVTRANSCODER_BUILD}
37+
-cd ${AVTRANSCODER_BUILD}
38+
-cmake .. -DCMAKE_INSTALL_PREFIX=${AVTRANSCODER_INSTALL} -DCMAKE_BUILD_TYPE=Release -DAVTRANSCODER_PYTHON_VERSION_OF_BINDING=2.7 -DAVTRANSCODER_COVERAGE=True
39+
-make $J install
40+
3341
# Launch tests
34-
-cd ..
35-
-chmod +x tools/travis.python.nosetests.sh
36-
-if [ "${TRAVIS_OS_NAME}" = "linux" && "${DEPENDENCY_MODE}" = "ffmpeg" ]; then ./tools/travis.python.nosetests.sh; fi
42+
-if [ "${DEPENDENCY_MODE}" = "ffmpeg" ]; then ./../tools/travis.python.nosetests.sh; fi
43+
44+
after_success:
45+
-cd ${TRAVIS_BUILD_DIR}
46+
47+
# generate coverage for coveralls
48+
-if [ "${CC}" = "gcc" ]; then ./tools/travis.gcc.generate.coverage.sh; fi

‎CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ project(AvTranscoder)
55
# Set AvTranscoder versions
66
set(AVTRANSCODER_VERSION_MAJOR"0")
77
set(AVTRANSCODER_VERSION_MINOR"5")
8-
set(AVTRANSCODER_VERSION_MICRO"5")
8+
set(AVTRANSCODER_VERSION_MICRO"6")
99
set(AVTRANSCODER_VERSION${AVTRANSCODER_VERSION_MAJOR}.${AVTRANSCODER_VERSION_MINOR}.${AVTRANSCODER_VERSION_MICRO})
1010

1111
# Define AvTranscoder versions
@@ -28,6 +28,10 @@ else()
2828
set(CMAKE_CXX_FLAGS_RELEASE"${CMAKE_CXX_FLAGS_RELEASE} -fPIC -O3")
2929
endif()
3030

31+
# CPP flag to create code coverage report
32+
if(AVTRANSCODER_COVERAGE)
33+
set(CMAKE_CXX_FLAGS"${CMAKE_CXX_FLAGS} --coverage")
34+
endif()
3135

3236
add_subdirectory(src)
3337

‎INSTALL.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,29 @@ cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install
4545
```
4646
cmake .. -DCMAKE_BUILD_TYPE=Release/Debug
4747
```
48+
######To build python binding with a specific python version
49+
```
50+
cmake .. -DAVTRANSCODER_PYTHON_VERSION_OF_BINDING=2.7
51+
```
4852

4953
####Mac OSX using homebrew
5054

5155
######Install homebrew
5256
http://brew.sh/
5357

5458
######Install avTranscoder
59+
Last stable version:
5560
```
5661
brew tap cbenhagen/video
5762
brew install avtranscoder
5863
```
5964

65+
From develop branch:
66+
```
67+
brew tap cbenhagen/video
68+
brew install avtranscoder --devel
69+
```
70+
6071
######Use homebrew to install only dependencies
6172
```
6273
brew deps avtranscoder

‎README.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ C++ API for Libav / FFmpeg
44

55
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.
66

7+
[![Build Status](https://travis-ci.org/avTranscoder/avTranscoder.svg?branch=master)](https://travis-ci.org/avTranscoder/avTranscoder)
8+
[![Coverage Status](https://coveralls.io/repos/avTranscoder/avTranscoder/badge.svg)](https://coveralls.io/r/avTranscoder/avTranscoder)
9+
<ahref="https://scan.coverity.com/projects/2626"><imgalt="Coverity Scan Build Status"src="https://scan.coverity.com/projects/2626/badge.svg"/></a>
10+
711
####What you need to know
812
* C++ library
913
* Java and Python bindings generated with SWIG
@@ -47,20 +51,6 @@ avProfileType=avProfileTypeAudio
4751
codec=codecName
4852
```
4953

50-
####Continuous Integration
51-
52-
######Drone.io
53-
[![Build Status](https://drone.io/github.com/avTranscoder/avTranscoder/status.png)](https://drone.io/github.com/avTranscoder/avTranscoder/latest)
54-
55-
######Travis
56-
[![Build Status](https://travis-ci.org/avTranscoder/avTranscoder.svg?branch=master)](https://travis-ci.org/avTranscoder/avTranscoder)
57-
58-
######Coverity Scan
59-
<ahref="https://scan.coverity.com/projects/2626">
60-
<img alt="Coverity Scan Build Status"
61-
src="https://scan.coverity.com/projects/2626/badge.svg"/>
62-
</a>
63-
6454
####Tests
6555

6656
######nosetests

‎app/pyThumbnail/pythumbnail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
parser.add_argument('inputFileName',help='It could be any media file with at least one video stream (video, image...). Support file without extension.')
1313
# options
1414
parser.add_argument("-o","--outputFile",dest="outputFileName",default="thumbnail.jpg",help="Set the output filename (thumbnail.jpg by default). Must be with jpg extension!")
15-
parser.add_argument("-t","--time",dest="time",type=int,default=0,help="Set time (in seconds) of where to seek in the video stream to generate the thumbnail (0 by default).")
15+
parser.add_argument("-t","--time",dest="time",type=float,default=0,help="Set time (in seconds) of where to seek in the video stream to generate the thumbnail (0 by default).")
1616
parser.add_argument("-f","--frame",dest="frame",type=int,default=0,help="Set time (in frames) of where to seek in the video stream to generate the thumbnail (0 by default). Warning: priority to frame if user indicates both frame and time!")
1717
parser.add_argument("-w","--width",dest="width",type=int,default=0,help="Override the width of the thumbnail (same as input by default).")
1818
parser.add_argument("-he","--height",dest="height",type=int,default=0,help="Override the height of the thumbnail (same as input by default).")

‎ressource/v_dnxhd175x.prf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
avProfileName=dnxhd175x
2+
avProfileLongName=DNxHD 175Mbps 10bits 1920x1080 25fps
3+
avProfileType=avProfileTypeVideo
4+
codec=dnxhd
5+
width=1920
6+
height=1080
7+
pix_fmt=yuv422p10le
8+
b=175M
9+
g=1
10+
r=25

‎ressource/v_dnxhd36.prf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
avProfileName=dnxhd36
2+
avProfileLongName=DNxHD 36Mbps 8bits 1920x1080 25fps
3+
avProfileType=avProfileTypeVideo
4+
codec=dnxhd
5+
width=1920
6+
height=1080
7+
pix_fmt=yuv422p
8+
b=36M
9+
g=1
10+
r=25

‎src/AvTranscoder/decoder/AudioGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ bool AudioGenerator::decodeNextFrame( Frame& frameBuffer )
7070

7171
boolAudioGenerator::decodeNextFrame( Frame& frameBuffer,constsize_t subStreamIndex )
7272
{
73-
returnfalse;
73+
returndecodeNextFrame( frameBuffer );
7474
}
7575

7676
}

‎src/AvTranscoder/file/FormatContext.cpp

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
namespaceavtranscoder
77
{
88

9-
FormatContext::FormatContext(const std::string& filename,int req_flags )
9+
FormatContext::FormatContext(const std::string& filename,int req_flags, AVDictionary** options )
1010
: _avFormatContext(NULL )
11+
, _flags( req_flags )
1112
, _options()
1213
, _isOpen(false )
1314
{
14-
int ret =avformat_open_input( &_avFormatContext, filename.c_str(),NULL,NULL );
15+
int ret =avformat_open_input( &_avFormatContext, filename.c_str(),NULL,options );
1516
if( ret <0 )
1617
{
1718
std::string msg ="unable to open file";
@@ -21,11 +22,16 @@ FormatContext::FormatContext( const std::string& filename, int req_flags )
2122
throwstd::ios_base::failure( msg );
2223
}
2324
_isOpen =true;
25+
2426
loadOptions( _options, _avFormatContext, req_flags );
27+
// when demuxing, priv_data of AVFormatContext is set by avformat_open_input()
28+
if( _avFormatContext->iformat->priv_class )
29+
loadOptions( _options, _avFormatContext->priv_data, req_flags );
2530
}
2631

2732
FormatContext::FormatContext(int req_flags )
2833
: _avFormatContext(NULL )
34+
, _flags( req_flags )
2935
, _options()
3036
, _isOpen(false )
3137
{
@@ -85,6 +91,9 @@ void FormatContext::writeHeader( AVDictionary** options )
8591
{
8692
throwstd::runtime_error("could not write header:" +getDescriptionFromErrorCode( ret ) );
8793
}
94+
// when muxing, priv_data of AVFormatContext is set by avformat_write_header()
95+
if( _avFormatContext->oformat->priv_class )
96+
loadOptions( _options, _avFormatContext->priv_data, _flags );
8897
}
8998

9099
voidFormatContext::writeFrame( AVPacket& packet,bool interleaved )
@@ -133,6 +142,17 @@ AVStream& FormatContext::addAVStream( const AVCodec& avCodec )
133142
return *stream;
134143
}
135144

145+
voidFormatContext::seek(uint64_t position,constint flag )
146+
{
147+
if( (int)getStartTime() != AV_NOPTS_VALUE )
148+
position +=getStartTime();
149+
150+
if(av_seek_frame( _avFormatContext, -1, position, flag ) <0 )
151+
{
152+
LOG_ERROR("Error when seek at" << position <<" (in AV_TIME_BASE units) in file" )
153+
}
154+
}
155+
136156
std::vector<Option>FormatContext::getOptions()
137157
{
138158
std::vector<Option> optionsArray;

‎src/AvTranscoder/file/FormatContext.hpp

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,16 @@ class AvExport FormatContext
2121
FormatContext&operator=(const FormatContext& formatContext );
2222

2323
public:
24-
FormatContext(const std::string& filename,int req_flags =0 );///< Allocate an AVFormatContext by opening an input file
25-
FormatContext(int req_flags =0 );///< Allocate an AVFormatContext with default values
24+
/**
25+
* @brief Allocate an AVFormatContext by opening an input file
26+
*/
27+
FormatContext(const std::string& filename,int req_flags =0, AVDictionary** options =NULL );
28+
29+
/**
30+
* @brief Allocate an AVFormatContext with default values
31+
*/
32+
FormatContext(int req_flags =0 );
33+
2634
~FormatContext();
2735

2836
/**
@@ -43,7 +51,11 @@ class AvExport FormatContext
4351
*/
4452
voidcloseRessource();
4553

46-
voidwriteHeader( AVDictionary** options =NULL );///< Write the stream header to an output media file
54+
/**
55+
* @brief Write the stream header to an output media file
56+
* @note Also load options specific to the output format
57+
*/
58+
voidwriteHeader( AVDictionary** options =NULL );
4759

4860
/**
4961
* @brief Write a packet to an output media file
@@ -61,6 +73,14 @@ class AvExport FormatContext
6173
voidaddMetaData(const std::string& key,const std::string& value );
6274
AVStream&addAVStream(const AVCodec& avCodec );
6375

76+
/**
77+
* @brief Seek at a specific position
78+
* @param position: can be in AV_TIME_BASE units, in frames... depending on the flag value
79+
* @param flag: seeking mode (AVSEEK_FLAG_xxx)
80+
* @note before seek, add offset of start time
81+
*/
82+
voidseek(uint64_t position,constint flag );
83+
6484
size_tgetNbStreams()const {return _avFormatContext->nb_streams; }
6585
/// Get duration of the program, in seconds
6686
size_tgetDuration()const {return _avFormatContext->duration; }
@@ -90,6 +110,7 @@ class AvExport FormatContext
90110

91111
private:
92112
AVFormatContext* _avFormatContext;///< Has ownership
113+
constint _flags;///< Flags with which the options are loaded (see AV_OPT_FLAG_xxx)
93114
OptionMap _options;
94115
bool _isOpen;///< Is the AVFormatContext open (in constructor with a filename)
95116
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp