From 1166609cd36af1ab43a1f5004afaac34bcc9d94a Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 14 Apr 2013 13:44:04 +0000 Subject: == FFMPEG / Canon DSLR footage workaround == The latest ffmpeg versions include a workaround to deal with a certain pecularity in Canon DSLR footage: instead of decoding pictures with the proper resolution of 1920x1080 they decode it with 1920x1088 and add a black bar at the bottom. Needless to say, that this screws up things in a lot of areas within blender (proxy indices, mask animations etc.) Since all blender versions besides Linux x86 32bit seem still to include older ffmpeg versions which still contain this bug, this patch adds a workaround for older versions until we have all versions on all platforms up to date. See also: http://git.libav.org/?p=libav.git;a=commit;h=30f515091c323da59c0f1b533703dedca2f4b95d --- source/blender/imbuf/intern/indexer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/imbuf/intern/indexer.c') diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 002ffd409a2..780ca7e5769 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -552,7 +552,7 @@ static struct proxy_output_ctx *alloc_proxy_output_ffmpeg( rv->video_buffer = (uint8_t *)MEM_mallocN( rv->video_buffersize, "FFMPEG video buffer"); - rv->orig_height = st->codec->height; + rv->orig_height = av_get_cropped_height_from_codec(st->codec); if (st->codec->width != width || st->codec->height != height || st->codec->pix_fmt != rv->c->pix_fmt) @@ -567,7 +567,7 @@ static struct proxy_output_ctx *alloc_proxy_output_ffmpeg( rv->sws_ctx = sws_getContext( st->codec->width, - st->codec->height, + rv->orig_height, st->codec->pix_fmt, width, height, rv->c->pix_fmt, @@ -809,7 +809,8 @@ static IndexBuildContext *index_ffmpeg_create_context(struct anim *anim, IMB_Tim context->proxy_ctx[i] = alloc_proxy_output_ffmpeg( anim, context->iStream, proxy_sizes[i], context->iCodecCtx->width * proxy_fac[i], - context->iCodecCtx->height * proxy_fac[i], + av_get_cropped_height_from_codec( + context->iCodecCtx) * proxy_fac[i], quality); if (!context->proxy_ctx[i]) { proxy_sizes_in_use &= ~proxy_sizes[i]; -- cgit v1.2.3