[FFmpeg-devel] [patch][RFC] mpeg-ts not packetized properly over UDP

Michael Niedermayer michaelni
Tue Aug 17 14:02:54 CEST 2010

On Sun, Aug 15, 2010 at 04:24:59PM +0300, aviad rozenhek wrote:
> when using ffmpeg to mux an mpegts stream over UDP, the data is not
> packetized properly.
> the default packet size of UDP is 1472, which is not an integer multiple of
> 188 (the TS packet size).
> this causes problems if UDP packets are dropped or reordered.
> this can be worked around from the commandline if changing  cmdline from:
> *> ffmpeg -re -i <input_file>  -f mpegts udp://localhost:1234*
> to:
> *> ffmpeg -re -i <input_file>  -f mpegts udp://localhost:1234?pkt_size=188*
> *
> *
> however I think this makes it difficult for user to use properly.
> attached is a simple (but not as efficient as possible) patch that fixes
> this problem, by flushing after writing every TS packet.

the udp packet size should be a multiple of the underlaying streams packet
size when possible and it should be as large as possible
making it 188 is not ok, this has too much overhead

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100817/3479b377/attachment.pgp>

More information about the ffmpeg-devel mailing list