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

Unified · Split

2 files
  1. libavfilter/setpts.c +16 −1
  2. tests/ref/fate/filter-setpts +51 −38
libavfilter/setpts.c+16−1
@@ -150,6 +150,13 @@ static int config_input(AVFilterLink *inlink) · 149 unmodified lines
150 return 0;150 return 0;
151}151}
152 152
153static int config_output_video(AVFilterLink *outlink)
154{
155 outlink->frame_rate = (AVRational){ 1, 0 };
156
157 return 0;
158}
159
153#define BUF_SIZE 64160#define BUF_SIZE 64
154 161
155static inline char *double2int64str(char *buf, double v)162static 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
332static const AVFilterPad outputs_video[] = {
333 {
334 .name = "default",
335 .type = AVMEDIA_TYPE_VIDEO,
336 .config_props = config_output_video,
337 },
338};
339
325const AVFilter ff_vf_setpts = {340const 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
tests/ref/fate/filter-setpts+51−38
@@ -1,42 +1,55 @@
1#tb 0: 1/251#tb 0: 1/1000
2#media_type 0: video2#media_type 0: video
3#codec_id 0: rawvideo3#codec_id 0: rawvideo
4#dimensions 0: 352x2884#dimensions 0: 352x288
5#sar 0: 0/15#sar 0: 0/1
60, 0, 0, 1, 152064, 0x05b789ef60, 0, 0, 40, 152064, 0x05b789ef
70, 1, 1, 1, 152064, 0x4bb4655170, 28, 28, 40, 152064, 0x4bb46551
80, 2, 2, 1, 152064, 0x9dddf64a80, 57, 57, 40, 152064, 0x9dddf64a
90, 3, 3, 1, 152064, 0x2a8380b090, 86, 86, 40, 152064, 0x2a8380b0
100, 4, 4, 1, 152064, 0x4de3b652100, 115, 115, 40, 152064, 0x4de3b652
110, 5, 5, 1, 152064, 0xedb5a8e6110, 144, 144, 40, 152064, 0xedb5a8e6
120, 6, 6, 1, 152064, 0x5ab58bac120, 172, 172, 40, 152064, 0xe20f7c23
130, 7, 7, 1, 152064, 0x1f1b8026130, 201, 201, 40, 152064, 0x5ab58bac
140, 8, 8, 1, 152064, 0x91373915140, 229, 229, 40, 152064, 0x1f1b8026
150, 9, 9, 1, 152064, 0x30f5fcd5150, 258, 258, 40, 152064, 0x91373915
160, 10, 10, 1, 152064, 0xc711ad61160, 286, 286, 40, 152064, 0x02344760
170, 11, 11, 1, 152064, 0x52a48ddd170, 314, 314, 40, 152064, 0x30f5fcd5
180, 12, 12, 1, 152064, 0xa91c0f05180, 343, 343, 40, 152064, 0xc711ad61
190, 13, 13, 1, 152064, 0x8e364e18190, 371, 371, 40, 152064, 0x24eca223
200, 14, 14, 1, 152064, 0xf25f6acc200, 399, 399, 40, 152064, 0x52a48ddd
210, 15, 15, 1, 152064, 0xf34ddbff210, 427, 427, 40, 152064, 0xa91c0f05
220, 16, 16, 1, 152064, 0x9dc72412220, 456, 456, 40, 152064, 0x8e364e18
230, 17, 17, 1, 152064, 0x445d1d59230, 484, 484, 40, 152064, 0xb15d38c8
240, 18, 18, 1, 152064, 0x2f2768ef240, 512, 512, 40, 152064, 0xf25f6acc
250, 19, 19, 1, 152064, 0x95579936250, 541, 541, 40, 152064, 0xf34ddbff
260, 20, 20, 1, 152064, 0x43d796b5260, 570, 570, 40, 152064, 0xfc7bf570
270, 21, 21, 1, 152064, 0x76d2a455270, 598, 598, 40, 152064, 0x9dc72412
280, 22, 22, 1, 152064, 0x6dc3650e280, 627, 627, 40, 152064, 0x445d1d59
290, 23, 23, 1, 152064, 0x0f9d6aca290, 656, 656, 40, 152064, 0x2f2768ef
300, 24, 24, 1, 152064, 0xd766fc8d300, 685, 685, 40, 152064, 0xce09f9d6
310, 25, 25, 1, 152064, 0xe22f7a30310, 714, 714, 40, 152064, 0x95579936
320, 26, 26, 1, 152064, 0xfa8d94fb320, 743, 743, 40, 152064, 0x43d796b5
330, 27, 27, 1, 152064, 0x4c9737ab330, 772, 772, 40, 152064, 0xd780d887
340, 28, 28, 1, 152064, 0xa50d01f8340, 800, 800, 40, 152064, 0x76d2a455
350, 29, 29, 1, 152064, 0x88734edd350, 829, 829, 40, 152064, 0x6dc3650e
360, 30, 30, 1, 152064, 0xd2735925360, 858, 858, 40, 152064, 0x0f9d6aca
370, 31, 31, 1, 152064, 0x20cebfa9370, 887, 887, 40, 152064, 0xe295c51e
380, 32, 32, 1, 152064, 0x575c20ec380, 915, 915, 40, 152064, 0xd766fc8d
390, 33, 33, 1, 152064, 0x61b47e73390, 944, 944, 40, 152064, 0xe22f7a30
400, 34, 34, 1, 152064, 0x09ef53ff400, 972, 972, 40, 152064, 0x7fea4378
410, 35, 35, 1, 152064, 0x6e88c5c2410, 1000, 1000, 40, 152064, 0xfa8d94fb
420, 36, 36, 1, 152064, 0x4bbad8ea420, 1029, 1029, 40, 152064, 0x4c9737ab
430, 1057, 1057, 40, 152064, 0xa50d01f8
440, 1085, 1085, 40, 152064, 0x0b07594c
450, 1113, 1113, 40, 152064, 0x88734edd
460, 1142, 1142, 40, 152064, 0xd2735925
470, 1170, 1170, 40, 152064, 0xd4e49e08
480, 1198, 1198, 40, 152064, 0x20cebfa9
490, 1227, 1227, 40, 152064, 0x575c20ec
500, 1255, 1255, 40, 152064, 0xfd500471
510, 1284, 1284, 40, 152064, 0x61b47e73
520, 1313, 1313, 40, 152064, 0x09ef53ff
530, 1341, 1341, 40, 152064, 0x6e88c5c2
540, 1370, 1370, 40, 152064, 0xbb87b483
550, 1399, 1399, 40, 152064, 0x4bbad8ea

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