LoginSignup
5
7

More than 5 years have passed since last update.

FFmpegで現在時刻を表示させながら出力する

Posted at

概要

タイトルの通り、FFmpegでエンコード、出力する際に現在時刻を表示させながら出力する。rtmp形式で出力させたりするときとかにそのときの時刻がわかって便利。

やり方

パラメータに以下を含める(filter_complexについてはvfとかでもいけるはず)。
-filter_complex "drawtext=fontfile=<フォントファイルのパス>:text='%{localtime\:%X}'"

localtimeについては以下を参照。
https://ffmpeg.org/ffmpeg-filters.html#Text-expansion

%Xで現在の時刻が出力される。仕様ではsee strftime(3)とあるので、それ以外の値(日付とか)を出力させたい場合は以下が参考になる……かもしれない(未確認)。
https://linuxjm.osdn.jp/html/LDP_man-pages/man3/strftime.3.html

5
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
7