- s->format = bd_video_format(st->codec->width, st->codec->height, ilace);
- s->rate = bd_video_rate(!st->codec->framerate.den ? 0 :
- (double)st->codec->framerate.num / st->codec->framerate.den);
- s->aspect = bd_aspect_ratio(st->codec->width, st->codec->height,
+ s->format = bd_video_format(st->codecpar->width, st->codecpar->height, ilace);
+ AVRational framerate = av_guess_frame_rate(fmt_ctx, st, 0);
+ s->rate = bd_video_rate(!framerate.den ? 0 : (double)framerate.num / framerate.den);
+ s->aspect = bd_aspect_ratio(st->codecpar->width, st->codecpar->height,