[FFmpeg-user] Freeze frames in timeline editing

John Allan Farleyton john.farleyton at gmail.com
Sat Jul 21 13:42:32 EEST 2018


Hi,
I am trying to slow down a video to half speed beginning from frame 100
with the setpts filter. It works, but from frame 100 I get 100 additional
frozen dropped frames before the video continues at half speed. Is my
command wrong or is there a problem with the setpts filter?

Command:
ffmpeg -i ball.avi -vf "setpts='if(gte(N,100),2,1)'*PTS" -c:v libx264 -crf
20 -pix_fmt yuv420p ball_slow.avi

Command line output:
ffmpeg version N-91288-g29cddc99cd Copyright (c) 2000-2018 the FFmpeg
developers
  built with gcc 7.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-sdl2
--enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv
--enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr
--enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack
--enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2
--enable-libzimg --enable-lzma --enable-zlib --enable-gmp
--enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc
--enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom
--enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid
--enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2
--enable-avisynth
  libavutil      56. 18.102 / 56. 18.102
  libavcodec     58. 20.102 / 58. 20.102
  libavformat    58. 17.100 / 58. 17.100
  libavdevice    58.  4.101 / 58.  4.101
  libavfilter     7. 25.100 /  7. 25.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
Input #0, avi, from 'ball.avi':
  Metadata:
    encoder         : Lavf58.17.100
  Duration: 00:00:10.00, start: 0.000000, bitrate: 413 kb/s
    Stream #0:0: Video: h264 (High) (H264 / 0x34363248),
yuv420p(progressive), 1280x720, 404 kb/s, 30 fps, 30 tbr, 30 tbn, 60 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 06256600] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
FMA3 BMI2 AVX2
[libx264 @ 06256600] profile High, level 3.1
Output #0, avi, to 'ball_slow.avi':
  Metadata:
    ISFT            : Lavf58.17.100
    Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p,
1280x720, q=-1--1, 30 fps, 30 tbn, 30 tbc
    Metadata:
      encoder         : Lavc58.20.102 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame=   66 fps=0.0 q=26.0 size=       6kB time=00:00:00.53 bitrate=
85.2kbits/s speed=1.03x

frame=  105 fps=102 q=26.0 size=       6kB time=00:00:01.83 bitrate=
24.8kbits/s speed=1.78x

frame=  129 fps= 83 q=26.0 size=       6kB time=00:00:02.63 bitrate=
17.2kbits/s speed= 1.7x

frame=  159 fps= 77 q=24.0 size=       6kB time=00:00:07.23 bitrate=
 6.3kbits/s speed=3.51x
frame=  197 fps= 76 q=24.0 size=     262kB time=00:00:09.76 bitrate=
219.4kbits/s speed=3.79x

frame=  234 fps= 75 q=24.0 size=     262kB time=00:00:12.23 bitrate=
175.1kbits/s speed=3.93x

frame=  273 fps= 75 q=24.0 size=     518kB time=00:00:14.83 bitrate=
285.8kbits/s speed=4.09x

Past duration 0.999992 too large
frame=  300 fps= 71 q=-1.0 Lsize=     749kB time=00:00:19.96 bitrate=
307.1kbits/s speed= 4.7x
video:729kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 2.708577%
[libx264 @ 06256600] frame I:2     Avg QP: 5.64  size:  3252
[libx264 @ 06256600] frame P:84    Avg QP:18.26  size:  3374
[libx264 @ 06256600] frame B:214   Avg QP:23.41  size:  2132
[libx264 @ 06256600] consecutive B-frames:  1.0%  6.0% 17.0% 76.0%
[libx264 @ 06256600] mb I  I16..4: 89.6%  8.0%  2.3%
[libx264 @ 06256600] mb P  I16..4:  0.7%  1.6%  1.4%  P16..4:  2.1%  1.5%
0.6%  0.0%  0.0%    skip:92.2%
[libx264 @ 06256600] mb B  I16..4:  0.1%  0.1%  0.1%  B16..8:  3.8%  2.6%
0.6%  direct: 0.2%  skip:92.5%  L0:44.6% L1:38.0% BI:17.4%
[libx264 @ 06256600] 8x8 transform intra:29.8% inter:3.5%
[libx264 @ 06256600] coded y,uvDC,uvAC intra: 17.2% 1.1% 0.1% inter: 1.4%
0.0% 0.0%
[libx264 @ 06256600] i16 v,h,dc,p: 88%  7%  5%  0%
[libx264 @ 06256600] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 10% 71%  0%  0%
0%  0%  0%  0%
[libx264 @ 06256600] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 19% 38%  4%  3%
3%  3%  3%  2%
[libx264 @ 06256600] i8c dc,h,v,p: 92%  4%  4%  0%
[libx264 @ 06256600] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 06256600] ref P L0: 60.2%  2.4% 16.7% 20.7%
[libx264 @ 06256600] ref B L0: 77.2% 20.2%  2.6%
[libx264 @ 06256600] ref B L1: 89.2% 10.8%
[libx264 @ 06256600] kb/s:298.52


More information about the ffmpeg-user mailing list