This filter produces VFR output in general. Avoids dropping frames in the setpts test.
Showing the changes to libavfilter (1 of 2 files). Show all
Unified · Split
| @@ -150,6 +150,13 @@ static int config_input(AVFilterLink *inlink) · 149 unmodified lines | |||
| 150 | return 0; | 150 | return 0; |
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | static int config_output_video(AVFilterLink *outlink) | ||
| 154 | { | ||
| 155 | outlink->frame_rate = (AVRational){ 1, 0 }; | ||
| 156 | |||
| 157 | return 0; | ||
| 158 | } | ||
| 159 | |||
| 153 | #define BUF_SIZE 64 | 160 | #define BUF_SIZE 64 |
| 154 | 161 | ||
| 155 | static inline char *double2int64str(char *buf, double v) | 162 | static inline char *double2int64str(char *buf, double v) |
| @@ -322,6 +329,14 @@ static const AVFilterPad avfilter_vf_setpts_inputs[] = { · 166 unmodified lines | |||
| 322 | }, | 329 | }, |
| 323 | }; | 330 | }; |
| 324 | 331 | ||
| 332 | static const AVFilterPad outputs_video[] = { | ||
| 333 | { | ||
| 334 | .name = "default", | ||
| 335 | .type = AVMEDIA_TYPE_VIDEO, | ||
| 336 | .config_props = config_output_video, | ||
| 337 | }, | ||
| 338 | }; | ||
| 339 | |||
| 325 | const AVFilter ff_vf_setpts = { | 340 | const AVFilter ff_vf_setpts = { |
| 326 | .name = "setpts", | 341 | .name = "setpts", |
| 327 | .description = NULL_IF_CONFIG_SMALL("Set PTS for the output video frame."), | 342 | .description = NULL_IF_CONFIG_SMALL("Set PTS for the output video frame."), |
| @@ -335,7 +350,7 @@ const AVFilter ff_vf_setpts = { · 7 unmodified lines | |||
| 335 | .priv_class = &setpts_class, | 350 | .priv_class = &setpts_class, |
| 336 | 351 | ||
| 337 | FILTER_INPUTS(avfilter_vf_setpts_inputs), | 352 | FILTER_INPUTS(avfilter_vf_setpts_inputs), |
| 338 | FILTER_OUTPUTS(ff_video_default_filterpad), | 353 | FILTER_OUTPUTS(outputs_video), |
| 339 | }; | 354 | }; |
| 340 | #endif /* CONFIG_SETPTS_FILTER */ | 355 | #endif /* CONFIG_SETPTS_FILTER */ |
| 341 | 356 | ||