show stream time bases

This commit is contained in:
Josh Holtrop 2014-12-09 13:50:44 -05:00
parent 7de3460728
commit 5e45f859a5

11
hello.c
View File

@ -30,6 +30,15 @@ int main(int argc, char * argv[])
int audio_stream_idx = av_find_best_stream(context, AVMEDIA_TYPE_AUDIO, -1, -1, NULL, 0);
printf("Audio stream index: %d\n", audio_stream_idx);
if (video_stream_idx >= 0)
printf("Video stream time_base: %d/%d\n",
context->streams[video_stream_idx]->time_base.num,
context->streams[video_stream_idx]->time_base.den);
if (audio_stream_idx >= 0)
printf("Audio stream time_base: %d/%d\n",
context->streams[audio_stream_idx]->time_base.num,
context->streams[audio_stream_idx]->time_base.den);
AVPacket pkt;
av_init_packet(&pkt);
@ -58,7 +67,7 @@ int main(int argc, char * argv[])
max_audio_size = pkt.size;
}
}
printf("Saw %d frames: %d video and %d audio (%d other)\n",
printf("There are %d frames: %d video and %d audio (%d other)\n",
n_total_frames, n_video_frames, n_audio_frames,
n_total_frames - n_video_frames - n_audio_frames);
printf("Video size: %d, max: %d, average: %d\n",