forked from mikrosimage/avTranscoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOutputFile.hpp
More file actions
63 lines (48 loc) · 1.72 KB
/
Copy pathOutputFile.hpp
File metadata and controls
63 lines (48 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef _AV_TRANSCODER_FILE_OUTPUT_FILE_HPP_
#define _AV_TRANSCODER_FILE_OUTPUT_FILE_HPP_
#include <AvTranscoder/file/IOutputFile.hpp>
#include <AvTranscoder/mediaProperty/util.hpp>
#include <AvTranscoder/file/FormatContext.hpp>
#include <vector>
namespace avtranscoder
{
/**
* @brief Outputfile is the default implentation of wrapper which uses LibAV/FFMpeg.
**/
class AvExport OutputFile : public IOutputFile
{
public:
/**
* @brief Open an output media file
* @param filename resource to access
**/
OutputFile( const std::string& filename = "" );
~OutputFile();
IOutputStream& addVideoStream( const VideoCodec& videoDesc );
IOutputStream& addAudioStream( const AudioCodec& audioDesc );
IOutputStream& addDataStream( const DataCodec& dataDesc );
bool beginWrap();
IOutputStream::EWrappingStatus wrap( const CodedData& data, const size_t streamId );
bool endWrap();
/**
* @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 std::string& key, const std::string& value );
IOutputStream& getStream( const size_t streamId );
FormatContext& getFormatContext() { return _formatContext; }
/**
* @brief Set the format of the output file
* @param profile: the profile of the output format
*/
void setProfile( const ProfileLoader::Profile& profile );
private:
FormatContext _formatContext;
std::vector<OutputStream*> _outputStreams; ///< Has ownership
std::vector<size_t> _frameCount; ///< Number of wrapped frames
std::string _filename; ///< Output filename
double _previousProcessedStreamDuration; ///< To manage process streams order
};
}
#endif