Commit 1026ae95 authored by Jan Gerber's avatar Jan Gerber
Browse files

setup twopass, soft-target and buf-deley in the same order as its done in the example

parent 4b02c3e6
......@@ -107,7 +107,7 @@ if not conf.CheckPKGConfig(pkgconfig_version):
print 'pkg-config >= %s not found.' % pkgconfig_version
Exit(1)
XIPH_LIBS="ogg >= 1.1 vorbis vorbisenc theoradec theoraenc"
XIPH_LIBS="ogg >= 1.1 vorbis vorbisenc theoradec >= 1.1alpha3 theoraenc >= 1.1alpha3"
if not conf.CheckPKG(XIPH_LIBS):
print 'some xiph libs are missing, ffmpeg2theora depends on %s' % XIPH_LIBS
......
......@@ -1026,17 +1026,6 @@ void ff2theora_output(ff2theora this) {
info.speed_level = max_speed_level;
th_encode_ctl(info.td, TH_ENCCTL_SET_SPLEVEL, &info.speed_level, sizeof(int));
}
if(info.passno!=1 && this->buf_delay >= 0){
int arg = this->buf_delay;
ret = th_encode_ctl(info.td, TH_ENCCTL_SET_RATE_BUFFER,
&this->buf_delay, sizeof(this->buf_delay));
if (this->buf_delay != arg)
fprintf(stderr, "Warning: could not set desired buffer delay of %d, using %d instead.\n",
arg, this->buf_delay);
if(ret < 0){
fprintf(stderr, "Warning: could not set desired buffer delay.\n");
}
}
/* setting just the granule shift only allows power-of-two keyframe
spacing. Set the actual requested spacing. */
ret = th_encode_ctl(info.td, TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE,
......@@ -1044,6 +1033,7 @@ void ff2theora_output(ff2theora this) {
if(ret<0){
fprintf(stderr,"Could not set keyframe interval to %d.\n",(int)this->keyint);
}
if(this->soft_target){
/* reverse the rate control flags to favor a 'long time' strategy */
int arg = TH_RATECTL_CAP_UNDERFLOW;
......@@ -1103,6 +1093,17 @@ void ff2theora_output(ff2theora this) {
}
}
}
if(info.passno!=1 && this->buf_delay >= 0){
int arg = this->buf_delay;
ret = th_encode_ctl(info.td, TH_ENCCTL_SET_RATE_BUFFER,
&this->buf_delay, sizeof(this->buf_delay));
if (this->buf_delay != arg)
fprintf(stderr, "Warning: could not set desired buffer delay of %d, using %d instead.\n",
arg, this->buf_delay);
if(ret < 0){
fprintf(stderr, "Warning: could not set desired buffer delay.\n");
}
}
}
/* audio settings here */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment