File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed
src/AvTranscoder/mediaProperty Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -516,17 +516,7 @@ int VideoProperties::getLevel() const
516
516
517
517
float VideoProperties::getFps () const
518
518
{
519
- const Rational timeBase = getTimeBase ();
520
- const float fps = timeBase.den / (double ) timeBase.num ;
521
- if ( std::isinf ( fps ) )
522
- {
523
- std::ostringstream os;
524
- os << " unable to retrieve a correct fps (found value: " ;
525
- os << fps;
526
- os << " )" ;
527
- throw std::runtime_error ( os.str () );
528
- }
529
- return fps;
519
+ return av_q2d ( _formatContext->streams [_streamIndex]->avg_frame_rate );
530
520
}
531
521
532
522
bool VideoProperties::hasBFrames () const
Original file line number Diff line number Diff line change @@ -56,11 +56,11 @@ class AvExport VideoProperties : public StreamProperties
56
56
int getLevel () const ;
57
57
58
58
/* *
59
- * @brief Corresponds to the compute of the 'tbn' by ffmpeg.
60
- * tbn = the time base in AVStream that has come from the container
59
+ * @brief Corresponds to the 'fps' returned by ffprobe.
60
+ * fps = the average framerate that has come from the AVStream
61
+ * tbn = the time base in AVStream that has come from the AVStream
61
62
* tbc = the time base in AVCodecContext for the codec used for a particular stream
62
63
* tbr = tbr is guessed from the video stream and is the value users want to see when they look for the video frame rate
63
- * @return
64
64
*/
65
65
float getFps () const ;
66
66
You can’t perform that action at this time.
0 commit comments