aviad rozenhek
2010-08-15 13:24:59 UTC
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.
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.
--
Aviad Rozenhek
Aviad Rozenhek