Opened 3 months ago
Last modified 3 months ago
#11149 reopened defect
"drawtext" filter produces trembling text?
Reported by: | idest | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avfilter |
Version: | git-master | Keywords: | drawtext |
Cc: | MasterQuestionable | Blocked By: | |
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
- Put this text into a file "filter.txt":
drawtext=text='%{pts\:hms}':fontsize=128:fontcolor=white
- Execute
ffmpeg.exe -i trembling_text_input.mp4 -/filter:v filter.txt trembling_text_output.mp4"
- Open the newly created file, "trembling_text_output.mp4", in a video player. Notice that the timestamp text is trembling.
OS: Windows 10 Home
ffmpeg: N-116617-g9e3b5b8a26-20240813.
Attachments (1)
Change History (9)
by , 3 months ago
Attachment: | trembling_text_input.mp4 added |
---|
comment:1 by , 3 months ago
Cc: | added |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Summary: | "drawtext" filter produces trembling text → "drawtext" filter produces trembling text? |
comment:2 by , 3 months ago
Try using a lossless codec?
I tried
ffmpeg.exe -i trembling_text_input.mp4 -/filter:v filter.txt -c:v huffyuv trembling_text_output.avi
, the result is the same -- the text is trembling...
comment:3 by , 3 months ago
Version: | unspecified → git-master |
---|
͏ ffmpeg -h encoder=huffyuv
͏ ; indicated "yuv422p" preference..?
͏ Try non-subsampled format, e.g. "rgb24"?
comment:4 by , 3 months ago
indicated "yuv422p" preference..?
I think it does, the output of "ffmpeg -h encoder=huffyuv" includes this line:
Supported pixel formats: yuv422p rgb24 bgra
Try non-subsampled format, e.g. "rgb24"?
I tried these two commands:
ffmpeg.exe -i trembling_text_input.mp4 -/filter:v filter.txt -pix_fmt rgb24 trembling_text_output.mp4"
ffmpeg.exe -i trembling_text_input.mp4 -/filter:v filter.txt -c:v huffyuv -pix_fmt rgb24 trembling_text_output.avi
, and both of them produce trembling text.
comment:5 by , 3 months ago
Component: | undetermined → avfilter |
---|---|
Keywords: | drawtext added |
Resolution: | invalid |
Status: | closed → reopened |
͏ Last to confirm, try this:
͏ ffmpeg -y -v trace -hide_banner -nostdin -nostats -i "${In}" -pix_fmt yuv444p -sws_flags spline+accurate_rnd+full_chroma_int -c:v libx264 -preset placebo -qp 0 -x264-params "keyint=15:no-deblock=1" "yuv444p.avi"
͏ See also: https://trac.ffmpeg.org/wiki/colorspace#yuv444p
comment:6 by , 3 months ago
Just tried it (replacing "${In}" with "trembling_text_input.mp4" and adding the "-/filter:v filter.txt" option), the result is the same.
comment:8 by , 3 months ago
Turns out what font is used matters, for example, if I add "font=tahoma" to the filter value, making it
drawtext=text='%{pts\:hms}':font=tahoma:fontsize=124:fontcolor=white
, there's no trembling in the output video.
͏ Try using a lossless codec?
͏ I guess there's no real issue in the filter:
͏ Merely the artifact of lossy codecs...