Search code examples
streamudpprotocolspacket

Video transmission over wifi using UDP/packet injection


Hey Stackoverflow community :)

Im looking into making a camera stream video from a an RC device into a computer using wifi.

After considering all of the options I had Im left with two:

  1. use UDP to transfer video in packets
  2. use packet injection and packet sniffing on the receiving device.

I was wondering what are the pros and cons of each method (for that specific purpose of video transmission)? after looking around I found many implementations for both ways but nowhere have they specified why one is better than the other.

few things that I have not mentioned:

  1. I know UDP does not have error correction which can make the video weird- I dont care about the quality of the video as long as it will be recognizeable. I dont want to use connection based protocol (TPC, etc)- I dont want to wait for handshake when I get disconnected.

thanks :)


Solution

  • I'm trying to do a similar thing. My take on this is basically when you use the wifi cards in monitor mode (i.e. using packet sniffing/injection) you don't actually need to be connected to that network. Typically, you still need to be connected to an Access point as a client then you can communicate using UDP through that connection. But, in this case, the UDP messages are routed to the Wifi cards and the packets are injected out without being associated with any client. Then, any 'client' just has to sniff or listen on that same channel to get the transmission. So the benefit is not only does UDP not check for lost frames/etc, but also in this case you don't need to be connected to the network to get the packets.

    In my case, this is preferable, since basically you will need to connect to the AP in the former case and that would require more capable hardware on the receiver side typically (more range is needed for the association part since you need to send messages back over TCP essentially to get it connected).

    FYI here are the links/repos I am using and it also is a reference to what I am talking about https://docs.px4.io/master/en/tutorials/video_streaming_wifi_broadcast.html https://github.com/svpcom/wifibroadcast

    I am using an off the shelf 'solution' in the short term, the Accsoon Cineye Air, which basically transmits HDMI 300ft line of sight over WiFi. You need an android phone to receive it, and basically I'm using the Vysor application (paid version is $40) to mirror the screen to my desktop. It works, but the latency is still more than I want : 60ms at least from the cineeye, so you can drive it around but its not as quick as DJI which is around 30-40ms ), which is my goal.