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

Erik Ackermann kurterikackermann at gmail.com
Tue Nov 14 10:37:07 CET 2017


Tim,

I'm still new to libav dev, but just some thoughts regarding networking.

Since you're using udp which does not ACK, the successful writes/close just
should just mean you were able to put the bytes on whichever network
interface your OS decided to use for that address, not that it was
received. Did you run Wireshark on the sending machine, or receiving
machine only? If using unix/osx, try using netcat to make sure that that
UDP port is accessible across subnets- ICMP is a different protocol and may
be handled differently by your router. The fact that it works in the same
subnet would make me suspect the networking configuration on your
router/wireless AP, since at the system-call level libav would just be
opening a socket to an IP address and shouldn't be any different depending
on the subnet.

Cheers,
Erik

On Mon, Nov 13, 2017 at 4:18 AM, Tim Visscher <timvisscher95 at icloud.com>
wrote:

> 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 (172.16.101.0/24) to a PC in the ethernet subnet (
> 172.16.11.0/24):
> "traceroute -P ICMP -p 6005 172.16.11.102”, works just fine.
>
> The stream is openend and used in an comparable manner to this;
>
> "
> m_filename = "udp://172.16.11.102:6005”;
> 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)
> {
>         /* HANDLE THE ERROR */
> }
>
> // write some packets and when we’re done call avio_close() and wrap up.
>
> if (av_interleaved_write_frame(m_fmt_ctx, packet) < 0)
> {
>         /* HANDLE THE ERROR */
> }
>>
> 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?
>
> Cheers,
> Tim.
> _______________________________________________
> libav-api mailing list
> libav-api at libav.org
> https://lists.libav.org/mailman/listinfo/libav-api


More information about the libav-api mailing list