ent*_*eek 1 time date gstreamer
目前我可以在视频流上显示当地时间文本(时钟叠加)。
gst-launch-1.0 v4l2src ! videoconvert ! 'video/x-raw,width=640,height=480' ! clockoverlay ! ximagesink
我正在努力寻找一种显示当前日期的方法(假设本地时区)。
我确信我可以通过编写自己的插件来做到这一点。但是,是否有库存或变通方法可以避免重新发明轮子?有任何想法吗?
退房gst-inspect-1.0 clockoverlay
。如果这样做,您会注意到以下选项:
time-format : Format to use for time and date value, as in strftime.
flags: readable, writable
String. Default: "%H:%M:%S"
Run Code Online (Sandbox Code Playgroud)
因此,如您所见,您可以按照strftime
格式将其设置为您想要的任何内容。查看http://www.cplusplus.com/reference/ctime/strftime/了解详情。
所以对你来说一个简单的方法是使用:
gst-launch-1.0 v4l2src ! videoconvert ! 'video/x-raw,width=640,height=480' ! \
clockoverlay time-format="%D %H:%M:%S" ! ximagesink
Run Code Online (Sandbox Code Playgroud)
您还将在叠加层中显示日期。随意设计text-format
您喜欢的字符串。