[FFmpeg-user] sync two streams

Jon bae jonbae77 at gmail.com
Tue Aug 15 10:13:59 EEST 2017


2017-08-12 22:10 GMT+02:00 Moritz Barsnick <barsnick at gmx.net>:

> On Tue, Aug 08, 2017 at 08:43:27 +0200, Jon bae wrote:
> > The problem is now that the both streams have a little delay from ~1
> > second. I found out, that when I would encode both stream new and send
> them
> > via the *tee *output from one ffmpeg instance it would be sync. But I
> don't
> > want to transcode the full res again.
> >
> > Have you some tips what I could do, to sync this both streams?
>
> Sure, you can send it twice. If you're not recoding with ffmpeg, but
> using the "copy" codec, it may suffice to "encode" twice, it shouldn't
> impact performance:
>
> $ ffmpeg -i input-stream-url -c copy -f mpegts server-stream-url1 -c copy
> -f mpegts server-stream-url2
>
> Moritz
> _______________________________________________
>

Hi Moritz,
I forgot to write my full command down, because I do this already:

ffmpeg -i rtmp://localhost/live/stream -s 512x288 -c:v libx264 -crf 23
-preset slow -g 25 -c:a copy [...] -f flv rtmp://output1 -c copy -f flv
rtmp://output2

With this command output2 is a bit faster in time then output1. When I
transcode both outputs it would be sync.

Jonathan


More information about the ffmpeg-user mailing list