Skip to content

MIK fork: up to v0.5.7 #141

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 68 commits into from
Jul 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
2596a4e
Travis: deploy on tag
Apr 27, 2015
f76b9bd
Merge branch 'develop' of https://github.com/mikrosimage/avTranscoder…
Apr 30, 2015
b526dd3
Travis: deploy ffmpeg/libav dependency
Apr 30, 2015
6a62af4
ICodec: suppress swig warning with open method
Apr 30, 2015
2297872
Frame: hide methods to SWIG
Apr 30, 2015
a9b634c
SWIG: add avOperator.i to suppress swig warnings
Apr 30, 2015
0173f83
SWIG: add flags when compile bindings
Apr 30, 2015
4e75c0c
Travis: deploy only if linux build
Apr 30, 2015
fc442c2
Travis: clean
Apr 30, 2015
2fa03db
Profiles: remove 'g' option from dnxhd profiles
Apr 30, 2015
4194390
Travis: add documentation
Apr 30, 2015
473d438
Travis: rename the archives deployed
Apr 30, 2015
7f7147b
Merge pull request #186 from cchampet/fix_dnxhdProfiles
valnoel Apr 30, 2015
67eb60a
Merge remote-tracking branch 'mikrosimage/release/v0.5.6' into develop
valnoel Apr 30, 2015
6e77563
FileProperties: StreamProperties pointers stored by streamIndex into …
valnoel Apr 30, 2015
2e7d791
FileProperties: add exception documentation about the getStreamProper…
valnoel May 4, 2015
2b68780
Travis: clean build optimization
May 4, 2015
6b53ed1
hotfix: unset decoder (generator) after codec latency processing on r…
valnoel May 5, 2015
5fb1558
hotfix: fix to generator switch on BasedOnDuration process method
valnoel May 5, 2015
a35585f
hotfix: InputFile::seek at the exact frame
May 5, 2015
6b4373c
hotfix: encoders/decoders - by default set threads to the value expec…
May 5, 2015
5d74dc7
Merge pull request #187 from mikrosimage/dev_fileProperties_streams_map
cchampet May 5, 2015
848460e
Merge pull request #177 from mikrosimage/travis_deploy
valnoel May 5, 2015
c59b98b
Merge pull request #185 from cchampet/dev_SWIG_flags
valnoel May 6, 2015
db08b2f
CMake: the install rule does not depend on all
May 6, 2015
81e811f
hotfix: store first AVCodecContext::timecode_frame_start
valnoel May 12, 2015
b92c2b0
Transcoder: log number of frame processed in debug
May 28, 2015
9f75cb9
Merge pull request #192 from cchampet/fix_logNbFrameProcessedInDebug
valnoel May 28, 2015
16b3377
Add USAGE.md
Jun 3, 2015
0b7fbdc
InputFile/OutputFile: can get format name/long name/mime type
Jun 3, 2015
ae287ba
Merge pull request #197 from cchampet/add_USAGE
valnoel Jun 4, 2015
166d24b
pythumbnail app: use optparse if argparse module cannot be imported
Jun 4, 2015
80e971c
pyprocessor app: clean script
Jun 4, 2015
daeeefc
c++ apps: declare targets as optional
Jun 4, 2015
7187589
util: remove getFormat() function
Jun 4, 2015
992c45e
OutputFile: add getFilename function
Jun 4, 2015
cae95e4
InputFile: add documentation
Jun 4, 2015
c5fcc68
OutputFile: add documentation
Jun 4, 2015
f18ebae
InputFile: fix build of getFormatMimeType() when libavformat <= 55
Jun 4, 2015
1b0f75f
InputFile/OutputFile: add log and return empty if format parameters a…
Jun 4, 2015
0e73a68
Transcoder: do not delete array of stream at the end of process
Jun 8, 2015
4bb8f78
Decoder/Encoder: refactor setup and setProfile
Jun 8, 2015
0450ffe
profile: add 'avProfileProcessStat' to trigger stats during the process
Jun 8, 2015
e35d620
IOutputStream: add getNbFrames function
Jun 8, 2015
9d475b8
transcoder: add ProcessStat class, returned by Transcoder::process me…
Jun 8, 2015
808a9e7
ProcessStat: fix build with libav
Jun 8, 2015
c5e936f
Merge pull request #198 from cchampet/dev_mimeType
valnoel Jun 8, 2015
1668097
Merge pull request #199 from cchampet/fix_pythonAppsPython2.6
valnoel Jun 8, 2015
94bf8fc
Add stat folder
Jun 8, 2015
c496d63
stat: split ProcessStat by adding VideoStat files
Jun 8, 2015
a16929b
stat: export classes
Jun 8, 2015
7339f50
stat: add AudioStat class
Jun 8, 2015
e3944f4
stat: add SWIG interface
Jun 8, 2015
0b4ef30
StreamTranscoder: refactor how to get the current process case
Jun 8, 2015
2c9198f
Merge pull request #200 from cchampet/dev_ProcessStat
valnoel Jun 8, 2015
9b9005b
Merge pull request #201 from cchampet/dev_StreamTranscoderGetProcessCase
valnoel Jun 8, 2015
f44f3c3
Merge pull request #188 from cchampet/cmake_installDoesNotDependOnAll
valnoel Jun 9, 2015
9635e02
Merge branch 'release/v0.5.6' of https://github.com/mikrosimage/avTra…
Jun 17, 2015
6cfee84
VideoProperties: fix warning when compile with gcc
Jun 17, 2015
a827ec6
Up to v0.5.7
Jun 17, 2015
2e5d6a2
StreamTranscoder: fix offset support on waiting for data to wrap
valnoel Jun 22, 2015
74423d5
FileProperties: clean extractStreamProperties
Jun 22, 2015
7ccfb72
CMake: clean indentation
Jun 22, 2015
aad1bbf
VideoStat: use log10 C++ function
Jun 22, 2015
cda8459
transcoder: manage offset with a float type
Jun 22, 2015
c619856
VideoProperties: return fps as a float type
Jun 22, 2015
eaf480e
Manage duration as a float
Jun 22, 2015
35e8681
InputFile: add parameter to seek with a specific flag
Jul 28, 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
41 changes: 30 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
env:
global:
- AVTRANSCODER_BUILD=${TRAVIS_BUILD_DIR}/build
- AVTRANSCODER_INSTALL=${TRAVIS_BUILD_DIR}/install
- J='-j3'
- AVTRANSCODER_BUILD=${TRAVIS_BUILD_DIR}/build-avtranscoder
- AVTRANSCODER_INSTALL=${TRAVIS_BUILD_DIR}/install-avtranscoder
- DEPENDENCY_INSTALL=${TRAVIS_BUILD_DIR}/install-dependency
- CI_NODE_TOTAL=2
matrix:
- DEPENDENCY_MODE=libav
- DEPENDENCY_MODE=ffmpeg
Expand All @@ -28,21 +29,39 @@ before_script:
- ./tools/travis.gcc.install.coverage.sh

