[libav-api] UDP Raw Video Streaming across a VLAN/SUBNET

Tim Visscher timvisscher95 at icloud.com
Mon Nov 13 13:18:54 CET 2017

Dear readers, 

I’m trying to create a cross platform mobile application (iOS and Android), that captures frames from the webcam, encodes them and streams them over UDP to a desktop application. 

I’ve tested my setup and programs and they work just fine when both of the devices stream and receiving are on the same VLAN/subnet. So I decided I would test the receiving end on a Windows PC which is connected by means of an ethernet cable, that unfortunately doesn’t work. The wired PC’s are on a different subnet then the Wi-Fi devices, but there’s sill connectivity between them.  

For example issuing a traceroute or a ping from a laptop connected to the Wi-Fi subnet ( to a PC in the ethernet subnet (  
"traceroute -P ICMP -p 6005”, works just fine.

The stream is openend and used in an comparable manner to this; 

m_filename = "udp://”;
m_fmt_ctx = avformat_alloc_context();
m_fmt_ctx->oformat = m_fmt;
const char* cname = m_filename.toStdString().c_str();
strcpy(m_fmt_ctx->filename, cname);

// …

if (avio_open(&m_fmt_ctx->pb, m_filename.c_str(), AVIO_FLAG_WRITE) < 0) 

// write some packets and when we’re done call avio_close() and wrap up.

if (av_interleaved_write_frame(m_fmt_ctx, packet) < 0) 

The strange thing is when this code is in a “cross subnet” setup such as the example above that all the functions such as avio_open() and av_interleaved_write_frame() return 0, However there’s nothing actually being writing, I’ve confirmed this using Wireshark. 

Does anybody have an idea about what I might be doing wrong? 


More information about the libav-api mailing list