@@ -9,8 +9,8 @@ using namespace ffmpegcpp;
99int main ()
1010{
1111 // This example will print info about a video.
12- /* try
13- {*/
12+ try
13+ {
1414
1515 // Load a video from a container and read its info.
1616 const char * fileName = " samples/big_buck_bunny.mp4" ;
@@ -19,6 +19,7 @@ int main()
1919
2020 // Print the data similar to ffmpeg.exe.
2121 cout << " Input " << info.format ->name << " from '" << fileName << " '" << endl;
22+
2223 cout << " Video streams:" << endl;
2324 for (int i = 0 ; i < info.videoStreams .size (); ++i)
2425 {
@@ -34,15 +35,30 @@ int main()
3435 << endl;
3536 }
3637
38+ cout << " Audio streams:" << endl;
39+ for (int i = 0 ; i < info.audioStreams .size (); ++i)
40+ {
41+ AudioStreamInfo stream = info.audioStreams [i];
42+ cout << " Stream #" << (i + 1 )
43+ << " : codec " << stream.codec ->name
44+ << " , channel layout " << stream.channelLayoutName
45+ << " , channels " << stream.channels
46+ << " , bit rate " << stream.bitRate << " kb/s"
47+ << " , sample rate " << stream.sampleRate
48+ << " , time base " << stream.timeBase .num << " /" << stream.timeBase .den
49+ << " , " << demuxer->GetFrameCount (stream.id ) << " frames"
50+ << endl;
51+ }
52+
3753
3854
39- /* }
55+ }
4056 catch (FFmpegException e)
4157 {
4258 cerr << " Exception caught!" << endl;
4359 cerr << e.what () << endl;
4460 throw e;
45- }*/
61+ }
4662
4763 cout << " Encoding complete!" << endl;
4864 cout << " Press any key to continue..." << endl;
0 commit comments