Fix [#21353] Rendering h264 reports broken settings and fail.
authorXavier Thomas <xavier.thomas.1980@gmail.com>
Tue, 4 May 2010 00:28:41 +0000 (00:28 +0000)
committerXavier Thomas <xavier.thomas.1980@gmail.com>
Tue, 4 May 2010 00:28:41 +0000 (00:28 +0000)
Also silenced a warning.

source/blender/blenkernel/intern/writeffmpeg.c

index 57d6c91c3dd50140bbf2ee4ca83678a1ef6976c0..8ebf98ef930ca7f8d49784f50c67f4b092556739 100644 (file)
@@ -362,7 +362,7 @@ static AVFrame* generate_video_frame(uint8_t* pixels, ReportList *reports)
        }
 
        if (c->pix_fmt != PIX_FMT_BGR32) {
-               sws_scale(img_convert_ctx, rgb_frame->data,
+               sws_scale(img_convert_ctx, (const uint8_t * const*) rgb_frame->data,
                          rgb_frame->linesize, 0, c->height, 
                          current_frame->data, current_frame->linesize);
                delete_picture(rgb_frame);
@@ -516,6 +516,12 @@ static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex
                /* arghhhh ... */
                c->pix_fmt = PIX_FMT_YUV420P;
        }
+
+       if (codec_id == CODEC_ID_H264) {
+               /* correct wrong default ffmpeg param which crash x264 */
+               c->qmin=10;
+               c->qmax=51;
+       }
        
        if ((of->oformat->flags & AVFMT_GLOBALHEADER)
 //             || !strcmp(of->oformat->name, "mp4")