使用ffplay可以显示时间戳:
ffplay -vf "drawtext=text='%{pts\:hms}':fontcolor=white:shadowcolor=black:shadowx=3:shadowy=3:fontsize=48:x=(w-tw)/2:y=h-(2*lh)" video.mp4
然而,我希望仅在视频暂停时显示时间戳。
使用ffplay是否可行?如果可能的话,我还希望在浏览视频时临时显示时间戳。
Ctrl+1 script_message bookmark-set 1 # `Ctrl+1` will "save current filePath and seekPos to bookmark #1 slot"
Alt+1 script_message bookmark-load 1 # `Alt+2` will "restore current filePath and seekPos from bookmark #1 slot"
Alt+Ctrl+1 script_message bookmark-peek 1 # `Alt+Ctrl+2` will give you a "peek of the filename, its immediate parent directory and seek-pos saved in the bookmark #1 slot"
Ctrl+2 script_message bookmark-set 2
Alt+2 script_message bookmark-load 2
Alt+Ctrl+2 script_message bookmark-peek 2
s script_message bookmark-update # `s` will update last saved/restored bookmark
d script_message bookmark-peek-current # `d` will peek last saved/restored bookmark (lastest saved/restored bookmark is only considered if current file is in the same directory as the bookmark file)
u script_message bookmark-set-undo # `u` will undo/revert last save or update action
mpv
),以更好地控制在视频顶部渲染的内容。另一种选择是创建一个Python脚本,使用OpenCV等工具管理视频并在其上方显示时间戳。
mpv
和 Lua 脚本(你可能需要自己制作). - llogan