aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg_filter.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-05-27 12:32:38 +0200
committerAnton Khirnov <anton@khirnov.net>2023-06-05 16:15:04 +0200
commit568d414074ddb02976d1bf5a491dba3571eafeba (patch)
tree0dc81e008279118ed670227442ec8b68b08b28bd /fftools/ffmpeg_filter.c
parent963034107356cc83a75115644e1516e92c6fa3db (diff)
downloadffmpeg-568d414074ddb02976d1bf5a491dba3571eafeba.tar.gz
fftools/ffmpeg: attach filter framerate to frames
This way the encoder does not need to reach backward into the filter.
Diffstat (limited to 'fftools/ffmpeg_filter.c')
-rw-r--r--fftools/ffmpeg_filter.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 1150f6fc65..a2b45a14b8 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -1711,6 +1711,16 @@ int reap_filters(int flush)
tb.num, tb.den);
}
+ if (ost->type == AVMEDIA_TYPE_VIDEO) {
+ FrameData *fd = frame_data(filtered_frame);
+ if (!fd) {
+ av_frame_unref(filtered_frame);
+ report_and_exit(AVERROR(ENOMEM));
+ }
+
+ fd->frame_rate_filter = av_buffersink_get_frame_rate(filter);
+ }
+
enc_frame(ost, filtered_frame);
av_frame_unref(filtered_frame);
}