Skip to content

Commit 1aa162d

Browse files
adding essence Timecode extraction and min bit rate
1 parent 514fc5f commit 1aa162d

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

app/avMeta/avMeta.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,17 @@ void displayMetadatas( const char* filename )
6464
std::cout << std::setw( keyWidth ) << "height" << ": " << input.getProperties().videoStreams.at(videoStreamIndex).height << std::endl;
6565
std::cout << std::setw( keyWidth ) << "dtgActiveFormat" << ": " << input.getProperties().videoStreams.at(videoStreamIndex).dtgActiveFormat << std::endl;
6666

67+
68+
std::cout << std::setw( keyWidth ) << "start timecode" << ": " << input.getProperties().videoStreams.at(videoStreamIndex).startTimecode << std::endl;
6769
std::cout << std::setw( keyWidth ) << "timeBase" << ": " << input.getProperties().videoStreams.at(videoStreamIndex).timeBase.num << "/" <<
68-
input.getProperties().videoStreams.at(videoStreamIndex).timeBase.den << std::endl;
70+
input.getProperties().videoStreams.at(videoStreamIndex).timeBase.den << std::endl;
6971
std::cout << std::setw( keyWidth ) << "fps" << ": " << input.getProperties().videoStreams.at(videoStreamIndex).fps << std::endl;
7072
std::cout << std::setw( keyWidth ) << "ticksPerFrame" << ": " << input.getProperties().videoStreams.at(videoStreamIndex).ticksPerFrame << std::endl;
7173

7274
std::cout << std::setw( keyWidth ) << "pixel aspect ratio" << ": " << input.getProperties().videoStreams.at(videoStreamIndex).sar.num << "/" <<
73-
input.getProperties().videoStreams.at(videoStreamIndex).sar.den << std::endl;
75+
input.getProperties().videoStreams.at(videoStreamIndex).sar.den << std::endl;
7476
std::cout << std::setw( keyWidth ) << "display aspect ratio" << ": " << input.getProperties().videoStreams.at(videoStreamIndex).dar.num << "/" <<
75-
input.getProperties().videoStreams.at(videoStreamIndex).dar.den << std::endl;
77+
input.getProperties().videoStreams.at(videoStreamIndex).dar.den << std::endl;
7678
std::cout << std::setw( keyWidth ) << "pixel type" << ": " << input.getProperties().videoStreams.at(videoStreamIndex).pixelName << std::endl;
7779
std::cout << std::setw( keyWidth ) << "bit wise acked" << ": " << ( input.getProperties().videoStreams.at(videoStreamIndex).bitWisePacked ? "True" : "False" ) << std::endl;
7880
std::cout << std::setw( keyWidth ) << "rgb pixel" << ": " << ( input.getProperties().videoStreams.at(videoStreamIndex).rgbPixelData ? "True" : "False" ) << std::endl;
@@ -81,6 +83,7 @@ void displayMetadatas( const char* filename )
8183

8284
std::cout << std::setw( keyWidth ) << "bit rate" << ": " << input.getProperties().videoStreams.at(videoStreamIndex).bitRate << std::endl;
8385
std::cout << std::setw( keyWidth ) << "max bit rate" << ": " << input.getProperties().videoStreams.at(videoStreamIndex).maxBitRate << std::endl;
86+
std::cout << std::setw( keyWidth ) << "min bit rate" << ": " << input.getProperties().videoStreams.at(videoStreamIndex).minBitRate << std::endl;
8487

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

src/AvTranscoder/Metadatas/MediaMetadatasStructures.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ struct VideoProperties {
3131
std::string pixelName;
3232
std::string endianess;
3333

34+
std::string startTimecode;
35+
3436
Ratio timeBase;
3537
Ratio sar; // sample/pixel aspect ratio
3638
Ratio dar; // display aspect ratio
@@ -39,6 +41,7 @@ struct VideoProperties {
3941
size_t codecId;
4042
size_t bitRate;
4143
size_t maxBitRate;
44+
size_t minBitRate;
4245
size_t ticksPerFrame;
4346
size_t width;
4447
size_t height;

src/AvTranscoder/Metadatas/VideoStreamProperties.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ VideoProperties videoStreamInfo( AVFormatContext* formatContext, const size_t in
8787
vp.codecId = codec_context->codec_id;
8888
vp.bitRate = codec_context->bit_rate;
8989
vp.maxBitRate = codec_context->rc_max_rate;
90+
vp.minBitRate = codec_context->rc_min_rate;
9091
vp.isInterlaced = false;
9192

9293
vp.ticksPerFrame = codec_context->ticks_per_frame,
@@ -103,6 +104,12 @@ VideoProperties videoStreamInfo( AVFormatContext* formatContext, const size_t in
103104
vp.sar.num = codec_context->sample_aspect_ratio.num;
104105
vp.sar.den = codec_context->sample_aspect_ratio.den;
105106

107+
108+
char tcbuf[AV_TIMECODE_STR_SIZE];
109+
av_timecode_make_mpeg_tc_string( tcbuf, codec_context->timecode_frame_start );
110+
std::string videoTimecode( tcbuf );
111+
vp.startTimecode = videoTimecode;
112+
106113
int darNum, darDen;
107114
av_reduce( &darNum, &darDen,
108115
codec_context->width * codec_context->sample_aspect_ratio.num,

0 commit comments

Comments
 (0)