[FFmpeg-user] Receiving streams from two RTP stream sources, stacking them and sending to RTMP

Carl Eugen Hoyos ceffmpeg at gmail.com
Sat Feb 9 23:17:39 EET 2019


2019-02-08 13:02 GMT+01:00, Nestor Morales <nestor.morales at system73.com>:
> Hello everyone,
>
> I have two RTP sources (they will be more in the future, but I am starting
> with these two), sent from two different source in a Janus server. Each
> input has video and audio, which received at a different port each.
>
> I am able to receive these inputs, create a mosaic, and then send the
> result to a .mp4 file. However, if I try to send the resulting mosaic to a
> RTMP endpoint (Youtube, in this case), I start having issues, I guess that
> due to synchronization related problems. In Youtube, I sometimes receive
> the content, for a few seconds, then it is lost, it comes back...
>
> This is the expected schema:
>
> RTP1
>            \
>               >> ffmpeg --> RTMP
>            /
> RTP2
>
> This is what I have up to this point. I've tried with other configurations
> but, in general, the obtained errors are always the same.
>
> /usr/bin/ffmpeg \
>   -vsync 1 -protocol_whitelist file,udp,rtp -analyzeduration 60M -probesize
> 60M -i ../janus1.sdp \
>   -vsync 1 -protocol_whitelist file,udp,rtp -analyzeduration 60M -probesize
> 60M -i ../janus2.sdp \
>   -c:v libx264 -preset veryfast -tune zerolatency \
>   -g 60 -keyint_min 30 -sc_threshold 0 -dts_delta_threshold 0 \
>   -b:v:0 1000k -profile:v:0 baseline \
>   -c:a aac -b:a 128k -ar 48000 \
>   -filter_complex \
>     "
>         [0:v]fps=fps=30, setpts='PTS-STARTPTS', showinfo,
> scale=320x480[vid1];
>         [1:v]fps=fps=30, setpts='PTS-STARTPTS', showinfo,
> scale=320x480[vid2];
>         [vid1][vid2]hstack
>     " \
>   -max_muxing_queue_size 1024 \
>   -strict experimental \
>   -f flv "rtmp://a.rtmp.youtube.com/live2/####-####-####-####"

Can you rule out that you see a performance issue caused by
the console output of the showinfo filter?

Please remove your email footer, Carl Eugen


More information about the ffmpeg-user mailing list