]> granicus.if.org Git - handbrake/commitdiff
encx265: fix 2 pass encoding when framerate is wrong
authorJohn Stebbins <jstebbins.hb@gmail.com>
Wed, 22 Feb 2017 20:33:16 +0000 (13:33 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Wed, 22 Feb 2017 20:49:21 +0000 (13:49 -0700)
x265 expects the framerate specified to be the same for both passes. So
we must set the same value even when we compute that the actual
framerate differs from what the file's header says.

libhb/encx265.c

index 90d786983beebd67a6cf003f7ee76d43bc7c0504..d0a4ef4881eb20aa40883e875d221ba2746abf55 100644 (file)
@@ -143,9 +143,8 @@ int encx265Init(hb_work_object_t *w, hb_job_t *job)
      * Some HandBrake-specific defaults; users can override them
      * using the encoder_options string.
      */
-    hb_reduce(&vrate.num, &vrate.den, job->vrate.num, job->vrate.den);
-    param->fpsNum      = vrate.num;
-    param->fpsDenom    = vrate.den;
+    param->fpsNum      = job->orig_vrate.num;
+    param->fpsDenom    = job->orig_vrate.den;
     param->keyframeMin = (double)job->orig_vrate.num / job->orig_vrate.den +
                                  0.5;
     param->keyframeMax = param->keyframeMin * 10;