diff options
author | Peter Schlaile <peter@schlaile.de> | 2006-06-07 16:53:51 +0400 |
---|---|---|
committer | Peter Schlaile <peter@schlaile.de> | 2006-06-07 16:53:51 +0400 |
commit | 174cf9247368f1c3988574d95d7d734f7a395eec (patch) | |
tree | 30559247c80e25743a0a9daf23f0ca1ed2a22001 /source/blender/blenkernel/intern/writeffmpeg.c | |
parent | efca4752d84aa73ed554002fc664c1f184839824 (diff) |
==FFMPEG==
This fixes again some segfaults on error conditions.
It also gives some reasonable error-messageboxes if chooses the wrong
DV-format-options.
More to come...
Diffstat (limited to 'source/blender/blenkernel/intern/writeffmpeg.c')
-rw-r--r-- | source/blender/blenkernel/intern/writeffmpeg.c | 46 |
1 files changed, 41 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index a98ee9502a1..7eae18553fd 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -511,12 +511,20 @@ void start_ffmpeg_impl(RenderData *rd, int rectx, int recty) /* Determine the correct filename */ makeffmpegstring(name); - fprintf(stderr, "Starting output to %s(ffmpeg)...\n", name); + fprintf(stderr, "Starting output to %s(ffmpeg)...\n" + " Using type=%d, codec=%d, audio_codec=%d,\n" + " video_bitrate=%d, audio_bitrate=%d,\n" + " gop_size=%d, multiplex=%d, autosplit=%d\n" + " render width=%d, render height=%d\n", + name, ffmpeg_type, ffmpeg_codec, ffmpeg_audio_codec, + ffmpeg_video_bitrate, ffmpeg_audio_bitrate, + ffmpeg_gop_size, ffmpeg_multiplex_audio, + ffmpeg_autosplit, rectx, recty); fmt = guess_format(NULL, name, NULL); if (!fmt) { G.afbreek = 1; /* Abort render */ - error("No vaild formats found"); + error("No valid formats found"); return; } @@ -559,10 +567,35 @@ void start_ffmpeg_impl(RenderData *rd, int rectx, int recty) fmt->video_codec = CODEC_ID_MPEG4; break; } + if (fmt->video_codec == CODEC_ID_DVVIDEO) { + if (rectx != 720) { + G.afbreek = 1; + error("Render width has to be 720 pixels for DV!"); + return; + } + if (G.scene->r.frs_sec != 25 && recty != 480) { + G.afbreek = 1; + error("Render height has to be 480 pixels " + "for DV-NTSC!"); + return; + + } + if (G.scene->r.frs_sec == 25 && recty != 576) { + G.afbreek = 1; + error("Render height has to be 576 pixels " + "for DV-PAL!"); + return; + } + } if (ffmpeg_type == FFMPEG_DV) { fmt->audio_codec = CODEC_ID_PCM_S16LE; - } else { - fmt->audio_codec = ffmpeg_audio_codec; + if (ffmpeg_multiplex_audio + && G.scene->audio.mixrate != 48000) { + G.afbreek = 1; + error("FFMPEG only supports 48khz / stereo " + "audio for DV!"); + return; + } } video_stream = alloc_video_stream(fmt->video_codec, of, rectx, recty); @@ -612,7 +645,9 @@ void end_ffmpeg(void); void append_ffmpeg(int frame, int *pixels, int rectx, int recty) { - fprintf(stderr, "Writing frame %i\n", frame); + fprintf(stderr, "Writing frame %i, " + "render width=%d, render height=%d\n", frame, + rectx, recty); while (ffmpeg_multiplex_audio && (((double)audio_stream->pts.val * audio_stream->time_base.num / audio_stream->time_base.den) @@ -649,6 +684,7 @@ void end_ffmpeg(void) if (video_stream && get_codec_from_stream(video_stream)) { avcodec_close(get_codec_from_stream(video_stream)); + video_stream = 0; } |