【问题标题】:TimeStamp variable stopped working in bash script with avconvTimeStamp 变量停止在带有 avconv 的 bash 脚本中工作
【发布时间】:2019-03-24 15:45:42
【问题描述】:

在我将所有 Raspberry Pi 升级到第 9 版之前,以下脚本运行良好:

#!/bin/bash

cd /home/pi/Videos/SecurityCam/
DToday=`date '+%Y%m%d-%H%M%S'`
fn="VID $DToday"
SubT="PP $PB $DToday"

avconv -f video4linux2 -i /dev/video0 -t 3600 -r 4 -vf "drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: \text=\'$SubT \%T \' : fontcolor=white@0.8: x=7: y=460" -vcodec libx264 -vb 2000k \-y ${fn}.avi

它现在在 %T 上窒息。为什么会这样?在视频中获取滚动时间戳的正确方法是什么?

【问题讨论】:

标签: bash raspbian drawtext avconv


【解决方案1】:

试试这个:

#!/bin/bash
cd /home/pi/Videos/SecurityCam/ || exit
DToday=$(date '+%Y%m%d-%H%M%S')
fn="VID $DToday"
SubT="PP $PB $DToday"

avconv -f video4linux2 -i /dev/video0 -t 3600 -r 4 -vf "drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: \text=\'$SubT \%T \' : fontcolor=white@0.8: x=7: y=460"
 -vcodec libx264 -vb 2000k -y "${fn}.avi"

【讨论】:

  • 这行不通!时间戳问题与我所展示的有何不同? \%T 仍然不起作用,因此更改文件名的指定方式对我来说没有意义。
猜你喜欢
  • 2016-10-23
  • 2013-07-08
  • 1970-01-01
  • 1970-01-01
  • 2022-10-17
  • 1970-01-01
  • 2016-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多