Skip to content

Commit 4bb9a5f

Browse files
author
Clement Champetier
committed
common: add setLogLevel
1 parent 7bd3b50 commit 4bb9a5f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/AvTranscoder/common.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ void preloadCodecsAndFormats()
1717
av_register_all();
1818
}
1919

20+
void setLogLevel( const int level )
21+
{
22+
av_log_set_level( level );
23+
}
24+
2025
void split( std::vector< std::string >& splitedString, const std::string& inputString, const std::string& splitChars )
2126
{
2227
char* part = strtok( const_cast<char*>( inputString.c_str() ), splitChars.c_str() );

src/AvTranscoder/common.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ extern "C" {
1313
#include <libavcodec/version.h>
1414
#include <libavcodec/avcodec.h>
1515
#include <libavutil/rational.h>
16+
#include <libavutil/log.h>
1617
}
1718

1819
#include <string>
@@ -59,6 +60,12 @@ typedef AVRational Rational;
5960
/// Register all the codecs and formats which are enabled at configuration time.
6061
void AvExport preloadCodecsAndFormats();
6162

63+
/**
64+
* @brief Set the log level of ffmpeg/libav.
65+
* @param level: refer to define AV_LOG_*** (from AV_LOG_QUIET to AV_LOG_MAX_OFFSET)
66+
*/
67+
void AvExport setLogLevel( const int level );
68+
6269
#ifndef SWIG
6370
void split( std::vector< std::string >& splitedString, const std::string& inputString, const std::string& splitChars = ";" );
6471
int getFilesInDir( const std::string& dir, std::vector< std::string >& files );

0 commit comments

Comments
 (0)