ffplay顯示目前播放時間(PTS)

1. 安裝libfreetype6-dev

sudo apt-get install libfreetype6-dev

2. 啟用ffmpeg設定

configure加入--enable-libfreetype

3. 編譯

make

4, 播放

Ubuntu 16.04路徑下的Freefont:
/usr/share/fonts/truetype/freefont/FreeSerif.ttf

ffplay -vf "drawtext=fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf:fontsize=50:text='%{pts\:hms}':box=1:x=(w-tw)/2:y=h-(2*lh)" /content/movie.mp4

參考
https://superuser.com/questions/968685/how-to-display-current-time-with-the-ffplay-exe

drawtext語法
https://ffmpeg.org/ffmpeg-filters.html#drawtext


留言