# install avtranscoder dependencies
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./tools/travis.linux.install.deps.sh; fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then ./tools/travis.osx.install.deps.sh; fi
- if [ ${TRAVIS_OS_NAME} = "linux" ]; then ./tools/travis.linux.install.deps.sh; fi
- if [ ${TRAVIS_OS_NAME} = "osx" ]; then ./tools/travis.osx.install.deps.sh; fi

script:
# Build
# build
- mkdir -p ${AVTRANSCODER_BUILD}
- cd ${AVTRANSCODER_BUILD}
- cmake .. -DCMAKE_INSTALL_PREFIX=${AVTRANSCODER_INSTALL} -DCMAKE_BUILD_TYPE=Release -DAVTRANSCODER_PYTHON_VERSION_OF_BINDING=2.7 -DAVTRANSCODER_COVERAGE=True
- make $J install
- cmake .. -DCMAKE_INSTALL_PREFIX=${AVTRANSCODER_INSTALL} -DCMAKE_PREFIX_PATH=${DEPENDENCY_INSTALL} -DCMAKE_BUILD_TYPE=Release -DAVTRANSCODER_PYTHON_VERSION_OF_BINDING=2.7 -DAVTRANSCODER_COVERAGE=True
- make -j${CI_NODE_TOTAL}
- make install

