C
C
crossassembler2014-12-05 17:50:48
Video
crossassembler, 2014-12-05 17:50:48

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"

Thermometer readings should be updated every 15 minutes. Only if you change the logo.png file during the broadcast - the broadcast occurs without changes. Only restarting the broadcast helps.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
crossassembler, 2015-12-09
@crossassembler

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"

Y
Yuri Udovichenko, 2014-12-11
@Aquary

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 question

Ask a Question

731 491 924 answers to any question