History

lavf/vf_setpts: unset output framerate

This filter produces VFR output in general. Avoids dropping frames in the setpts test.

Anton Khirnov committed 2 years ago

Commit f121d951 parent c240ff92 files · +67 −39Browse files

Showing the changes to libavfilter (1 of 2 files). Show all

Unified · Split

libavfilter/setpts.c+16−1
@@ -150,6 +150,13 @@ static int config_input(AVFilterLink *inlink) · 149 unmodified lines
150150 return 0;
151151 }
152152
153+static int config_output_video(AVFilterLink *outlink)
154+{
155+ outlink->frame_rate = (AVRational){ 1, 0 };
156+
157+ return 0;
158+}
159+
153160 #define BUF_SIZE 64
154161
155162 static inline char *double2int64str(char *buf, double v)
@@ -322,6 +329,14 @@ static const AVFilterPad avfilter_vf_setpts_inputs[] = { · 166 unmodified lines
322329 },
323330 };
324331
332+static const AVFilterPad outputs_video[] = {
333+ {
334+ .name = "default",
335+ .type = AVMEDIA_TYPE_VIDEO,
336+ .config_props = config_output_video,
337+ },
338+};
339+
325340 const AVFilter ff_vf_setpts = {
326341 .name = "setpts",
327342 .description = NULL_IF_CONFIG_SMALL("Set PTS for the output video frame."),
@@ -335,7 +350,7 @@ const AVFilter ff_vf_setpts = { · 7 unmodified lines
335350 .priv_class = &setpts_class,
336351
337352 FILTER_INPUTS(avfilter_vf_setpts_inputs),
338− FILTER_OUTPUTS(ff_video_default_filterpad),
353+ FILTER_OUTPUTS(outputs_video),
339354 };
340355 #endif /* CONFIG_SETPTS_FILTER */
341356

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t