Skip to content

Commit 842e096

Browse files
adding MaxRate as a metadata for detecting Mpeg2 bitRate with FFMpeg
1 parent b0d301c commit 842e096

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

app/avMeta/avMeta.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ void displayMetadatas( const char* filename )
8080
std::cout << std::setw( keyWidth ) << "endianess" << ": " << input.getProperties().videoStreams.at(videoStreamIndex).endianess << std::endl;
8181

8282
std::cout << std::setw( keyWidth ) << "bit rate" << ": " << input.getProperties().videoStreams.at(videoStreamIndex).bitRate << std::endl;
83+
std::cout << std::setw( keyWidth ) << "max bit rate" << ": " << input.getProperties().videoStreams.at(videoStreamIndex).maxBitRate << std::endl;
8384

8485
std::cout << std::setw( keyWidth ) << "color transfert" << ": " << input.getProperties().videoStreams.at(videoStreamIndex).colorTransfert << std::endl;
8586
std::cout << std::setw( keyWidth ) << "colorspace" << ": " << input.getProperties().videoStreams.at(videoStreamIndex).colorspace << std::endl;

src/AvTranscoder/Metadatas/MediaMetadatasStructures.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ struct VideoProperties {
3838
size_t streamId;
3939
size_t codecId;
4040
size_t bitRate;
41+
size_t maxBitRate;
4142
size_t ticksPerFrame;
4243
size_t width;
4344
size_t height;

src/AvTranscoder/Metadatas/VideoStreamProperties.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ VideoProperties videoStreamInfo( AVFormatContext* formatContext, const size_t in
8484

8585
vp.codecName = codec_context->codec_name;
8686
vp.codecLongName = codec_context->codec_name;
87+
vp.codecId = codec_context->codec_id;
8788
vp.bitRate = codec_context->bit_rate;
89+
vp.maxBitRate = codec_context->rc_max_rate;
8890
vp.isInterlaced = false;
8991

9092
vp.ticksPerFrame = codec_context->ticks_per_frame,

src/AvTranscoder/common.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ extern "C" {
88
#include <libavutil/version.h>
99
#include <libavformat/version.h>
1010
#include <libavcodec/version.h>
11+
#include <libavcodec/avcodec.h>
1112
}
1213

1314
#include <string>

0 commit comments

Comments
 (0)