Skip to content

Instantly share code, notes, and snippets.

@nakaly
Created January 29, 2017 22:07
Show Gist options
  • Save nakaly/0c7a0e9cbe570a2374759e9d18e3b82f to your computer and use it in GitHub Desktop.
Save nakaly/0c7a0e9cbe570a2374759e9d18e3b82f to your computer and use it in GitHub Desktop.
filter_frame in vf_copy
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
{
AVFilterLink *outlink = inlink->dst->outputs[0];
AVFrame *out = ff_get_video_buffer(outlink, in->width, in->height);
if (!out) {
av_frame_free(&in);
return AVERROR(ENOMEM);
}
av_frame_copy_props(out, in);
av_frame_copy(out, in);
av_frame_free(&in);
return ff_filter_frame(outlink, out);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment