[FFmpeg-devel] [PATCH] avfilter: add starfield video source
Moritz Barsnick
barsnick at gmx.net
Wed Sep 20 16:21:23 EEST 2017
On Thu, Sep 07, 2017 at 21:29:33 +0200, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
Works fine for me.
> libavfilter/Makefile | 1 +
> libavfilter/allfilters.c | 1 +
> libavfilter/vsrc_starfield.c | 191 +++++++++++++++++++++++++++++++++++++++++++
Missing some texi documentation.
> +static const AVOption starfield_options[] = {
> + { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "hd720"}, 0, 0, FLAGS },
> + { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, FLAGS },
When using this, I immediately missed the usual vsrc option
abbreviations "s" and "r", respectively.
> + { "stars", "set stars number", OFFSET(nb_stars), AV_OPT_TYPE_INT, {.i64 = 1024}, 1, 81920, FLAGS },
"number of stars"?
> + { "speed", "set speed", OFFSET(speed), AV_OPT_TYPE_RATIONAL, {.dbl = 1.01}, 1, 2, FLAGS },
Why 1.01 and not 1.0? (Just wondering.)
> + .description = NULL_IF_CONFIG_SMALL("Create retro 3D star field."),
Nice, "retro". :-) (I don't mind at all, I just had to giggle and
wonder why a star field would be considered retro.)
Functionally: The stars seem to jump from one pixel location to the
next, and not interpolate across pixels - very unsmooth and annoying.
This is quite obvious e.g. if you create the video at 360x240, and view
it several times as large. The anti-aliasing might be a future enhancement
though.
Other "features" might be configurable fore/background colors, star
size (is that random right now?), and stuff...
Question: Why do the stars appear white(-ish), although their R, G, B
components are each randomly initialized?
Moritz
More information about the ffmpeg-devel
mailing list