summaryrefslogtreecommitdiffstats
path: root/libhb/encx264.c
diff options
context:
space:
mode:
authorjbrjake <[email protected]>2007-10-26 16:53:58 +0000
committerjbrjake <[email protected]>2007-10-26 16:53:58 +0000
commit592c7665ccf092313449860dded33b85e1735bfc (patch)
tree0245bfab74f7f63c83616f34c1a3c1a0485ad431 /libhb/encx264.c
parentdca05d7b2e0ae997cbeaa73b7aaaae061f5310bc (diff)
Automagically set keyframe intervals for x264, based on the specified FPS.
So... 23.976fps content gets a minimum interval of 24 and a maximum of 240 25fps content uses defaults, a minimum interval of 25 and a maximum of 250 29.97fps content gets a minimum of 30 and a maximum of 300. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1038 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/encx264.c')
-rw-r--r--libhb/encx264.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libhb/encx264.c b/libhb/encx264.c
index 6709716ff..fa41a5f78 100644
--- a/libhb/encx264.c
+++ b/libhb/encx264.c
@@ -68,7 +68,16 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job )
param.i_height = job->height;
param.i_fps_num = job->vrate;
param.i_fps_den = job->vrate_base;
- param.i_keyint_max = 20 * job->vrate / job->vrate_base;
+
+ if (job->vrate_base != 1080000)
+ {
+ /* If the fps isn't 25, adjust the key intervals. Add 1 because
+ we want 24, not 23 with a truncated remainder. */
+ param.i_keyint_min = (job->vrate / job->vrate_base) + 1;
+ param.i_keyint_max = (10 * job->vrate / job->vrate_base) + 1;
+ hb_log("encx264: keyint-min: %i, keyint-max: %i", param.i_keyint_min, param.i_keyint_max);
+ }
+
param.i_log_level = X264_LOG_INFO;
if( job->h264_level )
{