You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check out applications contained in the project to see examples of how to use the library in C++, Java or Python.
3
+
## When to use avTranscoder
4
+
* when you need to access the API of ffmpeg, but you want to avoid the head-hurting part of AVPacket, AV_TIME_BASE and all the stuff deep inside ffmpeg.
5
+
* when you would like to access the ffmpeg features in your language (currently Java and python, tomorrow what you want!).
The original code is in C++, but almost all the methods are translated into python/java without any changes.
10
+
So a good way to start is to have a look at the [C++ code](src/AvTranscoder) (since the generated python/java code is ugly).
11
+
12
+
In the sake of brevity, the example code of the following section is written in python.
13
+
14
+
#### At the beginning
15
+
Before starting anything, you need to register all the codecs, formats, filters which are enabled at configuration time.
16
+
So your first avTranscoder instruction should be:
17
+
```python
18
+
avtranscoder.preloadCodecsAndFormats()
16
19
```
17
-
Set environment:
20
+
21
+
#### Analyse media
22
+
To analyse a media, you can create an [__InputFile__](src/AvTranscoder/file/InputFile.hpp) and have access to all header [__properties__](src/AvTranscoder/properties).
Check out [__avmeta__](app/avMeta/avMeta.cpp) application to see a C++ example of this use case.
68
+
69
+
#### Process media
70
+
An important part of the API concerns media processing. The general overview of the workflow could be separate in 2 main cases:
71
+
*_transcoding_: demuxing, decoding, transform, encoding and muxing. Here we can update all parts of the media, from the container to the codec used to encode data.
72
+
See the [transcoding process](https://ffmpeg.org/ffmpeg.html#toc-Detailed-description) in ffmpeg documentation.
73
+
*_rewrap_: omit the decoding, transform and encoding steps. It is useful for changing the container format or modifying container-level metadata.
74
+
See the [copy](https://ffmpeg.org/ffmpeg.html#Stream-copy) paramer in ffmpeg documentation.
75
+
76
+
The main class to process media is the [__Transcoder__](src/AvTranscoder/transcoder/Transcoder.hpp).
77
+
78
+
Here a rewrapping example to update container (from AVI to MOV):
Check out [__avprocessor__](app/avProcessor/avProcessor.cpp) application to see a C++ example of this use case.
102
+
103
+
An other important parameter is the transcoding policy, which defines how we manage the process in case of several streams. By default the process ends at the end of the longest stream (so the shorter streams are filled with silence or black images).
104
+
To change the transcoding policy:
105
+
```python
106
+
# stop the process when the output stream at index 0 is finished
To wrap/unwrap/encode/decode, avTranscoder manipulates profiles.
31
115
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).
32
116
There are two ways to manipulate profiles:
33
117
* create profiles inside your code, by instanciate ```Map``` structures.
34
-
* create profiles outside your code, by create text files.
118
+
* create profiles outside your code, by create text files. You have examples [here](avprofiles).
119
+
35
120
To indicate the path to the text files, export environment variable:
To go into more details about the avTranscoder API, take a look at the [__Doxygen documentation__](http://avtranscoder.github.io/avTranscoder-doxygen/).
TuttleOFX is a library to connect and batch operations with OpenFx plugins. It comes with a set of plugins that allows you to batch process on movies and file sequences.
185
+
TuttOFX uses avTranscoder for the [AudioVideo plugin](https://github.com/tuttleofx/TuttleOFX/tree/develop/plugins/image/io/AudioVideo), one of its io plugins.
186
+
187
+
#### PADdef / Slingshot
188
+
PADdef is a platform developed by [Mikros Image](http://www.mikrosimage.eu/) for France Télévisions's new digital distribution centers. Its purpose is to handle the delivery of ready-to-broadcast feature material.
189
+
Slingshot is its mirror project for Belgium broadcasters: Medialaan, RTBF and RTL.
190
+
PADdef / Slingshot uses avTranscoder in one of its application to transcode media in post-production labs.
191
+
192
+
#### Ploud
193
+
A set of applications developed by [Mikros Image](http://www.mikrosimage.eu/) to analyse, visualize and correct the loudness.
194
+
PADdef / Slingshot uses avTranscoder in [one of its application](https://github.com/mikrosimage/loudness_validator/tree/develop/app/mediaAnalyser) to give decoded data to the loudness analyser.
0 commit comments