I need to play video files by the ffplay (or the ffmpeg if is it possible) and display current play time.
Please tell me how can I see the current play time (as H:M:S) with ffplay?
OS = MS Windows 7
ffplay -vf "drawtext=text='%{pts\:hms}':box=1:x=(w-tw)/2:y=h-(2*lh)" input.mp4
If your build does not support fontconfig, then you'll have to add the fontfile option with the path to the font. See drawtext filter docs for more info.
In Windows you may have to first set the FONTCONFIG_PATH variable (and/or other related variables).
You can add boxborderw=4 if you want more padding in the box, but you'll need a relatively recent build. See the FFmpeg Download page.
%{pts}, but not hh:mm:ss via {pts:hms}, not until I got all my quoting exactly correct (single, double, backslash), exactly as shown; i.e., ffplay -vf "...text='{pts\:hms}' ..."
For more options, there's this tip, direct from FFMPEG on Twitter:
-vf "drawtext=text='%{pts\:hms}':fontsize=48:fontcolor=white:box=1:boxborderw=6:[email protected]:x=(w-text_w)/2:y=h-text_h-20"
How to use drawtext displays the current localtime on windows
ffmpeg.exe -re -i "c:\aaa.avi" -vf drawtext="fontfile=simhei.ttf:fontsize=14:fontcolor=white:shadowcolor=black:shadowx=2:shadowy=1:x=8:y=8:text='???'" -q 5 -s 720*405 -aspect 16:9 -r 15 -threads 4 -vcodec flv -acodec libmp3lame -ar 44100 -ab 64k -ac 2 -f flv "rtmp://127.0.0.1/aaa/flv"