# Launch tests
- if [ "${DEPENDENCY_MODE}" = "ffmpeg" ]; then ./../tools/travis.python.nosetests.sh; fi
# launch tests
- if [ ${DEPENDENCY_MODE} = "ffmpeg" ]; then ./../tools/travis.python.nosetests.sh; fi

after_success:
- cd ${TRAVIS_BUILD_DIR}

# generate coverage for coveralls
- if [ "${CC}" = "gcc" ]; then ./tools/travis.gcc.generate.coverage.sh; fi
- if [ ${CC} = "gcc" ]; then ./tools/travis.gcc.generate.coverage.sh; fi

before_deploy:
# create archive
- cd ${TRAVIS_BUILD_DIR}
- tar -cvzf avtranscoder-${TRAVIS_OS_NAME}-${CC}-${DEPENDENCY_MODE}.tgz ${DEPENDENCY_INSTALL} ${AVTRANSCODER_INSTALL}

deploy:
# if the commit is tagged, deploy using github release service
provider: releases
api_key:
secure: ${GITHUB_RELEASE_API_KEY}
file: avtranscoder-${TRAVIS_OS_NAME}-${CC}-${DEPENDENCY_MODE}.tgz
skip_cleanup: true
on:
tags: true
condition: ${TRAVIS_OS_NAME} = "linux"

5 changes: 4 additions & 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 "6")
set(AVTRANSCODER_VERSION_MICRO "7")
set(AVTRANSCODER_VERSION ${AVTRANSCODER_VERSION_MAJOR}.${AVTRANSCODER_VERSION_MINOR}.${AVTRANSCODER_VERSION_MICRO})

# Define AvTranscoder versions
Expand All @@ -19,6 +19,9 @@ add_definitions(-DAVTRANSCODER_DEFAULT_AVPROFILES="${CMAKE_INSTALL_PREFIX}/share
# Diplay commands being ran by CMake
set(CMAKE_VERBOSE_MAKEFILE OFF)

# The install rule does not depend on all, i.e. everything will not be built before installing
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE)

# CPP flags on debug / release mode
if(MSVC)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
Expand Down
30 changes: 1 addition & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,7 @@ See [**COPYING.md**](COPYING.md)
See [**INSTALL.md**](INSTALL.md)

#### How to use
Check out applications contained in the project to see examples of how to use the library in C++, Java or Python.

To encode, avTranscoder manipulates profiles.
A profile is a text file which discribes, with a set of key-value, what we want as output for the format, the video, or the audio.
You can create your own profiles and export a variable called ```AVPROFILES``` to indicate the path to them.

The minimum format profile is:
```
avProfileName=profileName
avProfileLongName=profileLongName
avProfileType=avProfileTypeFormat
format=formatName
```

The minimum video profile is:
```
avProfileName=profileName
avProfileLongName=profileLongName
avProfileType=avProfileTypeVideo
codec=codecName
```

The minimum audio profile is:
```
avProfileName=profileName
avProfileLongName=profileLongName
avProfileType=avProfileTypeAudio
codec=codecName
```
See [**USAGE.md**](USAGE.md)

#### Tests

Expand Down
62 changes: 62 additions & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# How to use avTranscoder

Check out applications contained in the project to see examples of how to use the library in C++, Java or Python.

#### In C++
Set environment:
```
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/ffmpeg/lib:/path/to/avtranscoder/lib
export PATH=$PATH:/path/to/avtranscoder/bin
```

#### In Java
Add argument to the JVM:
```
-Djava.library.path=/path/to/avtranscoder/lib/java
```
Set environment:
```
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/ffmpeg/lib
```

#### In Python
Set environment:
```
export PYTHONPATH=$PYTHONPATH:/path/to/avtranscoder/lib/python<version>/site-packages/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/ffmpeg/lib
```

