Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/writeffmpeg.c')
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index ff6ebcc487f..8ebf98ef930 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -69,10 +69,6 @@
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
extern void do_init_ffmpeg();
static int ffmpeg_type = 0;
@@ -366,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);
@@ -382,7 +378,7 @@ static void set_ffmpeg_property_option(AVCodecContext* c, IDProperty * prop)
fprintf(stderr, "FFMPEG expert option: %s: ", prop->name);
- strncpy(name, prop->name, 128);
+ BLI_strncpy(name, prop->name, sizeof(name));
param = strchr(name, ':');
@@ -520,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")
@@ -1078,7 +1080,7 @@ int ffmpeg_property_add_string(RenderData *rd, const char * type, const char * s
avcodec_get_context_defaults(&c);
- strncpy(name_, str, 128);
+ strncpy(name_, str, sizeof(name_));
name = name_;
while (*name == ' ') name++;