[FFmpeg-devel] Filters

JULIAN GARDNER joolzg at btinternet.com
Fri Jul 18 13:56:17 CEST 2014


>________________________________
> From: Clément Bœsch <u at pkh.me>
>To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org> 
>Sent: Friday, 18 July 2014, 13:38
>Subject: Re: [FFmpeg-devel] Filters
> 
>
>On Fri, Jul 18, 2014 at 12:08:41PM +0100, JULIAN GARDNER wrote:
>> How do I fix a filter so that it takes in 1 input but has no output, this is part of a project and this part is a detection filter, it does nothing else.
>> 
>> The problem at the moment is that with the current filter, based on drawbox, is that it produces an output which i need to the use overlay to dump.
>> 
>> Is there a video filter which has 1 input but 0 outputs
>
>Just make a passthrough filtering (ff_filter_frame(in)), and do not map
>its output
>


Can you elaborate a bit more as I have this code as my base code


static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
{
    DrawBoxContext *s = inlink->dst->priv;
    int plane, x, y, xb = s->x, yb = s->y;
    unsigned char *row[4];

    // Detect Stationary Object
    ....

    // Here I would like to dump the frame as it is no longer needed

    return ff_filter_frame(inlink->dst->outputs[0], frame);
}



AVFILTER_DEFINE_CLASS(detection);

static const AVFilterPad detection_inputs[] = {
    {
        .name = "default",
        .type = AVMEDIA_TYPE_VIDEO,
        .config_props = config_input,
        .filter_frame = filter_frame,    },
    { NULL }
};

static const AVFilterPad detection_outputs[] = {
    {
        .name = "default",
        .type = AVMEDIA_TYPE_VIDEO,
    },
    { NULL }
};

AVFilter ff_vf_detection = {
    .name = "detection",
    .description = NULL_IF_CONFIG_SMALL("detects Stationary Object."),
    .priv_size = sizeof(DetectionContext),
    .priv_class = &detect_class,
    .init = init,
    .query_formats = query_formats,
    .inputs = detect_inputs,
    .outputs = detect_outputs,
    .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
};


More information about the ffmpeg-devel mailing list