[FFmpeg-user] yadif in ffmpeg filter usage
redmember
redmember at nate.com
Wed Jun 13 04:47:46 CEST 2012
thanks. replay
The following are additional questions
I using window OS
ffmpeg builed on Windows (for MinGW) and developing MS Visual studio (C++)
I tried to.. below source code (for ffmpeg example)
// init filter code
************************************************************
***Q1 : if using yadif filter, how to make filter. below code was not
working in "avfilter_graph_config"
AVFilter *yadif = avfilter_get_by_name("yadif");
AVFilter *buffersink = avfilter_get_by_name("buffersink");
************************************************************
AVFilterInOut *pSrc = avfilter_inout_alloc();
AVFilterInOut *pBuffer = avfilter_inout_alloc();
enum PixelFormat pix_fmts[] = { PIX_FMT_GRAY8, PIX_FMT_NONE };
filter_graph = avfilter_graph_alloc();
sprintf_s(args, sizeof(args), "%d:%d:%d:%d:%d:%d:%d",
dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt,
dec_ctx->time_base.num, dec_ctx->time_base.den,
dec_ctx->sample_aspect_ratio.num, dec_ctx->sample_aspect_ratio.den);
ret = avfilter_graph_create_filter(&in_ctx, yadif, "in", args, NULL,
filter_graph);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot create \n");
return ret;
}
ret = avfilter_graph_create_filter(&out_ctx, buffersink, "out", NULL, NULL,
filter_graph);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot create \n");
return ret;
}
ret = avfilter_graph_add_filter(filter_graph, in_ctx);
ret = avfilter_graph_add_filter(filter_graph, out_ctx);
pSrc->name = av_strdup("in");
pSrc->filter_ctx = in_ctx;
pSrc->pad_idx = 0;
pSrc->next = NULL;
pBuffer->name = av_strdup("out");
pBuffer->filter_ctx = out_ctx;
pBuffer->pad_idx = 0;
pBuffer->next = NULL;
if ((ret = avfilter_graph_parse(filter_graph, filters_descr, &pBuffer,
&pSrc, NULL)) < 0)
return ret;
************************************************************
*** not working code "ret = -22"
if ((ret = avfilter_graph_config(filter_graph, fmt_ctx)) < 0)
return ret;
************************************************************
--
View this message in context: http://ffmpeg-users.933282.n4.nabble.com/yadif-in-ffmpeg-filter-usage-tp4650825p4650871.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.
More information about the ffmpeg-user
mailing list