diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2022-07-06 23:45:24 +0200 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2022-07-18 00:32:57 +0200 |
commit | 2f0d45571b5290f2cc7269cc74bfb5af139eff3e (patch) | |
tree | 6b45002efc01146a45b607d2cc410d78c90d5532 /libavdevice/lavfi.c | |
parent | 6ca43a9675d651d7ea47c7ba2fafb1bf831c4d0b (diff) | |
download | ffmpeg-2f0d45571b5290f2cc7269cc74bfb5af139eff3e.tar.gz |
avdevice/lavfi: pass forward video framerate
Diffstat (limited to 'libavdevice/lavfi.c')
-rw-r--r-- | libavdevice/lavfi.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c index 1b282a70cb..246f7dff3b 100644 --- a/libavdevice/lavfi.c +++ b/libavdevice/lavfi.c @@ -287,6 +287,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) for (i = 0; i < lavfi->nb_sinks; i++) { AVFilterContext *sink = lavfi->sinks[lavfi->stream_sink_map[i]]; AVRational time_base = av_buffersink_get_time_base(sink); + AVRational frame_rate = av_buffersink_get_frame_rate(sink); AVStream *st = avctx->streams[i]; AVCodecParameters *const par = st->codecpar; avpriv_set_pts_info(st, 64, time_base.num, time_base.den); @@ -299,6 +300,10 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) avctx->probesize = FFMAX(avctx->probesize, sizeof(AVFrame) * 30); st ->sample_aspect_ratio = par->sample_aspect_ratio = av_buffersink_get_sample_aspect_ratio(sink); + if (frame_rate.num > 0 && frame_rate.den > 0) { + st->avg_frame_rate = frame_rate; + st->r_frame_rate = frame_rate; + } } else if (par->codec_type == AVMEDIA_TYPE_AUDIO) { par->sample_rate = av_buffersink_get_sample_rate(sink); ret = av_buffersink_get_ch_layout(sink, &par->ch_layout); |