I'm trying to stream to a rtmp endpoint a loop of a gif and audio. Currently, my command is only looping the gif, not the audio. The audio will play once and stop. I've tried multiple ways to make the mp3 loop as well, but I wasn't able to. Here's the command I'm using:
ffmpeg -re -stream_loop -1 -i ./ad/promo.gif -stream_loop -1 -i ./mp3s/rel.mp3 -acodec aac -b:a 64k -vcodec libx264 -b:v 200k -filter:v scale=w=1920:h=1080 -g 15 -r 15 -loop 0 -pix_fmt yuv420p -preset ultrafast -f flv rtmp://
In a side note, I'm trying to make the stream use as low cpu as possible, since I'll need to stream this output to multiple rtmp endpoints. How can I add multiple rtmp endpoints to the same stream?
This is the source code on fluent-ffmpeg that generates the ffmpeg command:
const command = ffmpeg()
.input(gifPath)
.inputOption('-re')
.inputOption('-stream_loop -1')
.input(mp3Path)
.inputOption('-stream_loop -1')
.audioCodec('aac')
.withAudioBitrate('64k')
.withSize('1920x1080')
.withVideoCodec('libx264')
.videoBitrate('200k')
.addOutputOptions('-g 15')
.addOutputOptions('-r 15')
.addOutputOption('-loop 0')
.outputOptions('-pix_fmt yuv420p')
.addOutputOptions('-preset ultrafast')
.output(stream)