Unable to publish multiple UDP streams to the same application using FFmpeg

I am trying to send multiple streams to the same application using FFmpeg but only one stream at a time works correctly. I pass a sample video file to FFmpeg and then I send it via UDP as explained in this tutorial “How to use FFmpeg with Wowza Streaming Engine (MPEG-TS)”.

ffmpeg -re -i sample_video.h264 -vcodec libx264 -an -f mpegts udp://127.0.0.1:8554?pkt_size=1316/live/stream_test1

ffmpeg -re -i sample_video.h264 -vcodec libx264 -an -f mpegts udp://127.0.0.1:8554?pkt_size=1316/live/stream_test2

In Wowza I set up two endpoints:

udp://127.0.0.1:8554/live/stream_test1

udp://127.0.0.1:8554/live/stream_test2

One of the two streams always work whereas the other do not. It seems to me that the application is not capable of routing/distinguishing the two streams. I also tried different UDP URL but with no luck:

ffmpeg -re -i sample_video.h264 -vcodec libx264 -an -f mpegts udp://127.0.0.1:8554/live?pkt_size=1316/stream_test1

ffmpeg -re -i sample_video.h264 -vcodec libx264 -an -f mpegts udp://127.0.0.1:8554/live/stream_test1?pkt_size=1316

ffmpeg -re -i sample_video.h264 -vcodec libx264 -an -f mpegts udp://127.0.0.1:8554/live/stream_test1

I am sure I am missing something trivial in my setup, hope someone can give me a hand.

Best

Leo

Hello!

Thanks for contacting Wowza Forums!

One thing I notice is you ar eusing the same port for all the streams. Here is an article on allowing port sharing for UDP. This may resolve your issue. Also, are you using .stream files or SDP files?

Port Sharing

Regards,

Jermaine