File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -291,4 +291,13 @@ void OutputFile::setProfile( const ProfileLoader::Profile& profile )
291
291
}
292
292
}
293
293
294
+ double OutputFile::getProgressDuration ()
295
+ {
296
+ AVStream* firstOutputStream = _formatContext->streams [0 ];
297
+ if ( firstOutputStream == NULL )
298
+ throw std::runtime_error ( " at least one stream must be set to get the progress duration" );
299
+ double duration = av_q2d ( firstOutputStream->time_base ) * firstOutputStream->cur_dts ;
300
+ return duration;
301
+ }
302
+
294
303
}
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ class AvExport OutputFile
110
110
virtual void setVerbose ( bool verbose = false ){ _verbose = verbose; }
111
111
112
112
AVFormatContext& getFormatContext () { return *_formatContext; }
113
+ double getProgressDuration ();
113
114
114
115
private:
115
116
std::vector<AvOutputStream*> _outputStreams;
You can’t perform that action at this time.
0 commit comments