[FFmpeg-devel] [PATCH] avfilter: add mergeplanes

Michael Niedermayer michaelni at gmx.at
Wed Oct 23 15:58:21 CEST 2013


On Tue, Oct 22, 2013 at 11:02:46AM +0000, Paul B Mahol wrote:
> On 10/11/13, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Fri, Oct 11, 2013 at 11:35:26AM +0000, Paul B Mahol wrote:
> >> On 10/11/13, Michael Niedermayer <michaelni at gmx.at> wrote:
> >> > On Mon, Oct 07, 2013 at 08:52:56AM +0000, Paul B Mahol wrote:
> >> >> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> >> > [...]
> >> >> +}
> >> >> +
> >> >> +static int filter_frame(AVFilterLink *inlink, AVFrame *in)
> >> >> +{
> >> >> +    MergePlanesContext *s = inlink->dst->priv;
> >> >> +    return ff_framesync_filter_frame(&s->fs, inlink, in);
> >> >> +}
> >> >> +
> >> >> +static av_cold int init(AVFilterContext *ctx)
> >> >> +{
> >> >> +    MergePlanesContext *s = ctx->priv;
> >> >> +    enum AVPixelFormat gray;
> >> >> +    int i, ret, is_16, is_be;
> >> >> +
> >> >> +    s->outdesc = av_pix_fmt_desc_get(s->out_fmt);
> >> >> +    if (!(s->outdesc->flags & AV_PIX_FMT_FLAG_PLANAR)) {
> >> >> +        av_log(ctx, AV_LOG_ERROR, "Only planar formats are
> >> >> supported.\n");
> >> >> +        return AVERROR(EINVAL);
> >> >> +    }
> >> >> +
> >> >> +    is_16 = s->outdesc->comp[0].depth_minus1 == 15;
> >> >> +    is_be = s->outdesc->flags & AV_PIX_FMT_FLAG_BE;
> >> >
> >> >> +    gray  = is_16 ? is_be ? AV_PIX_FMT_GRAY16BE : AV_PIX_FMT_GRAY16LE
> >> >> :
> >> >> AV_PIX_FMT_GRAY8;
> >> >
> >> > this might be more readable with a ()
> >> >
> >> > also you could support any planar input and just use the first N
> >> > planes, that is for example with 4 inputs and yuva444p as output
> >> > and yuv420 inputs, the 4 y planes could end up being used for the
> >> > yuva planes
> >> > also if you implement above it should then be easy to add support
> >> > for the user to specify which planes of the inputs to use exactly
> >> >
> >>
> >> That is easier to say than to do.
> >> What syntax I should use for such feature?
> >
> > saste suggested | elsewhere as secondary seperator for sws, so maybe
> > src_planes=0|0|0 for using the first plane of each input
> 
> But what if you use multiple planes from same input?

you could use pairs of numbers, or number + letter like
0y|0u|0v




[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131023/1465fc3b/attachment.asc>


More information about the ffmpeg-devel mailing list