rtp/rtsp over tcp with ffmpeg/wowza

Hi,

I’m trying to make a stream from my application to an other application. I’m using ffmpeg with libx264, output: rtp://:6970/ . I connect with ffmpeg to rtsp://:1935/live/ms.sdp . I’ve done the instruction: https://www.wowza.com/docs/how-to-set-up-live-streaming-using-a-native-rtp-encoder-with-sdp-file

The streaming is working, but sometimes it stick for a while. I think this is a network problem. I need all of the frames lossless.

My first idea was a bigger buffer, but maybe the frame vanish before it arrives to the server.

Can I do somehow to work all of the communication over TCP, and not UDP?

Can that help?

I really don’t know ffmpeg well enough to know if this is possible.

Charlie

Wowza supports RTSP/RTP interleaved (RTP over TCP). So this is possible. It is the player that controls if RTSP/RTP interleaved is used or not. There is no way to force this from the server side.

Charlie

Yes, we can receive an RTSP/RTP stream over TCP. This is controlled by the encoder and not Wowza.

Charlie

Possibly. Another option is ffmpeg also support RTMP. RTMP is TCP only. It may be a better option. Do not know specific on how to make this work.

Charlie

Also take a look at:

https://www.wowza.com/docs/how-to-use-ffmpeg-with-wowza-media-server-mpeg-ts)

Richard

Use of ?tcp should force the FFmpeg RTSP code to use TCP. I use this switch with FFmpeg all the time. Make sure that ‘?’ does not have any special meaning in the shell environment you are using. If it does then wrap your URL in quotes.

Hi biroati,

Some great info here on using ffmpeg with RTMP: Publish_a_H264_MP4_file_as_a_live_stream_to_a_RTMP_server

Basically, just start Wowza with a live app, then run: ffmpeg -i sample.mp4 -re -acodec copy -vcodec copy -f flv rtmp://localhost/live/myStream

Play using [Wowza]/examples/LiveVideoStreaming/client/live.html

I read somewhere if I write ?tcp to the end of the URL in ffmpeg that work with tcp. I tried but wireshark said that the connection is udp with this URL too.

The stream which come from wowza is tcp, so it can be lossless, or it’s udp, if I use rtsp stream?

thank you for your fast answer.

Can Wowza receive rtp over tcp, or how is it work?

I’ve read in User Guide that 6970 where wowza receive stream is UDP.

So if I can configure ffmpeg properly it will solve my problem

Any settings that I shoud make for that in wowza, or the default settings that I configure will be ok?

Thank you

I’ll try it tomorrow.

Use of ?tcp should force the FFmpeg RTSP code to use TCP. I use this switch with FFmpeg all the time. Make sure that ‘?’ does not have any special meaning in the shell environment you are using. If it does then wrap your URL in quotes.

It works in ffmpeg input, but not in ffmpeg output, so I tried the rtmp and it works. I tried connect with vlc to wowza, but it lost the rtmp connection many times, and it waited 10 sec before start playing.

Now I working with this:

ffmpeg ----rtmp—>wowza----rtsp/rtp interleaved----->client(ffmpeg, vlc for test)

I hope I have opportunity to try this method in non localhost environment in several days.