char *size; ///< video frame size
char *rate; ///< video frame rate
char *duration; ///< total duration of the generated video
+ AVRational sar; ///< sample aspect ratio
+
void (* fill_picture_fn)(AVFilterContext *ctx, AVFilterBufferRef *picref);
/* only used by rgbtest */
{ "rate", "set video rate", OFFSET(rate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0 },
{ "r", "set video rate", OFFSET(rate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0 },
{ "duration", "set video duration", OFFSET(duration), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0 },
+ { "sar", "set video sample aspect ratio", OFFSET(sar), FF_OPT_TYPE_RATIONAL, {.dbl= 1}, 0, INT_MAX },
{ NULL },
};
test->nb_frame = 0;
test->pts = 0;
- av_log(ctx, AV_LOG_INFO, "size:%dx%d rate:%d/%d duration:%f\n",
+ av_log(ctx, AV_LOG_INFO, "size:%dx%d rate:%d/%d duration:%f sar:%d/%d\n",
test->w, test->h, frame_rate_q.num, frame_rate_q.den,
- duration < 0 ? -1 : test->max_pts * av_q2d(test->time_base));
+ duration < 0 ? -1 : test->max_pts * av_q2d(test->time_base),
+ test->sar.num, test->sar.den);
return 0;
}
outlink->w = test->w;
outlink->h = test->h;
+ outlink->sample_aspect_ratio = test->sar;
outlink->time_base = test->time_base;
return 0;
picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
test->w, test->h);
picref->pts = test->pts++;
+ picref->video->sample_aspect_ratio = test->sar;
test->nb_frame++;
test->fill_picture_fn(outlink->src, picref);