# rtp/rtsp over tcp with ffmpeg/wowza

**URL:** <https://community.wowza.com/t/rtp-rtsp-over-tcp-with-ffmpeg-wowza/36904>\
**Category:** Wowza Streaming Engine\
**Created:** [July 4, 2011, 9:23am UTC](https://community.wowza.com/t/rtp-rtsp-over-tcp-with-ffmpeg-wowza/36904 "2011-07-04T09:23:48Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Attila\_Biro](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Attila\_Biro](https://community.wowza.com/u/Attila_Biro)\
**Post date:** [July 4, 2011, 9:23am UTC](https://community.wowza.com/t/rtp-rtsp-over-tcp-with-ffmpeg-wowza/36904/1 "2011-07-04T09:23:48Z")

</div>

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](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?

---

<div class="post-metadata">

**Author:** ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)\
**Post date:** [July 4, 2011, 5:38am UTC](https://community.wowza.com/t/rtp-rtsp-over-tcp-with-ffmpeg-wowza/36904/2 "2011-07-04T05:38:40Z")

</div>

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

Charlie

---

<div class="post-metadata">

**Author:** ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)\
**Post date:** [July 4, 2011, 5:55am UTC](https://community.wowza.com/t/rtp-rtsp-over-tcp-with-ffmpeg-wowza/36904/3 "2011-07-04T05:55:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)\
**Post date:** [July 4, 2011, 6:05am UTC](https://community.wowza.com/t/rtp-rtsp-over-tcp-with-ffmpeg-wowza/36904/4 "2011-07-04T06:05:56Z")

</div>

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

Charlie

---

<div class="post-metadata">

**Author:** ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)\
**Post date:** [July 4, 2011, 6:23am UTC](https://community.wowza.com/t/rtp-rtsp-over-tcp-with-ffmpeg-wowza/36904/5 "2011-07-04T06:23:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [July 5, 2011, 8:58pm UTC](https://community.wowza.com/t/rtp-rtsp-over-tcp-with-ffmpeg-wowza/36904/6 "2011-07-05T20:58:44Z")

</div>

Also take a look at:

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

Richard

---

<div class="post-metadata">

**Author:** ![Steve\_McFarlin](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@Steve\_McFarlin](https://community.wowza.com/u/Steve_McFarlin)\
**Post date:** [July 5, 2011, 11:51am UTC](https://community.wowza.com/t/rtp-rtsp-over-tcp-with-ffmpeg-wowza/36904/7 "2011-07-05T11:51:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Randall\_Auriemma](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@Randall\_Auriemma](https://community.wowza.com/u/Randall_Auriemma)\
**Post date:** [July 4, 2011, 8:56am UTC](https://community.wowza.com/t/rtp-rtsp-over-tcp-with-ffmpeg-wowza/36904/8 "2011-07-04T08:56:28Z")

</div>

Hi biroati,

Some great info here on using ffmpeg with RTMP: [Publish\_a\_H264\_MP4\_file\_as\_a\_live\_stream\_to\_a\_RTMP\_server](http://wiki.xuggle.com/Live_Encoding_Tutorial#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

---

<div class="post-metadata">

**Author:** ![Attila\_Biro](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Attila\_Biro](https://community.wowza.com/u/Attila_Biro)\
**Post date:** [July 4, 2011, 2:45pm UTC](https://community.wowza.com/t/rtp-rtsp-over-tcp-with-ffmpeg-wowza/36904/9 "2011-07-04T14:45:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Attila\_Biro](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Attila\_Biro](https://community.wowza.com/u/Attila_Biro)\
**Post date:** [July 4, 2011, 2:49pm UTC](https://community.wowza.com/t/rtp-rtsp-over-tcp-with-ffmpeg-wowza/36904/10 "2011-07-04T14:49:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Attila\_Biro](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Attila\_Biro](https://community.wowza.com/u/Attila_Biro)\
**Post date:** [July 4, 2011, 3:02pm UTC](https://community.wowza.com/t/rtp-rtsp-over-tcp-with-ffmpeg-wowza/36904/11 "2011-07-04T15:02:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Attila\_Biro](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Attila\_Biro](https://community.wowza.com/u/Attila_Biro)\
**Post date:** [July 4, 2011, 3:08pm UTC](https://community.wowza.com/t/rtp-rtsp-over-tcp-with-ffmpeg-wowza/36904/12 "2011-07-04T15:08:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Attila\_Biro](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Attila\_Biro](https://community.wowza.com/u/Attila_Biro)\
**Post date:** [July 4, 2011, 8:32pm UTC](https://community.wowza.com/t/rtp-rtsp-over-tcp-with-ffmpeg-wowza/36904/13 "2011-07-04T20:32:04Z")

</div>

Thank you

I’ll try it tomorrow.

---

<div class="post-metadata">

**Author:** ![Attila\_Biro](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Attila\_Biro](https://community.wowza.com/u/Attila_Biro)\
**Post date:** [July 5, 2011, 9:34pm UTC](https://community.wowza.com/t/rtp-rtsp-over-tcp-with-ffmpeg-wowza/36904/14 "2011-07-05T21:34:53Z")

</div>

> 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.
