[FFmpeg-user] Recorded Frame Timestamps are Inconsistent! How to Fix it?

Hassan hassaniqbal931 at gmail.com
Mon Mar 22 15:22:54 EET 2021


>
> Try this:
> ffmpeg -f gdigrab  -i desktop -vf "settb=expr=1/720000, setpts=N*12000,
> fps=60" -c:v libx264rgb
> -preset ultrafast ./test_SD_1.mkv
> See if it works.
>
>  \ffmpeg> ffmpeg -f gdigrab  -i desktop -vf "settb=expr=1/720000,
setpts=N*12000, fps=60" -c:v libx264rgb -preset ultrafast ./test_SD_1.mkv
ffmpeg version 4.3.2-2021-02-20-essentials_build-www.gyan.dev Copyright (c)
2000-2021 the FFmpeg developers
pencore-amrwb --enable-libmp3lame --enable-libtheora
--enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb
--enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[gdigrab @ 000002755743dc80] Capturing whole desktop as 1920x1080x32 at
(0,0)
[gdigrab @ 000002755743dc80] Stream #0: not enough frames to estimate rate;
consider increasing probesize
Input #0, gdigrab, from 'desktop':
  Duration: N/A, start: 1616419007.328868, bitrate: 1988680 kb/s
    Stream #0:0: Video: bmp, bgra, 1920x1080, 1988680 kb/s, 29.97 fps,
1000k tbr, 1000k tbn, 1000k tbc
File './test_SD_1.mkv' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (bmp (native) -> h264 (libx264rgb))
Press [q] to stop, [?] for help
[libx264rgb @ 0000027557442240] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264rgb @ 0000027557442240] profile High 4:4:4 Predictive, level 4.2,
4:4:4, 8-bit
[libx264rgb @ 0000027557442240] 264 - core 161 r3048 b86ae3c - H.264/MPEG-4
AVC codec - Copyleft 2003-2021 - 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=0 weightp=0 keyint=250
keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, matroska, to './test_SD_1.mkv':
  Metadata:
    encoder         : Lavf58.45.100
    Stream #0:0: Video: h264 (libx264rgb) (H264 / 0x34363248), rgb24,
1920x1080, q=-1--1, 60 fps, 1k tbn, 60 tbc
    Metadata:
      encoder         : Lavc58.91.100 libx264rgb
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame=  588 fps= 30 q=-1.0 Lsize=    4425kB time=00:00:09.78
bitrate=3704.7kbits/s speed=0.497x
video:4420kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.095925%
[libx264rgb @ 0000027557442240] frame I:3     Avg QP:15.33  size:1206028
[libx264rgb @ 0000027557442240] frame P:585   Avg QP:15.77  size:  1552
[libx264rgb @ 0000027557442240] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264rgb @ 0000027557442240] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:
 0.5%  0.0%  0.0%  0.0%  0.0%    skip:99.5%
[libx264rgb @ 0000027557442240] coded y,u,v intra: 33.4% 33.6% 33.4% inter:
0.2% 0.2% 0.2%
[libx264rgb @ 0000027557442240] i16 v,h,dc,p: 65% 30%  3%  1%
[libx264rgb @ 0000027557442240] kb/s:3694.57
Exiting normally, received signal 2.


Here is the output of ffprobe on the above recorded video

ffmpeg> ffprobe .\test_SD_1.mkv
ffprobe version 4.3.2-2021-02-20-essentials_build-www.gyan.dev Copyright
(c) 2007-2021 the FFmpeg developers
  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static
--disable-w32threads --disable-autodetect --enable-fontconfig
--enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma
--enable-zlib --enable-libsrt --enable-libssh --enable-libzmq
--enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264
--enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg
--enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi
--enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf
--enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec
--enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx
--enable-libgme --enable-libopenmpt --enable-libopencore-amrwb
--enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc
--enable-libgsm --enable-libopencore-amrnb --enable-libopus
--enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, matroska,webm, from '.\test_SD_1.mkv':
  Metadata:
    ENCODER         : Lavf58.45.100
  Duration: 00:00:09.80, start: 0.000000, bitrate: 3698 kb/s
    Stream #0:0: Video: h264 (High 4:4:4 Predictive), gbrp(tv,
gbr/unknown/unknown, progressive), 1920x1080, 60 fps, 60 tbr, 1k tbn, 120
tbc (default)
    Metadata:
      ENCODER         : Lavc58.91.100 libx264rgb
      DURATION        : 00:00:09.800000000


More information about the ffmpeg-user mailing list