Change image overlay on demand

后端 未结 2 1025
夕颜
夕颜 2020-12-22 12:45

I need your help. I stream to Twitch with this Command:

ffmpeg -i input.mp4 -i image.jpg -filter_complex \'overlay=x=10:x=10\' -s \\
  1920x1200 -framerate 1         


        
相关标签:
2条回答
  • 2020-12-22 13:26

    To answer the "variable time" part of your question use a cron job to run scripts that update the overlay image at a specified time i.e. every 5 mins. For example you can create a folder of various overlays and select one randomly every 5 minutes and copy it to image.jpg. FFMPEG will then render the new image to your stream.

    It is important to use -f image 2 -loop 1 -thread_queue_size 512 -i image.jpg especially when rendering other image formats.

    0 讨论(0)
  • 2020-12-22 13:35

    Add the -f image2 -loop 1 input options for the image input, then atomically replace image.jpg when desired such as by using mv.

    Basic example:

    ffmpeg -i input.mp4 -f image2 -loop 1 -i image.jpg -filter_complex overlay output.mp4
    

    Streaming example:

    ffmpeg -re -i input.mp4 -f image2 -loop 1 -i image.jpg -filter_complex "overlay,format=yuv420p" -c:v libx264 -preset fast -g 50 -b:v 4000k -maxrate 4000k -bufsize 8000k -f flv 'rtmp://'
    
    0 讨论(0)
提交回复
热议问题