This filter produces VFR output in general. Avoids dropping frames in the setpts test.
Unified · Split
| @@ -150,6 +150,13 @@ static int config_input(AVFilterLink *inlink) · 149 unmodified lines | ||
| 150 | 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 | 160 | #define BUF_SIZE 64 |
| 154 | 161 | |
| 155 | 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 | 340 | const AVFilter ff_vf_setpts = { |
| 326 | 341 | .name = "setpts", |
| 327 | 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 | 350 | .priv_class = &setpts_class, |
| 336 | 351 | |
| 337 | 352 | FILTER_INPUTS(avfilter_vf_setpts_inputs), |
| 338 | − FILTER_OUTPUTS(ff_video_default_filterpad), | |
| 353 | + FILTER_OUTPUTS(outputs_video), | |
| 339 | 354 | }; |
| 340 | 355 | #endif /* CONFIG_SETPTS_FILTER */ |
| 341 | 356 | |
| @@ -1,42 +1,55 @@ | ||
| 1 | −#tb 0: 1/25 | |
| 1 | +#tb 0: 1/1000 | |
| 2 | 2 | #media_type 0: video |
| 3 | 3 | #codec_id 0: rawvideo |
| 4 | 4 | #dimensions 0: 352x288 |
| 5 | 5 | #sar 0: 0/1 |
| 6 | −0, 0, 0, 1, 152064, 0x05b789ef | |
| 7 | −0, 1, 1, 1, 152064, 0x4bb46551 | |
| 8 | −0, 2, 2, 1, 152064, 0x9dddf64a | |
| 9 | −0, 3, 3, 1, 152064, 0x2a8380b0 | |
| 10 | −0, 4, 4, 1, 152064, 0x4de3b652 | |
| 11 | −0, 5, 5, 1, 152064, 0xedb5a8e6 | |
| 12 | −0, 6, 6, 1, 152064, 0x5ab58bac | |
| 13 | −0, 7, 7, 1, 152064, 0x1f1b8026 | |
| 14 | −0, 8, 8, 1, 152064, 0x91373915 | |
| 15 | −0, 9, 9, 1, 152064, 0x30f5fcd5 | |
| 16 | −0, 10, 10, 1, 152064, 0xc711ad61 | |
| 17 | −0, 11, 11, 1, 152064, 0x52a48ddd | |
| 18 | −0, 12, 12, 1, 152064, 0xa91c0f05 | |
| 19 | −0, 13, 13, 1, 152064, 0x8e364e18 | |
| 20 | −0, 14, 14, 1, 152064, 0xf25f6acc | |
| 21 | −0, 15, 15, 1, 152064, 0xf34ddbff | |
| 22 | −0, 16, 16, 1, 152064, 0x9dc72412 | |
| 23 | −0, 17, 17, 1, 152064, 0x445d1d59 | |
| 24 | −0, 18, 18, 1, 152064, 0x2f2768ef | |
| 25 | −0, 19, 19, 1, 152064, 0x95579936 | |
| 26 | −0, 20, 20, 1, 152064, 0x43d796b5 | |
| 27 | −0, 21, 21, 1, 152064, 0x76d2a455 | |
| 28 | −0, 22, 22, 1, 152064, 0x6dc3650e | |
| 29 | −0, 23, 23, 1, 152064, 0x0f9d6aca | |
| 30 | −0, 24, 24, 1, 152064, 0xd766fc8d | |
| 31 | −0, 25, 25, 1, 152064, 0xe22f7a30 | |
| 32 | −0, 26, 26, 1, 152064, 0xfa8d94fb | |
| 33 | −0, 27, 27, 1, 152064, 0x4c9737ab | |
| 34 | −0, 28, 28, 1, 152064, 0xa50d01f8 | |
| 35 | −0, 29, 29, 1, 152064, 0x88734edd | |
| 36 | −0, 30, 30, 1, 152064, 0xd2735925 | |
| 37 | −0, 31, 31, 1, 152064, 0x20cebfa9 | |
| 38 | −0, 32, 32, 1, 152064, 0x575c20ec | |
| 39 | −0, 33, 33, 1, 152064, 0x61b47e73 | |
| 40 | −0, 34, 34, 1, 152064, 0x09ef53ff | |
| 41 | −0, 35, 35, 1, 152064, 0x6e88c5c2 | |
| 42 | −0, 36, 36, 1, 152064, 0x4bbad8ea | |
| 6 | +0, 0, 0, 40, 152064, 0x05b789ef | |
| 7 | +0, 28, 28, 40, 152064, 0x4bb46551 | |
| 8 | +0, 57, 57, 40, 152064, 0x9dddf64a | |
| 9 | +0, 86, 86, 40, 152064, 0x2a8380b0 | |
| 10 | +0, 115, 115, 40, 152064, 0x4de3b652 | |
| 11 | +0, 144, 144, 40, 152064, 0xedb5a8e6 | |
| 12 | +0, 172, 172, 40, 152064, 0xe20f7c23 | |
| 13 | +0, 201, 201, 40, 152064, 0x5ab58bac | |
| 14 | +0, 229, 229, 40, 152064, 0x1f1b8026 | |
| 15 | +0, 258, 258, 40, 152064, 0x91373915 | |
| 16 | +0, 286, 286, 40, 152064, 0x02344760 | |
| 17 | +0, 314, 314, 40, 152064, 0x30f5fcd5 | |
| 18 | +0, 343, 343, 40, 152064, 0xc711ad61 | |
| 19 | +0, 371, 371, 40, 152064, 0x24eca223 | |
| 20 | +0, 399, 399, 40, 152064, 0x52a48ddd | |
| 21 | +0, 427, 427, 40, 152064, 0xa91c0f05 | |
| 22 | +0, 456, 456, 40, 152064, 0x8e364e18 | |
| 23 | +0, 484, 484, 40, 152064, 0xb15d38c8 | |
| 24 | +0, 512, 512, 40, 152064, 0xf25f6acc | |
| 25 | +0, 541, 541, 40, 152064, 0xf34ddbff | |
| 26 | +0, 570, 570, 40, 152064, 0xfc7bf570 | |
| 27 | +0, 598, 598, 40, 152064, 0x9dc72412 | |
| 28 | +0, 627, 627, 40, 152064, 0x445d1d59 | |
| 29 | +0, 656, 656, 40, 152064, 0x2f2768ef | |
| 30 | +0, 685, 685, 40, 152064, 0xce09f9d6 | |
| 31 | +0, 714, 714, 40, 152064, 0x95579936 | |
| 32 | +0, 743, 743, 40, 152064, 0x43d796b5 | |
| 33 | +0, 772, 772, 40, 152064, 0xd780d887 | |
| 34 | +0, 800, 800, 40, 152064, 0x76d2a455 | |
| 35 | +0, 829, 829, 40, 152064, 0x6dc3650e | |
| 36 | +0, 858, 858, 40, 152064, 0x0f9d6aca | |
| 37 | +0, 887, 887, 40, 152064, 0xe295c51e | |
| 38 | +0, 915, 915, 40, 152064, 0xd766fc8d | |
| 39 | +0, 944, 944, 40, 152064, 0xe22f7a30 | |
| 40 | +0, 972, 972, 40, 152064, 0x7fea4378 | |
| 41 | +0, 1000, 1000, 40, 152064, 0xfa8d94fb | |
| 42 | +0, 1029, 1029, 40, 152064, 0x4c9737ab | |
| 43 | +0, 1057, 1057, 40, 152064, 0xa50d01f8 | |
| 44 | +0, 1085, 1085, 40, 152064, 0x0b07594c | |
| 45 | +0, 1113, 1113, 40, 152064, 0x88734edd | |
| 46 | +0, 1142, 1142, 40, 152064, 0xd2735925 | |
| 47 | +0, 1170, 1170, 40, 152064, 0xd4e49e08 | |
| 48 | +0, 1198, 1198, 40, 152064, 0x20cebfa9 | |
| 49 | +0, 1227, 1227, 40, 152064, 0x575c20ec | |
| 50 | +0, 1255, 1255, 40, 152064, 0xfd500471 | |
| 51 | +0, 1284, 1284, 40, 152064, 0x61b47e73 | |
| 52 | +0, 1313, 1313, 40, 152064, 0x09ef53ff | |
| 53 | +0, 1341, 1341, 40, 152064, 0x6e88c5c2 | |
| 54 | +0, 1370, 1370, 40, 152064, 0xbb87b483 | |
| 55 | +0, 1399, 1399, 40, 152064, 0x4bbad8ea | |