Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFmpeg Reloading Changed image overlay whilst using a complex filter/

I am currently using this code to overlay an image over a stream . I would like to change the image being overlayed regularly. I am using a second script to cp a randomly selected jpg from a folder to a specific folder/advert.jpg every minute. When i run ffmpeg it keeps on using the original image even though the original image in the directory would have been overwritten.

ffmpeg  -re  -i  "http://127.0.0.1:8000/251.m3u8" -loop 1 -i "/home/johan/CurrentAd/advert.jpg" -filter_complex "[1]trim=0:600,fade=in:st=0:d=2:alpha=1,fade=out:st=8:d=2:alpha=1,loop=999:1750:0,setpts=N/5/TB[w];[0][w]overlay=(W-w)/2:(H-h)/2:shortest=1" /var/www/html/sevo/sevo.m3u8  >/dev/null
like image 330
Johan Meh Avatar asked Mar 09 '26 21:03

Johan Meh


1 Answers

Force the generic image muxer:

ffmpeg  -re  -i  "http://127.0.0.1:8000/251.m3u8" -loop 1 -f image2 -i ...

Without -f image2, ffmpeg invokes jpeg_pipe for JPG input, which doesn't update the input with loop set.

like image 198
Gyan Avatar answered Mar 12 '26 11:03

Gyan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!