Skip to content

Commit 20ca6ed

Browse files
adding audio metadata printing in demo application
1 parent f393222 commit 20ca6ed

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

app/avTranscoder/avTranscoder.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ int main( int argc, char** argv )
4848
input.getProperties().videoStreams.at(videoStreamIndex).sar.den << std::endl;
4949
std::cout << "display aspect ratio : " << input.getProperties().videoStreams.at(videoStreamIndex).dar.num << "/" <<
5050
input.getProperties().videoStreams.at(videoStreamIndex).dar.den << std::endl;
51+
std::cout << "pixel type : " << input.getProperties().videoStreams.at(videoStreamIndex).pixelName << std::endl;
52+
std::cout << "number of components : " << input.getProperties().videoStreams.at(videoStreamIndex).componentsCount << std::endl;
5153

5254
std::cout << "gop : ";
5355
for( size_t frameIndex = 0; frameIndex < input.getProperties().videoStreams.at(videoStreamIndex).gopStructure.size(); ++frameIndex )
@@ -56,7 +58,18 @@ int main( int argc, char** argv )
5658
std::cout << ( input.getProperties().videoStreams.at(videoStreamIndex).gopStructure.at( frameIndex ).second ? "*" : " " );
5759
}
5860
std::cout << std::endl;
59-
61+
}
62+
for( size_t audioStreamIndex = 0; audioStreamIndex < input.getProperties().audioStreams.size(); ++audioStreamIndex )
63+
{
64+
std::cout << "---------- Audio stream " << audioStreamIndex << " ----------" << std::endl;
65+
std::cout << "codec name : " << input.getProperties().audioStreams.at(audioStreamIndex).codecName << std::endl;
66+
std::cout << "codec long name : " << input.getProperties().audioStreams.at(audioStreamIndex).codecLongName << std::endl;
67+
std::cout << "sample format : " << input.getProperties().audioStreams.at(audioStreamIndex).sampleFormat << std::endl;
68+
std::cout << "codec id : " << input.getProperties().audioStreams.at(audioStreamIndex).codecId << std::endl;
69+
std::cout << "stream id : " << input.getProperties().audioStreams.at(audioStreamIndex).streamId << std::endl;
70+
std::cout << "sample rate : " << input.getProperties().audioStreams.at(audioStreamIndex).sampleRate << std::endl;
71+
std::cout << "channels : " << input.getProperties().audioStreams.at(audioStreamIndex).channels << std::endl;
72+
std::cout << "bit rate : " << input.getProperties().audioStreams.at(audioStreamIndex).bit_rate << std::endl;
6073
}
6174

6275
// init video decoders

0 commit comments

Comments
 (0)