Crash when rendering to Quicktime RLE codec
Open, ConfirmedPublic

Description

System Information
Arch Linux, NVIDIA Quadro K5100M

Blender Version
Broken: 2.79 official and a51688d0b06
Worked: 2.78c

Short description of error
When rendering to a movie format using FFMPEG on a .blend file that was created at or before Blender 2.78c, Blender will crash if you choose to use the Quicktime RLE codec.

I made a debug build of a51688d0b06 and got the following GDB backtrace:

(gdb) bt
#0  0x00007fffeaa038a0 in raise () from /usr/lib/libc.so.6
#1  0x00007fffeaa04f09 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff07cdaac in ?? () from /usr/lib/libavutil.so.55
#3  0x00007ffff07e6ea2 in av_image_copy () from /usr/lib/libavutil.so.55
#4  0x00007ffff07dfc91 in av_frame_copy () from /usr/lib/libavutil.so.55
#5  0x00007ffff07e0255 in av_frame_ref () from /usr/lib/libavutil.so.55
#6  0x00007ffff0fc5e72 in ?? () from /usr/lib/libavcodec.so.57
#7  0x00007ffff1084e68 in avcodec_encode_video2 ()
   from /usr/lib/libavcodec.so.57
#8  0x000055555825a98b in write_video_frame (context=0x7fffd25a5008,
    rd=0x7fffbc509490, cfra=0, frame=0x7fffd2582a00, reports=0x7fffc4f0be58)
    at /home/jason_vangumster/src/blender/blender/source/blender/blenkernel/intern/writeffmpeg.c:328
#9  0x000055555825cd8a in BKE_ffmpeg_append (context_v=0x7fffd25a5008,
    rd=0x7fffbc509490, start_frame=775, frame=775, pixels=0x7fffac7cf6c8,
    rectx=1920, recty=1080, suffix=0x55555bd363a4 "", reports=0x7fffc4f0be58)
    at /home/jason_vangumster/src/blender/blender/source/blender/blenkernel/intern/writeffmpeg.c:1241
#10 0x00005555578cf640 in RE_WriteRenderViewsMovie (reports=0x7fffc4f0be58,
    rr=0x7fffc1903670, scene=0x7fffccf5d808, rd=0x7fffbc509490,
    mh=0x55555d95fee0 <mh>, movie_ctx_arr=0x7fffd2583008, totvideos=1,
    preview=false)
    at /home/jason_vangumster/src/blender/blender/source/blender/render/intern/source/pipeline.c:3446
#11 0x00005555578cf97c in do_write_image_or_movie (re=0x7fffbc508008,
    bmain=0x7fffccee3f08, scene=0x7fffccf5d808, mh=0x55555d95fee0 <mh>,
    totvideos=1, name_override=0x0)
    at /home/jason_vangumster/src/blender/blender/source/blender/render/intern/source/pipeline.c:3494
#12 0x00005555578d06fc in RE_BlenderAnim (re=0x7fffbc508008,
    bmain=0x7fffccee3f08, scene=0x7fffccf5d808, camera_override=0x0,
    lay_override=0, sfra=775, efra=3058, tfra=1)
    at /home/jason_vangumster/src/blender/blender/source/blender/render/intern/source/pipeline.c:3768
#13 0x000055555779efa6 in render_startjob (rjv=0x7fffd3688448,
    stop=0x7fffd364bcfc, do_update=0x7fffd364bcfa, progress=0x7fffd364bd00)
    at /home/jason_vangumster/src/blender/blender/source/blender/editors/render/render_internal.c:604
#14 0x00005555571efc4f in do_job_thread (job_v=0x7fffd364bc88)
    at /home/jason_vangumster/src/blender/blender/source/blender/windowmanager/intern/wm_jobs.c:337
#15 0x000055555857bab9 in tslot_thread_start (tslot_p=0x7fffd7aa6908)
    at /home/jason_vangumster/src/blender/blender/source/blender/blenlib/intern/threads.c:253
#16 0x00007fffeaf9108a in start_thread () from /usr/lib/libpthread.so.0
#17 0x00007fffeaac51bf in clone () from /usr/lib/libc.so.6

Exact steps for others to reproduce the error

  1. Open Blender
  2. Load the startup.blend attached to this report
  3. In the Output panel of Render Properties, change Format to FFMPEG video
  4. In the Encoding panel, change codec to QT rle/Quicktime Animation (container and audio codec don't seem to matter)
  5. Render animation (Ctrl+F12)
  6. Observe crash

Crash was confirmed on IRC by @jens verwiebe (jensverwiebe)

Details

Type
Bug
LazyDodo (LazyDodo) triaged this task as Confirmed priority.Oct 13 2017, 3:13 PM

Can repro this on windows as well.

I use a quickfix for now cause it seems rle is always handled/expected with alpha in blender:

diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index a19e414..57dbbe8 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -648,9 +648,9 @@ static AVStream *alloc_video_stream(FFMpegContext *context, RenderData *rd, int
        }
 
        if (codec_id == AV_CODEC_ID_QTRLE) {
-               if (rd->im_format.planes == R_IMF_PLANES_RGBA) {
+//             if (rd->im_format.planes == R_IMF_PLANES_RGBA) {
                        c->pix_fmt = AV_PIX_FMT_ARGB;
-               }
+//             }
        }
 
        if (codec_id == AV_CODEC_ID_PNG) {

Jens