Answer the question
In order to leave comments, you need to log in
How to replace the image during the broadcast of a video stream using FFmpeg?
A transparent png image is overlaid on the stream from the camera with a logo at the top and thermometer readings at the bottom.
ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]/h264" -i "/home/cam/iptv_broadcast/logo.png" -filter_complex "[0:v][1:v] overlay=25:25" -vcodec libx264 -b:v 3000k -f mpegts "udp://@xxx.xxx.x.xxx:xxxx"
Answer the question
In order to leave comments, you need to log in
With on-the-fly image replacement by means of FFmpeg, it will not take off, however, I solved the problem using the drawtext filter. Logos and emblems are static, but the values ​​themselves change thanks to the reload=1 option
ffmpeg -rtsp_transport tcp -i "rtsp://admin:[email protected]/h264" -i "/home/cam/iptv_broadcast/logo.png"
-filter_complex "[0:v][1:v] overlay=50:10, drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf:fontcolor=0xffa500:fontsize=45:x=160:y=985:textfile=/home/cam/iptv_broadcast/temp.txt:reload=1"
-vcodec libx264 -b:v 3000k -f mpegts "udp://@xxx.xxx.x.xxx:xxxx"
You should look at our transcoder, there is graphics overlay functionality, it covers this case.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question