[FFmpeg-trac] #157(undetermined:new): Specifying KEYINT (-g) has no effect

FFmpeg trac at avcodec.org
Thu May 5 18:08:17 CEST 2011

#157: Specifying KEYINT (-g) has no effect
 Reporter:  Reado         |        Type:  defect
   Status:  new           |    Priority:  critical
Component:  undetermined  |     Version:  git-oldabi
 Keywords:  keyint        |  Blocked By:
 Blocking:                |  Reproduced:  0
 Analyzed:  0             |
 Using the latest "oldabi" version of FFMPEG, here's my command:

 ffmpeg -i 00384.MTS -acodec libfaac -ab 128k -ac 2 -ar 44100 -vcodec
 libx264 -preset fast -vf yadif=1,scale=854:480 -b 2000k -qmin 22 -qmax 27
 -aspect 16:9 -threads 0 -g 25 -f mp4 -t 30 -y fast.mp4

 However the response from libx264 is:

 [libx264 @ 0xac390e0] 264 - core 115 r1947 b5a8ad7 - H.264/MPEG-4 AVC
 codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - options:
 cabac=1 ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=6 psy=1
 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1
 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12
 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0
 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1
 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=25 scenecut=40
 intra_refresh=0 rc_lookahead=30 rc=abr mbtree=1 bitrate=2000 ratetol=1.0
 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00

 Notice keyint=250 when it should be keyint=25. This means I can't force a
 keyframe every second. Playing back the video, I can only seek every 3
 seconds, not every second.

 Workaround: In the libx264 project under common/common.c, change
 "param->i_keyint_max" from 250 to 25, recompile libx264 and re-run the
 encoder. The result is there's a keyframe every second as expected and now
 I can seek to any position in the video.

Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/157>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list