FFmpeg Reloading Changed image overlay whilst using a complex filter/

浪子不回头ぞ 提交于 2021-02-09 11:58:08

问题


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

回答1:


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.



来源:https://stackoverflow.com/questions/44123816/ffmpeg-reloading-changed-image-overlay-whilst-using-a-complex-filter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!