#### Use profiles
To wrap/unwrap/encode/decode, avTranscoder manipulates profiles.
A profile is a set of key-value given as parameters to the InputFile(unwrap), the OutputFile(wrap), the Video/AudioDecoder(decode) or the Video/AudioEncoder(encode).
There are two ways to manipulate profiles:
* create profiles inside your code, by instanciate ```Map``` structures.
* create profiles outside your code, by create text files.
To indicate the path to the text files, export environment variable:
```
export AVPROFILES=/path/to/profiles
```

The minimum format profile (wrap/unwrap) is:
```
avProfileName=profileName
avProfileLongName=profileLongName
avProfileType=avProfileTypeFormat
format=formatName
```

The minimum video profile (encode/decode) is:
```
avProfileName=profileName
avProfileLongName=profileLongName
avProfileType=avProfileTypeVideo
codec=codecName
```

The minimum audio profile (encode/decode) is:
```
avProfileName=profileName
avProfileLongName=profileLongName
avProfileType=avProfileTypeAudio
codec=codecName
```
1 change: 1 addition & 0 deletions app/avInfo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ install(
FILES ${BINARY_FILES}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
DESTINATION "bin/"
OPTIONAL
)

install(
Expand Down
1 change: 1 addition & 0 deletions app/avMeta/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ install(
FILES ${BINARY_FILES}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
DESTINATION "bin/"
OPTIONAL
)

install(
Expand Down
2 changes: 1 addition & 1 deletion app/avPlay/AvReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ AvReader::AvReader( const std::string& filename )
_inputFile.activateStream( _videoStream );

_inputVideo = new avtranscoder::VideoDecoder( _inputFile.getStream( _videoStream ) );
_inputVideo->setup();
_inputVideo->setupDecoder();

_sourceImage = new avtranscoder::VideoFrame( _inputFile.getStream( _videoStream ).getVideoCodec().getVideoFrameDesc() );

Expand Down
1 change: 1 addition & 0 deletions app/avPlay/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ install(
FILES ${BINARY_FILES}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
DESTINATION "bin/"
OPTIONAL
)

install(
Expand Down
1 change: 1 addition & 0 deletions app/avProcessor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ install(
FILES ${BINARY_FILES}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
DESTINATION "bin/"
OPTIONAL
)

install(
Expand Down
3 changes: 2 additions & 1 deletion app/pyProcessor/pyprocessor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
#!/usr/bin/env python

import argparse # python2.7+

from pyAvTranscoder import avtranscoder as av
Expand Down
71 changes: 52 additions & 19 deletions app/pyThumbnail/pythumbnail.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,56 @@
import argparse # python2.7+
#!/usr/bin/env python

from pyAvTranscoder import avtranscoder as av

# Create command-line interface
parser = argparse.ArgumentParser(
prog='pythumbnail',
description='''Generate jpeg thumbnail from video/image.''',
)

# requirements
parser.add_argument('inputFileName', help='It could be any media file with at least one video stream (video, image...). Support file without extension.')
# options
parser.add_argument("-o", "--outputFile", dest="outputFileName", default="thumbnail.jpg", help="Set the output filename (thumbnail.jpg by default). Must be with jpg extension!")
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).")
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!")
parser.add_argument("-w", "--width", dest="width", type=int, default=0, help="Override the width of the thumbnail (same as input by default).")
parser.add_argument("-he", "--height", dest="height", type=int, default=0, help="Override the height of the thumbnail (same as input by default).")
# Parse command-line
args = parser.parse_args()

# Get command line arguments
args = []
try:
# python2.7+
import argparse

# Create command-line interface
parser = argparse.ArgumentParser(
prog='pythumbnail',
description='''Generate jpeg thumbnail from video/image.''',
)

# requirements
parser.add_argument('inputFileName', help='It could be any media file with at least one video stream (video, image...). Support file without extension.')
# options
parser.add_argument("-o", "--outputFile", dest="outputFileName", default="thumbnail.jpg", help="Set the output filename (thumbnail.jpg by default). Must be with jpg extension!")
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).")
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!")
parser.add_argument("-w", "--width", dest="width", type=int, default=0, help="Override the width of the thumbnail (same as input by default).")
parser.add_argument("-he", "--height", dest="height", type=int, default=0, help="Override the height of the thumbnail (same as input by default).")
# Parse command-line
args = parser.parse_args()

except ImportError:
import optparse

# Create command-line interface
parser = optparse.OptionParser(
usage='usage: %prog -i <file> -t|-f <time> [options]',
prog='pythumbnail',
description='''Generate jpeg thumbnail from video/image.''',
)

# requirements
parser.add_option("-i", "--inputFile", dest='inputFileName', help='It could be any media file with at least one video stream (video, image...). Support file without extension.')
# options
parser.add_option("-o", "--outputFile", dest="outputFileName", default="thumbnail.jpg", help="Set the output filename (thumbnail.jpg by default). Must be with jpg extension!")
parser.add_option("-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).")
parser.add_option("-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!")
parser.add_option("-w", "--width", dest="width", type="int", default=0, help="Override the width of the thumbnail (same as input by default).")
parser.add_option("--height", dest="height", type="int", default=0, help="Override the height of the thumbnail (same as input by default).")
# Parse command-line
args, other = parser.parse_args()

if args.inputFileName is None:
print "An input file is required. Use -i / --inputFile."
exit(1)


# setup avtranscoder
logger = av.Logger().setLogLevel(av.AV_LOG_QUIET)
Expand All @@ -31,9 +64,9 @@

# seek in file
if args.frame:
inputFile.seekAtFrame(args.frame)
inputFile.seekAtFrame(args.frame, av.AVSEEK_FLAG_BACKWARD)
elif args.time:
inputFile.seekAtTime(args.time)
inputFile.seekAtTime(args.time, av.AVSEEK_FLAG_BACKWARD)

# create output file (need to set format profile of encoding to force output format to mjpeg)
formatProfile = av.ProfileMap()
Expand Down
1 change: 0 additions & 1 deletion ressource/v_dnxhd120.prf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ width=1920
height=1080
pix_fmt=yuv422p
b=120M
g=1
r=25
1 change: 0 additions & 1 deletion ressource/v_dnxhd175x.prf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ width=1920
height=1080
pix_fmt=yuv422p10le
b=175M
g=1
r=25
1 change: 0 additions & 1 deletion ressource/v_dnxhd185.prf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ width=1920
height=1080
pix_fmt=yuv422p
b=185M
g=1
r=25
1 change: 0 additions & 1 deletion ressource/v_dnxhd185x.prf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ width=1920
height=1080
pix_fmt=yuv422p10le
b=185M
g=1
r=25
1 change: 0 additions & 1 deletion ressource/v_dnxhd36.prf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ width=1920
height=1080
pix_fmt=yuv422p
b=36M
g=1
r=25
3 changes: 3 additions & 0 deletions src/AvTranscoder/avTranscoder.i
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
%include "AvTranscoder/swig/avMediaType.i"
%include "AvTranscoder/swig/avRational.i"
%include "AvTranscoder/swig/avLogLevel.i"
%include "AvTranscoder/swig/avSeek.i"
%include "AvTranscoder/swig/avOperator.i"

%{
#include <AvTranscoder/Library.hpp>
Expand All @@ -35,4 +37,5 @@
%include "AvTranscoder/encoder/encoder.i"
%include "AvTranscoder/transform/transform.i"
%include "AvTranscoder/file/file.i"
%include "AvTranscoder/stat/stat.i"
%include "AvTranscoder/transcoder/transcoder.i"
2 changes: 1 addition & 1 deletion src/AvTranscoder/codec/ICodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ICodec::~ICodec()
_avCodecContext = NULL;
}

void ICodec::open()
void ICodec::openCodec()
{
if( ! _avCodecContext )
throw std::runtime_error( "unable to open a codec with no codec context" );
Expand Down
2 changes: 1 addition & 1 deletion src/AvTranscoder/codec/ICodec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AvExport ICodec
virtual ~ICodec() = 0;

/// Initialize the codec context.
void open();
void openCodec();

std::string getCodecName() const;
AVCodecID getCodecId() const;
Expand Down
Loading