summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2011-04-20 15:46:20 -0700
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2011-04-20 15:46:40 -0700
commit2c18893a911657205bd45ff8a666882610e57700 (patch)
tree8c85073d080c443ac8a76346ec7cdde2f843a408 /ffmpeg.c
parentb9553cf4b80d79c280ae7c989593ce1daac4cafa (diff)
In libx264 wrapper, correctly support 2pass log filename option.
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index ec0a0235d1..b91e9d3ea3 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -207,7 +207,7 @@ static int do_hex_dump = 0;
static int do_pkt_dump = 0;
static int do_psnr = 0;
static int do_pass = 0;
-static char *pass_logfilename_prefix = NULL;
+static const char *pass_logfilename_prefix;
static int audio_stream_copy = 0;
static int video_stream_copy = 0;
static int subtitle_stream_copy = 0;
@@ -2331,7 +2331,7 @@ static int transcode(AVFormatContext **output_files,
break;
}
/* two pass mode */
- if (ost->encoding_needed &&
+ if (ost->encoding_needed && codec->codec_id != CODEC_ID_H264 &&
(codec->flags & (CODEC_FLAG_PASS1 | CODEC_FLAG_PASS2))) {
char logfilename[1024];
FILE *f;
@@ -4268,6 +4268,12 @@ static void log_callback_null(void* ptr, int level, const char* fmt, va_list vl)
{
}
+static void opt_passlogfile(const char *arg)
+{
+ pass_logfilename_prefix = arg;
+ opt_default("passlogfile", arg);
+}
+
static const OptionDef options[] = {
/* main options */
#include "cmdutils_common_opts.h"
@@ -4341,7 +4347,7 @@ static const OptionDef options[] = {
{ "sameq", OPT_BOOL | OPT_VIDEO, {(void*)&same_quality},
"use same quantizer as source (implies VBR)" },
{ "pass", HAS_ARG | OPT_FUNC2 | OPT_VIDEO, {(void*)opt_pass}, "select the pass number (1 or 2)", "n" },
- { "passlogfile", HAS_ARG | OPT_STRING | OPT_VIDEO, {(void*)&pass_logfilename_prefix}, "select two pass log file name prefix", "prefix" },
+ { "passlogfile", HAS_ARG | OPT_VIDEO, {(void*)&opt_passlogfile}, "select two pass log file name prefix", "prefix" },
{ "deinterlace", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_deinterlace},
"deinterlace pictures" },
{ "psnr", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_psnr}, "calculate PSNR of compressed frames" },