First, I realize I'm using an older version of ffmpeg (6.1.2). If this has been fixed/changed in a newer version or if this is the intended behavior that's fine, I'd just like to know which it is.

I'm using ffplay and the drawtext filter to display the time and frame number overlayed on a video using the following command:

  ffplay -i video.mkv -vf "drawtext=text='%{pts\:hms} (%{pts}) FrameNum=%{frame_num} 
FrameType=%{pict_type}':start_number=1:fontfile=/usr/share/fonts/dejavu/DejaVuSans.ttf:fontsize=60:fontcolor=white:box=1:boxcolor=black"

This works fine in that it displays the info. The problem is with frame_num. If I use the ffplay seek forward or backward commands or a right mouse click to seek to a percentage of the video, then the frame_num is reset to 1 (ie start_number) and then starts counting from that seek point. Is this how frame_num is supposed to work or is (maybe was) this a bug?

If this is the intended behavior for the frame_num keyword, then is there an alternate keyword that will always the display the absolute frame number rather than what appears to be a frame number relative to the current seek point?

Thanks.

Complete output of ffplay command
-------------------------------------------

$ ffplay -i video.mkv -vf "drawtext=text='%{pts\:hms} (%{pts}) FrameNum=%{frame_num} 
 
FrameType=%{pict_type}':start_number=1:fontfile=/usr/share/fonts/dejavu/DejaVuSans.ttf:fontsize=60:fontcolor=white:box=1:boxcolor=black"
ffplay version 6.1.2 Copyright (c) 2003-2024 the FFmpeg developers
  built with gcc 14 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg 
--docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 
--mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -flto=auto 
-ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall 
-Wno-complain-wrong-lang -Werror=format-security 
-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection 
-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer' 
--extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs 
-Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' 
--extra-cflags=' -I/usr/include/rav1e' --enable-libopencore-amrnb 
--enable-libopencore-amrwb --enable-libvo-amrwben
c --enable-version3 --enable-bzlib --enable-chromaprint --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-lcms2 --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libbs2b --enable-libcodec2 --enable-libcdio --enable-libdrm --enable-libjack --enable-libjxl --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libharfbuzz --enable-libilbc --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-libplacebo --enable-librsvg --enable-librav1e --enable-librubberband --enable-libsmbclient --enable-version3 --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-vapoursynth --enable-libvpx --enable-vulkan --enable-libshaderc --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-avfilter --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-lto --enable-libvpl --enable-runtime-cpudetect
  libavutil      58. 29.100 / 58. 29.100
  libavcodec     60. 31.102 / 60. 31.102
  libavformat    60. 16.100 / 60. 16.100
  libavdevice    60.  3.100 / 60.  3.100
  libavfilter     9. 12.100 /  9. 12.100
  libswscale      7.  5.100 /  7.  5.100
  libswresample   4. 12.100 /  4. 12.100
  libpostproc    57.  3.100 / 57.  3.100
Input #0, matroska,webm, from 'video.mkv':
  Metadata:
    ENCODER         : Lavf60.16.100
  Duration: 02:25:29.71, start: 0.000000, bitrate: 5116 kb/s
  Stream #0:0: Video: vp8, yuv420p(tv, bt709, progressive), 1920x1080, SAR 1:1 
DAR 16:9, 30 fps, 30 tbr, 1k tbn
    Metadata:
      DURATION        : 02:25:29.700000000
  Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp
    Metadata:
      DURATION        : 02:25:29.712000000
   3.17 A-V: -0.015 fd=   0 aq=   15KB vq=  683KB sq=    0B f=0/0
^C
_______________________________________________
ffmpeg-user mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to