forked from avTranscoder/avTranscoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOutputFile.hpp
More file actions
93 lines (70 loc) · 2.4 KB
/
Copy pathOutputFile.hpp
File metadata and controls
93 lines (70 loc) · 2.4 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#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
{
private:
OutputFile( const OutputFile& outputFile );
OutputFile& operator=( const OutputFile& outputFile );
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 );
/**
* @brief Open ressource and write header.
*/
bool beginWrap();
IOutputStream::EWrappingStatus wrap( const CodedData& data, const size_t streamId );
/**
* @brief Close ressource and write trailer.
*/
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 PropertyVector& data );
void addMetadata( const std::string& key, const std::string& value );
IOutputStream& getStream( const size_t streamId );
std::string getFilename() const { return _filename; }
/**
* @brief A comma separated list of short names for the format, or empty if unknown.
*/
std::string getFormatName() const;
/**
* @brief Descriptive name for the format, meant to be more human-readable than name, or empty if unknown.
*/
std::string getFormatLongName() const;
/**
* @brief Comma-separated list of mime types, or empty if unknown.
*/
std::string getFormatMimeType() const;
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