Question / Help Syncing 2 RTMP streams into 1

Ataman

New Member
Hello,

I'm trying to put two seperate RTMP streams together with ffmpeg but they're out of sync.
The first RTMP stream is my OBS broadcast and the second a audio only voice overlay from Teamspeak.

the ffmpeg command looks like this:
Code:
ffmpeg -i rtmp://localhost/gaming/obsproject -i rtmp://localhost/gaming/teamspeak -filter_complex "[0:a][1:a]amerge,pan=stereo:c0<c0+c2:c1<c1+c3[aout]" -map 1:v -map "[aout]" -c:v copy -c:a mp3 -f rtmp://localhost/broadcast/live

The first input is way earlier than the second. If I switch those it's the other way around.
obsproject is my standard OBS stream and teamspeak is another ffmpeg instance which fetches the audio from a VAC device and feeds it to rtmp://localhost/gaming/teamspeak.

From hours of googling I came to the conclusion the fault lies with keyframes or the fact that ffmpeg loads those streams not at the same time.

Any idea what I could do to get ffmpeg to load both streams at once or another method to sync them? Should I use another method? Maybe some of you guys tried something similar and solved the problem somehow.

Greetings
Ataman
 

Ataman

New Member
Bump
Is it really this hard to capture two different sources and put them back together without being out of sync?

Guess there aren't many people who stream with several people together except professionals.
 

dodgepong

Administrator
Community Helper
Er, what exactly are you doing with this? It sounds like some sort of hackjob...what is the ultimate goal?

Also even "professionals" have to deal with sync issues with RTMP streams. There is no real way to guarantee two streams being sent to a server will be in sync when you request them both at the same time. RTMP is not designed to do that.
 
Top