In my zsh
script, I am receiving a string that represents a Unix epoch, like:
myTimestamp="1719742786"
I want to change that date into a formatted string, and then store it in a variable so it can be used in an upcoming ffmpeg
script. I’m doing it this way:
theDate=$(date -u -r "$myTimestamp" "+%b %d, %H:%M:%S")
echo "$theDate"
which prints to my screen what I want:
Jun 30, 06:19:48
but when I try to use this variable in my ffmpeg script, I get errors:
ffmpeg -y -i "$file" -vf
"drawtext=text='$theDate':fontcolor=gray:fontsize=$fontSize:x=$width:y=$height:"
"$output"
Note that if I change out '$theDate'
in the script (to something like '$myTimestamp'
), I do not get errors.
What I do get, along with Error initializing filters
, is this (possibly important?) error:
Both text and text file provided. Please provide only one
4