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.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index 7b414f7746a..da1412dac0d 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -1,5 +1,4 @@
/*
- * $Id$
*
* ffmpeg-write support
*
@@ -397,6 +396,20 @@ static void set_ffmpeg_property_option(AVCodecContext* c, IDProperty * prop)
}
}
+static int ffmpeg_proprty_valid(AVCodecContext *c, const char *prop_name, IDProperty *curr)
+{
+ int valid= 1;
+
+ if(strcmp(prop_name, "video")==0) {
+ if(strcmp(curr->name, "bf")==0) {
+ /* flash codec doesn't support b frames */
+ valid&= c->codec_id!=CODEC_ID_FLV1;
+ }
+ }
+
+ return valid;
+}
+
static void set_ffmpeg_properties(RenderData *rd, AVCodecContext *c, const char * prop_name)
{
IDProperty * prop;
@@ -415,7 +428,8 @@ static void set_ffmpeg_properties(RenderData *rd, AVCodecContext *c, const char
iter = IDP_GetGroupIterator(prop);
while ((curr = IDP_GroupIterNext(iter)) != NULL) {
- set_ffmpeg_property_option(c, curr);
+ if(ffmpeg_proprty_valid(c, prop_name, curr))
+ set_ffmpeg_property_option(c, curr);
}
}
@@ -1088,7 +1102,7 @@ IDProperty *ffmpeg_property_add(RenderData *rd, char * type, int opt_index, int
idp_type = IDP_FLOAT;
break;
case FF_OPT_TYPE_STRING:
- val.str = " ";
+ val.str = (char *)" ";
idp_type = IDP_STRING;
break;
case FF_OPT_TYPE_CONST:
@@ -1188,6 +1202,9 @@ void ffmpeg_set_preset(RenderData *rd, int preset)
{
int isntsc = (rd->frs_sec != 25);
+ if(rd->ffcodecdata.properties)
+ IDP_FreeProperty(rd->ffcodecdata.properties);
+
switch (preset) {
case FFMPEG_PRESET_VCD:
rd->ffcodecdata.type = FFMPEG_MPEG1;
@@ -1218,8 +1235,11 @@ void ffmpeg_set_preset(RenderData *rd, int preset)
case FFMPEG_PRESET_DVD:
rd->ffcodecdata.type = FFMPEG_MPEG2;
rd->ffcodecdata.video_bitrate = 6000;
- rd->xsch = 720;
- rd->ysch = isntsc ? 480 : 576;
+
+ /* Don't set resolution, see [#21351]
+ * rd->xsch = 720;
+ * rd->ysch = isntsc ? 480 : 576; */
+
rd->ffcodecdata.gop_size = isntsc ? 18 : 15;
rd->ffcodecdata.rc_max_rate = 9000;
rd->ffcodecdata.rc_min_rate = 0;
@@ -1322,8 +1342,8 @@ void ffmpeg_verify_image_type(RenderData *rd)
rd->ffcodecdata.video_bitrate <= 1) {
rd->ffcodecdata.codec = CODEC_ID_MPEG2VIDEO;
- /* Don't set preset, disturbs render resolution.
- * ffmpeg_set_preset(rd, FFMPEG_PRESET_DVD); */
+
+ ffmpeg_set_preset(rd, FFMPEG_PRESET_DVD);
}
if(rd->ffcodecdata.type == FFMPEG_OGG) {
rd->ffcodecdata.type = FFMPEG_MPEG2;
@@ -1357,4 +1377,3 @@ void ffmpeg_verify_image_type(RenderData *rd)
}
#endif
-