When displaying a frame count number in the drawtext filter, the varying height 
of the characters can make the text jitter vertically as they count. Its 
possible to stop this by applying the ‘ascent' value to the y coordinate.

However when the drawtext filter contains a box, this element also jitters 
vertically and there doesn’t appear to be a way to apply the same method of 
using the ‘ascent’ value to stabilise it.

Here is an example command (font is relevant to macOS):

ffmpeg -f lavfi -i "color=red:size=1280x720:rate=24" -y -t 12 -c:v mjpeg 
-qscale:v 4 -huffman default -pix_fmt yuvj422p -vf 
"drawtext=fontfile=/System/Library/Fonts/Geneva.dfont: fontcolor=white: 
fontsize=150: box=1: boxcolor=black: boxborderw=5: x=640: y=500-ascent: 
text=%{n}: start_number=0" output.mov

In the above example, including ‘-ascent' in the y coordinate value stops the 
number characters from being jittery as they count. However you can see the box 
is still jittery and does not seem to support having the ‘-ascent’ value 
applied to it.

Is there any way to negate this jitter when using a box? Thanks.


Full uncut command:

ffmpeg version N-93020-g3224d6691c-tessus  https://evermeet.cx/ffmpeg/  
Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg 
--extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl 
--enable-libaom --enable-libass --enable-libbluray --enable-libdav1d 
--enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame 
--enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb 
--enable-libopenh264 --enable-libopenjpeg --enable-libopus 
--enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr 
--enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab 
--enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack 
--enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs 
--enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi 
--enable-version3 --pkg-config-flags=--static --disable-ffplay
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 44.100 / 58. 44.100
  libavformat    58. 26.100 / 58. 26.100
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 48.100 /  7. 48.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, lavfi, from 'color=red:size=1280x720:rate=24':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720 [SAR 
1:1 DAR 16:9], 24 tbr, 24 tbn, 24 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x7fce5b00d800] deprecated pixel format used, make sure you did set 
range correctly
Output #0, mov, to 'output.mov':
  Metadata:
    encoder         : Lavf58.26.100
    Stream #0:0: Video: mjpeg (jpeg / 0x6765706A), yuvj422p(pc), 1280x720 [SAR 
1:1 DAR 16:9], q=2-31, 200 kb/s, 24 fps, 12288 tbn, 24 tbc
    Metadata:
      encoder         : Lavc58.44.100 mjpeg
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame=  288 fps=0.0 q=4.0 Lsize=    7103kB time=00:00:11.95 
bitrate=4865.5kbits/s speed=19.7x    
video:7101kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing 
overhead: 0.027039%
_______________________________________________
ffmpeg-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to