For a project we need to manually control an overlay (static image) on top of a video stream. We concluded that we will need ZeroMQ to control this, and we've managed to control an audio filter successfully through ZeroMQ.
To achieve this we've considered two options:
- Use a color filter to control the foreground (image) transparency
- "Move" the overlay image in front of the video stream, and remove it out of the video canvas
We've managed to get both working, but not in combination with ZeroMQ, unfortunately.
Example:
ffmpeg -loglevel verbose \
-i $STREAM \
-i overlay.png \
-bsf:a aac_adtstoasc \
-threads 12 \
-vf "zmq=bind_address=tcp\\\://127.0.0.1\\\:1235, [0:v][1:v]overlay=25:25" \
-c:a aac \
-af "azmq=bind_address=tcp\\\://127.0.0.1\\\:1235,volume=1" \
-c:v h264 output
The above example produces the following error:
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Advice on how this can be achieved is highly appreciated!