| @@ -42,6 +42,7 @@ struct thumb_frame { · 41 unmodified lines |
| 42 | typedef struct ThumbContext { | 42 | typedef struct ThumbContext { |
| 43 | const AVClass *class; | 43 | const AVClass *class; |
| 44 | int n; ///< current frame | 44 | int n; ///< current frame |
| | 45 | int loglevel; |
| 45 | int n_frames; ///< number of frames for analysis | 46 | int n_frames; ///< number of frames for analysis |
| 46 | struct thumb_frame *frames; ///< the n_frames frames | 47 | struct thumb_frame *frames; ///< the n_frames frames |
| 47 | AVRational tb; ///< copy of the input timebase to ease access | 48 | AVRational tb; ///< copy of the input timebase to ease access |
| @@ -58,6 +59,10 @@ typedef struct ThumbContext { · 10 unmodified lines |
| 58 | | 59 | |
| 59 | static const AVOption thumbnail_options[] = { | 60 | static const AVOption thumbnail_options[] = { |
| 60 | { "n", "set the frames batch size", OFFSET(n_frames), AV_OPT_TYPE_INT, {.i64=100}, 2, INT_MAX, FLAGS }, | 61 | { "n", "set the frames batch size", OFFSET(n_frames), AV_OPT_TYPE_INT, {.i64=100}, 2, INT_MAX, FLAGS }, |
| | 62 | { "log", "force stats logging level", OFFSET(loglevel), AV_OPT_TYPE_INT, {.i64 = AV_LOG_INFO}, INT_MIN, INT_MAX, FLAGS, "level" }, |
| | 63 | { "quiet", "logging disabled", 0, AV_OPT_TYPE_CONST, {.i64 = AV_LOG_QUIET}, 0, 0, FLAGS, "level" }, |
| | 64 | { "info", "information logging level", 0, AV_OPT_TYPE_CONST, {.i64 = AV_LOG_INFO}, 0, 0, FLAGS, "level" }, |
| | 65 | { "verbose", "verbose logging level", 0, AV_OPT_TYPE_CONST, {.i64 = AV_LOG_VERBOSE}, 0, 0, FLAGS, "level" }, |
| 61 | { NULL } | 66 | { NULL } |
| 62 | }; | 67 | }; |
| 63 | | 68 | |
| @@ -127,9 +132,10 @@ static AVFrame *get_best_frame(AVFilterContext *ctx) · 63 unmodified lines |
| 127 | | 132 | |
| 128 | // raise the chosen one | 133 | // raise the chosen one |
| 129 | picref = s->frames[best_frame_idx].buf; | 134 | picref = s->frames[best_frame_idx].buf; |
| 130 | av_log(ctx, AV_LOG_INFO, "frame id #%d (pts_time=%f) selected " | 135 | if (s->loglevel != AV_LOG_QUIET) |
| 131 | "from a set of %d images\n", best_frame_idx, | 136 | av_log(ctx, s->loglevel, "frame id #%d (pts_time=%f) selected " |
| 132 | picref->pts * av_q2d(s->tb), nb_frames); | 137 | "from a set of %d images\n", best_frame_idx, |
| | 138 | picref->pts * av_q2d(s->tb), nb_frames); |
| 133 | s->frames[best_frame_idx].buf = NULL; | 139 | s->frames[best_frame_idx].buf = NULL; |
| 134 | | 140 | |
| 135 | return picref; | 141 | return picref; |