[FFmpeg-devel] [PATCH]Clarify that there are two different "passlogfile" options

Stefano Sabatini stefasab at gmail.com
Thu Aug 30 20:25:33 CEST 2012


On date Thursday 2012-08-30 12:01:43 +0000, Carl Eugen Hoyos encoded:
> Stefano Sabatini <stefasab <at> gmail.com> writes:
> 
> > > +Note that this option is overwritten by a local option of the same name 
> > > +when using @code{-vcodec libx264}. That option maps to the x264 option
> > > +stats which has a different syntax.
> > > +
> > 
> > In transcode_init():
> 
> [...]
> 
> > So I'd expect the stats file to have the specified name in
> > logfilename.
> 
> As suspected, you are right, this was fixed in 6968a7d / 6e8be94
 
> I suspect it is reproducible with release/0.7, 0.8, 0.9, 0.10 and 0.11
> Should the fix be backported or should I apply the documentation 
> change in the release branches?

OK I found it:

static int opt_passlogfile(const char *opt, const char *arg)
{
    pass_logfilename_prefix = arg;
#if CONFIG_LIBX264_ENCODER
    return opt_default(opt, arg);
#else
    return 0;
#endif
}

But then the option is overwritten in transcode init():

                snprintf(logfilename, sizeof(logfilename), "%s-%d.log",
                         pass_logfilename_prefix ? pass_logfilename_prefix : DEFAULT_PASS_LOGFILENAME_PREFIX,
                         i);
                if (!strcmp(ost->enc->name, "libx264")) {
                    av_dict_set(&ost->opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE);

(I couldn't spot this initially due to the "smart" ffmpeg.c split in
many tiny files).

The second chunk covers the hack in opt_passlogfile(), more confusion
is added by the two options in libx264.c (stats and passlogfile) with
the same meaning.

Anyway yes I confirm there was a (IMHO serious) bug fixed by the
latest hack, and fixing it in the documentation is a poor palliative
but better than nothing (backporting the bugfix may be more complicate
and I don't volunteer for that, I'd better spend my time by cleaning
it up in latest git).
-- 
FFmpeg = Fundamental and Friendly Meaningful Perennial Ecumenical Gadget


More information about the ffmpeg-devel mailing list