File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
src/AvTranscoder/properties Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 6
6
7
7
#include < stdexcept>
8
8
#include < sstream>
9
+ #include < fstream>
9
10
10
11
namespace avtranscoder
11
12
{
@@ -199,6 +200,12 @@ size_t FileProperties::getBitRate() const
199
200
return _avFormatContext->bit_rate ;
200
201
}
201
202
203
+ size_t FileProperties::getFileSize () const
204
+ {
205
+ std::ifstream in (getFilename ().c_str (), std::ios::binary | std::ios::ate);
206
+ return in.tellg ();
207
+ }
208
+
202
209
size_t FileProperties::getPacketSize () const
203
210
{
204
211
if (!_avFormatContext)
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ class AvExport FileProperties
48
48
double getStartTime () const ;
49
49
float getDuration () const ; // /< in seconds, 0 if not available
50
50
size_t getBitRate () const ; // /< total stream bitrate in bit/s, 0 if not available (result of a computation by ffmpeg)
51
+ size_t getFileSize () const ; // /< in bytes
51
52
size_t getPacketSize () const ;
52
53
53
54
const PropertyVector& getMetadatas () const { return _metadatas; }
You can’t perform that action at this time.
0 commit comments