FFmpeg重新加载在使用复杂滤镜的同时更改了图像叠加层/ [英] FFmpeg Reloading Changed image overlay whilst using a complex filter/
问题描述
我目前正在使用此代码在流上覆盖图像.我想更改定期叠加的图像.我正在使用第二个脚本每分钟将一个随机选择的jpg从一个文件夹cp到一个特定的folder/advert.jpg.当我运行ffmpeg时,即使目录中的原始图像已被覆盖,它仍继续使用原始图像.
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
推荐答案
强制使用通用图像混合器:
Force the generic image muxer:
ffmpeg -re -i "http://127.0.0.1:8000/251.m3u8" -loop 1 -f image2 -i ...
在没有 -f image2
的情况下,ffmpeg调用jpeg_pipe进行JPG输入,而不会使用循环集更新输入.
Without -f image2
, ffmpeg invokes jpeg_pipe for JPG input, which doesn't update the input with loop set.
这篇关于FFmpeg重新加载在使用复杂滤镜的同时更改了图像叠加层/的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!