Skip to main content

UDP streaming

Products: Video Capture SDK .Net

The SDK is equipped to handle streaming of both video and audio over the User Datagram Protocol (UDP), supporting both H264/HEVC for video and Advanced Audio Coding (AAC) for audio. Utilizing FFMPEG for UDP streaming, the SDK ensures efficient handling of multimedia data. The video and audio encoded data are expertly muxed into MPEG-TS (MPEG Transport Stream) packets, a format well-suited for transmission over packet-based systems like UDP. This capability is especially valuable for applications demanding low-latency and high-quality streaming, such as live broadcasting, video conferencing, and real-time surveillance systems. The combination of H264/HEVC and AAC codecs with MPEG-TS packeting ensures a balance of quality and performance, making the SDK a robust solution for developers in diverse streaming scenarios.

Additionally, the SDK also supports multicast streaming over UDP, enabling simultaneous transmission of video and audio to multiple recipients. This feature is particularly useful for efficiently distributing content in scenarios like live event broadcasting or corporate communications, complementing the SDK's comprehensive streaming capabilities.

Sample code

Set the Network_Streaming_Enabled property to true to enable network streaming.

VideoCapture1.Network_Streaming_Enabled = true;

Enable audio streaming.

VideoCapture1.Network_Streaming_Audio_Enabled = true;

Set the Network_Streaming_Format property to UDP_FFMPEG_EXE to enable UDP streaming.

VideoCapture1.Network_Streaming_Format = NetworkStreamingFormat.UDP_FFMPEG_EXE;

Set the Network_Streaming_URL property to the URL of the UDP stream.

VideoCapture1.Network_Streaming_URL = "udp://127.0.0.1:10000?pkt_size=1316";

For multicast, use the following URL:

VideoCapture1.Network_Streaming_URL = "udp://239.101.101.1:1234?ttl=1&pkt_size=1316";

Set the Network_Streaming_Output property to FFMPEGEXEOutput to enable UDP streaming.

var ffmpegOutput = new FFMPEGEXEOutput();

ffmpegOutput.FillDefaults(DefaultsProfile.MP4_H264_AAC, true);
ffmpegOutput.OutputMuxer = OutputMuxer.MPEGTS;

VideoCapture1.Network_Streaming_Output = ffmpegOutput;

Visit our GitHub page to get more code samples.