[FFmpeg-devel] [PATCH] add top video filter

Michael Niedermayer michaelni at gmx.at
Mon Mar 28 20:39:48 CEST 2011


On Mon, Mar 28, 2011 at 02:47:20PM +0100, Mark Himsley wrote:
> Dear developers,
>
> Converting to and from interlaced PAL DV files, with their  
> bottom-field-first interlace field order, can be a pain. Converting tff  
> files to DV results in tff DV files, which are hard to work with in  
> editing software.
>
> The attached filter can:
>
> Convert field order by either moving all of the lines in the picture up  
> by 1 line (bff to tff conversion) or down by 1 line (tff to bff  
> conversion). The remaining line, the bottom line in bff to tff  
> transforms or the top line in tff to bff transforms, is filled by  
> copying the closest line in that field.
>
> Previous to this filter I have used a filter chain like this to do bff  
> to tff conversion.
>
> format=yuv422p,crop=720:575:0:1,pad=720:576:0:0:black
>
> but that chain does not fill the remaining line.
>
> -- 
> Mark

>  doc/filters.texi         |   29 +++++++
>  libavfilter/Makefile     |    1 
>  libavfilter/allfilters.c |    1 
>  libavfilter/vf_top.c     |  184 +++++++++++++++++++++++++++++++++++++++++++++++

i think vshift or vmove or something like that is a better name

off topic a bit:
also theres another way to convert between top & bottom field first
and that is to combine 2 fields from 2 seperate frames


[...]
> +static int query_formats(AVFilterContext *ctx)
> +{
> +    enum PixelFormat pix_fmts[] = {
> +        PIX_FMT_YUV444P,  PIX_FMT_YUV422P,
> +        PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P,
> +        PIX_FMT_RGB24,    PIX_FMT_BGR24,
> +        PIX_FMT_ARGB,     PIX_FMT_ABGR,
> +        PIX_FMT_RGBA,     PIX_FMT_BGRA,
> +        PIX_FMT_NONE
> +    };

i think the filter could easily be made to support more formats

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

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- 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/20110328/b8d1a954/attachment.asc>


More information about the ffmpeg-devel mailing list