I'd like to use a marker on a live video source which has external live data to set x,y coordinates. sendcmd can read the text file but it won't update it, so later updates are not executed. Is it possible only with zmq? And if so, can I use zmq as a single filter (with drawtext), not with filter complex?
I have a python that exports live coordinates in the appropriate format to a cmd.txt file. I use unix time for the coordinates and I also copy the input timestamps from the live loopback device so they have almost the same time. There's a small delay so I have compensated the exported timestamps with +1.5s. This means the marker is moving for this extra period (while timestamps in cmd.txt are a bit ahead of the live source), but it won't update any more. I assume that FFmpeg reads this cmd.txt and won't update it any more but my python is writing it continuously.
Example line of the cmd.txt:
1557402120.3119707 drawtext reinit 'x=752:y=480';
This is the actual ffmpeg pipe:
ffmpeg -fflags nobuffer -vaapi_device /dev/dri/renderD128 -f v4l2 -i /dev/video0 -vf "sendcmd=f=cmd.txt,drawtext=fontfile=font.ttf:fontsize=30:fontcolor=white:r=25:text='o',format=nv12,hwupload" -copyts -c:v h264_vaapi -qp 24 -y 0.mp4
Source is a loopback device with unix time as input timestamp.