diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c
index bd59498..8027230 100644
--- a/ext/ffmpeg/gstffmpegcodecmap.c
+++ b/ext/ffmpeg/gstffmpegcodecmap.c
@@ -183,13 +183,18 @@ gst_ff_vid_caps_new (AVCodecContext * context, enum CodecID codec_id,
   va_list var_args;
   gint i;
 
+  if (context != NULL)
+    GST_DEBUG ("fps %d %d ticks:%d", context->time_base.den,
+        context->time_base.num, context->ticks_per_frame);
+
   /* fixed, non probing context */
   if (context != NULL && context->width != -1) {
     caps = gst_caps_new_simple (mimetype,
         "width", G_TYPE_INT, context->width,
         "height", G_TYPE_INT, context->height,
         "framerate", GST_TYPE_FRACTION,
-        context->time_base.den, context->time_base.num, NULL);
+        context->time_base.den / context->ticks_per_frame,
+        context->time_base.num, NULL);
   } else if (context) {
     /* so we are after restricted caps in this case */
     switch (codec_id) {
@@ -1829,6 +1834,7 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
     /* somehow these seem mixed up.. */
     context->time_base.den = gst_value_get_fraction_numerator (fps);
     context->time_base.num = gst_value_get_fraction_denominator (fps);
+    context->ticks_per_frame = 1;
 
     GST_DEBUG ("setting framerate %d/%d = %lf",
         context->time_base.den, context->time_base.num,
diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c
index ee1c71e..efa1499 100644
--- a/ext/ffmpeg/gstffmpegdec.c
+++ b/ext/ffmpeg/gstffmpegdec.c
@@ -1649,7 +1649,8 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
               ffmpegdec->context->time_base.den < 1000)) {
         GST_LOG_OBJECT (ffmpegdec, "using decoder's framerate for duration");
         out_duration = gst_util_uint64_scale_int (GST_SECOND,
-            ffmpegdec->context->time_base.num,
+            ffmpegdec->context->time_base.num /
+            ffmpegdec->context->ticks_per_frame,
             ffmpegdec->context->time_base.den);
       } else {
         GST_LOG_OBJECT (ffmpegdec, "no valid duration found");
diff --git a/ext/ffmpeg/gstffmpegenc.c b/ext/ffmpeg/gstffmpegenc.c
index 0c6c6b4..8980d1d 100644
--- a/ext/ffmpeg/gstffmpegenc.c
+++ b/ext/ffmpeg/gstffmpegenc.c
@@ -346,6 +346,7 @@ gst_ffmpegenc_getcaps (GstPad * pad)
     ctx->height = DEFAULT_HEIGHT;
     ctx->time_base.num = 1;
     ctx->time_base.den = 25;
+    ctx->ticks_per_frame = 1;
     ctx->bit_rate = DEFAULT_VIDEO_BITRATE;
     /* makes it silent */
     ctx->strict_std_compliance = -1;
@@ -491,6 +492,7 @@ gst_ffmpegenc_setcaps (GstPad * pad, GstCaps * caps)
   if (!ffmpegenc->context->time_base.den) {
     ffmpegenc->context->time_base.den = 25;
     ffmpegenc->context->time_base.num = 1;
+    ffmpegenc->context->ticks_per_frame = 1;
   } else if ((oclass->in_plugin->id == CODEC_ID_MPEG4)
       && (ffmpegenc->context->time_base.den > 65535)) {
     /* MPEG4 Standards do not support time_base denominator greater than
@@ -515,7 +517,7 @@ gst_ffmpegenc_setcaps (GstPad * pad, GstCaps * caps)
     ctx = ffmpegenc->context;
     ctx->gop_size = (ffmpegenc->max_key_interval < 0) ?
         (-ffmpegenc->max_key_interval
-        * (ctx->time_base.den / ctx->time_base.num))
+        * (ctx->time_base.den * ctx->ticks_per_frame / ctx->time_base.num))
         : ffmpegenc->max_key_interval;
   }
 
@@ -636,8 +638,8 @@ gst_ffmpegenc_chain_video (GstPad * pad, GstBuffer * inbuf)
   g_return_val_if_fail (frame_size == GST_BUFFER_SIZE (inbuf), GST_FLOW_ERROR);
 
   ffmpegenc->picture->pts =
-      gst_ffmpeg_time_gst_to_ff (GST_BUFFER_TIMESTAMP (inbuf),
-      ffmpegenc->context->time_base);
+      gst_ffmpeg_time_gst_to_ff (GST_BUFFER_TIMESTAMP (inbuf) /
+      ffmpegenc->context->ticks_per_frame, ffmpegenc->context->time_base);
 
   ffmpegenc_setup_working_buf (ffmpegenc);
 
