Skip to content

Commit 604d7a8

Browse files
author
Clement Champetier
committed
VideoProperties: update log when estimate bitrate / duration
1 parent b112ba8 commit 604d7a8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/AvTranscoder/properties/VideoProperties.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,11 @@ size_t VideoProperties::getBitRate() const
338338
// return bit rate of stream if present or VBR mode
339339
if(_codecContext->bit_rate || _codecContext->rc_max_rate)
340340
return _codecContext->bit_rate;
341+
LOG_WARN("The bitrate of the stream '" << _streamIndex << "' of file '" << _formatContext->filename << "' is unknown.")
341342

342343
if(_levelAnalysis == eAnalyseLevelHeader)
343344
{
344-
LOG_WARN("The bitrate of the stream '" << _streamIndex << "' of file '" << _formatContext->filename << "' is unknown. "
345-
"Need a deeper analysis: see eAnalyseLevelFirstGop.")
345+
LOG_INFO("Need a deeper analysis: see eAnalyseLevelFirstGop.")
346346
return 0;
347347
}
348348

@@ -457,16 +457,14 @@ float VideoProperties::getDuration() const
457457
const float duration = StreamProperties::getDuration();
458458
if(duration != 0)
459459
return duration;
460+
LOG_WARN("The duration of the stream '" << _streamIndex << "' of file '" << _formatContext->filename << "' is unknown.")
460461

461462
if(_fileProperties->isRawFormat())
462463
{
463-
LOG_INFO("Get the stream bitrate to compute the duration.")
464+
LOG_INFO("Estimate the duration from the file size and the bitrate.")
464465
const size_t bitRate = getBitRate();
465466
if(bitRate)
466-
{
467-
LOG_INFO("Get the file size to compute the duration.")
468467
return _fileProperties->getFileSize() / bitRate * 8;
469-
}
470468
}
471469
return 0;
472470
}

0 commit comments

Comments
 (0)