[FFmpeg-user] Issue with segment muxer and B frames

Massimo Battistel battistel at gmail.com
Tue Jan 27 09:58:01 CET 2015


Hello,
the following command line drops 2 frames between each segment (I have a
frame counter in overlay).

ffmpeg -i <any_input> -vcodec libx264 -pix_fmt yuv420p -aspect 16:9 -b:v 4M
-preset ultrafast
 -g 25 -bf 2 -acodec libvo_aacenc -ac 2 -ar 48000 -b:a 128k -f segment
-segment_time 8
-reset_timestamps 1 out_%2d.mkv

Output:

ffmpeg version N-69207-gecd3952 Copyright (c) 2000-2015 the FFmpeg
developers
  built on Jan 22 2015 22:13:34 with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-iconv --enable-libass --enable-libbluray
--enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme
--enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr
--enable-libspeex --enable-libtheora --enable-libtwolame
--enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid
--enable-lzma --enable-decklink --enable-zlib
  libavutil      54. 17.100 / 54. 17.100
  libavcodec     56. 20.100 / 56. 20.100
  libavformat    56. 19.100 / 56. 19.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5.  8.101 /  5.  8.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, asf, from '<any_input>':
  Metadata:
    encoder         : Lavf56.4.101
  Duration: N/A, start: 54002.320000, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x576, 25
fps, 25 tbr, 1k tbn, 1k tbc
    Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz,
stereo, s16, 1536 kb/s
[libx264 @ 0000000005700780] using SAR=64/45
[libx264 @ 0000000005700780] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2
[libx264 @ 0000000005700780] profile Main, level 3.0
[libx264 @ 0000000005700780] 264 - core 144 r2525 40bb568 - H.264/MPEG-4
AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html -
options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1
psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12
lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=2 b_pyramid=2 b_adapt=0
b_bias=0 direct=1 weightb=0 open_gop=0 weightp=0 keyint=25 keyint_min=2
scenecut=0 intra_refresh=0 rc=abr mbtree=0 bitrate=4000 ratetol=1.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 pb_ratio=1.30 aq=0
Output #0, segment, to 'out_%2d.mkv':
  Metadata:
    encoder         : Lavf56.19.100
    Stream #0:0: Video: h264 (libx264), yuv420p, 720x576 [SAR 64:45 DAR
16:9], q=-1--1, 4000 kb/s, 25 fps, 1k tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.20.100 libx264
    Stream #0:1: Audio: aac (libvo_aacenc), 48000 Hz, stereo, s16, 128 kb/s
    Metadata:
      encoder         : Lavc56.20.100 libvo_aacenc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (libvo_aacenc))
Press [q] to stop, [?] for help


Removing "-bf 2" everything is fine, no frame lost.


thanks,
MB


More information about the ffmpeg-user mailing list