Skip to content

Commit efccced

Browse files
author
Clement Champetier
committed
VideoProperties: skip GOP decoding to estimate the bitrate when analysing only the header
1 parent 103c33f commit efccced

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/AvTranscoder/properties/VideoProperties.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,12 @@ size_t VideoProperties::getBitRate() const
328328
if(_codecContext->bit_rate || _codecContext->rc_max_rate)
329329
return _codecContext->bit_rate;
330330

331-
LOG_WARN("The bitrate of the stream '" << _streamIndex << "' of file '" << _formatContext->filename << "' is unknown.")
331+
if(_levelAnalysis == eAnalyseLevelHeader)
332+
{
333+
LOG_WARN("The bitrate of the stream '" << _streamIndex << "' of file '" << _formatContext->filename << "' is unknown.")
334+
return 0;
335+
}
336+
332337
LOG_INFO("Compute the video bitrate by decoding the first GOP.")
333338

334339
if(!_codecContext->width || !_codecContext->height)

0 commit comments

Comments
 (0)