[FFmpeg-devel] [PATCH] ffplay: fix odd YUV width

Michael Niedermayer michaelni at gmx.at
Fri Aug 24 16:23:31 CEST 2012


On Fri, Aug 24, 2012 at 01:05:29PM +0200, Marton Balint wrote:
> Should fix issue #1322.
> 
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
>  ffplay.c |   12 ++++++++++--
>  1 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/ffplay.c b/ffplay.c
> index f81bd7c..f996b68 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -1586,7 +1586,7 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c
>      char buffersrc_args[256];
>      int ret;
>      AVBufferSinkParams *buffersink_params = av_buffersink_params_alloc();
> -    AVFilterContext *filt_src = NULL, *filt_out = NULL, *filt_format;
> +    AVFilterContext *filt_src = NULL, *filt_out = NULL, *filt_format, *filt_scale;
>      AVCodecContext *codec = is->video_st->codec;
>  
>      snprintf(sws_flags_str, sizeof(sws_flags_str), "flags=%d", sws_flags);
> @@ -1612,14 +1612,22 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c
>      if (ret < 0)
>          return ret;
>  
> +    /* SDL YUV code is not handling odd width/height for some driver
> +     * combinations, therefore we upscale the picture to an even width/height. */
> +    if ((ret = avfilter_graph_create_filter(&filt_scale,
> +                                            avfilter_get_by_name("scale"),
> +                                            "ffplay_scale", "ceil(in_w/2)*2:ceil(in_h/2)*2", NULL, graph)) < 0)
> +        return ret;

maybe padding or croping 1 line/column would be better than scaling
due to speed and possible quality issues, especially interlaced
material could suffer from vertical scaling


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

Those who are best at talking, realize last or never when they are wrong.
-------------- 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/20120824/d5da8961/attachment.asc>


More information about the ffmpeg-devel mailing list