3

So I am trying to stream a H.264 (.mp4) video over ETHERNET using the ffmpeg tool. I have read a little about transport of H.264 video over ethernet and have learnt that there are two methods; mpeg-ts and RTP (both over UDP). I have been able to stream the .mp4 video through both methods in ffmpeg (over localhost) and haven't noticed any difference in quality or latency as such. What is the difference in concept and efficiency between the two protocols for transportation of video? Or am I mixing two different concepts? Any help is appreciated!

Candy
  • 133
  • 1
  • 10

2 Answers2

4

RTP has less overhead than using a transport stream, since RTP uses the full Ethernet packet size available (MTU of around 1500 bytes normally), whereas TS packets are 188 bytes in size. Also, ffmpeg's UDP protocol, which is normally used to send a TS over the network does not support packet reordering on the receiver side.

micha137
  • 1,195
  • 8
  • 22
2

The answer from micha137 does not quite cover all of the possibilities.

MPEG-TS can be carried directly over UDP or carried over RTP (over UDP). RTP adds a 12 byte (min) header containing a timestamp for synchronization.

In both cases, common practice is to put seven 188Byte TS packets within the underlying packet, whether the underlying packet is RTP or UDP. (some professional encoders also let you set 1- or 4-packets per UDP)

But to make it more confusing, RTP can also carry other media types (voice, etc), including directly mapping H.264 NALUs into an RTP payload.

Of all the encapsulation formats, H.264-NALU-over-RTP-over-UDP has the lowest overhead as it avoids the repeated packet headers of the MPEG-TS packets.

See RTP Payload Formats for more info on that.

Broadcast applications typically use MPEG-TS, most commonly directly over UDP but also RTP-over-UDP.

Internet applications did use H.264-over-RTP but this has been supplanted by HLS which (mostly) uses TS file chunks, and MPEG-DASH which (mostly) uses CMAF fragmented mp4 files.

Danny
  • 2,482
  • 3
  • 34
  • 48