udpsink to specific interface
Peter Maersk-Moller
pmaersk at gmail.com
Sat Mar 1 12:43:40 PST 2014
Normally an IP packet should go out through interface for which its
destination address is to be routed. This means that it is the routing
tabel and the network layer that determines the routing of IP packets.
Normally there is a very good reason for that and normally there is a
reason why the application level should not interfering with lower levels
on the network stack.
But lets for arguments sake say we allow the application layer to make that
decision, then udpsink has the variable 'bind-address'. Using this, you can
easily select the interface udpsink binds to.
P
On Sat, Mar 1, 2014 at 9:34 PM, Joseph Olivier <jolivier at picodigital.com>wrote:
> Perhaps I was unclear about my scenario. I have an embedded linux system
> with multiple (VLAN) ethernet interfaces that generates MPEGTS data to
> distribute via UDP multicast.
>
> So, under `ifconfig`, I have several interfaces, such as: eth0, eth0.10,
> eth0.12, eth0.25, eth0.30. Each of these "dot" interfaces sends packets via
> a different VLAN (eth0.X goes on VLAN X).
>
> I need to ensure my video stream goes out (not to) a particular interface
> so that it gets the correct VLAN tag. For example, I need to target
> specifically `eth0.25` from the example above.
>
> If I have direct control of the socket, I can call set_sockopt() with
> SO_BINDTODEVICE. Can this be done with udpsink? What would be the best way
> to ensure that my (multicast) packets go out the appropriate interface?
>
>
> On Sat, Mar 1, 2014 at 11:43 AM, Peter Maersk-Moller <pmaersk at gmail.com>wrote:
>
>> Hi Jospeh
>>
>> It is rather trivial to identify the IP address though you may have to
>> customize it to your system
>>
>> #!/bin/bash
>> get_ip()
>> {
>> ifconfig $1 |grep 'inet addr' |cut -f2 -d: |cut -f1 -d' '
>> }
>>
>> gst-launch ....... upsrc host=`get_ip eth0`
>>
>>
>>
>>
>>
>> On Sat, Mar 1, 2014 at 8:23 PM, Joseph Olivier <jolivier at picodigital.com>wrote:
>>
>>> I'm generating a video stream which I send via UDP multicast. But the
>>> packets have to go out a specific Linux ethernet interface (with a VLAN
>>> tag).
>>>
>>> Looking at udpsink, seems like the only configurables are HOST and PORT,
>>> which would not trivially allow me to identify the target interface. I'm
>>> looking for a strategy that more-or-less executes a bind-to-device(ethX) or
>>> a workaround.
>>>
>>>
>>> Thanks,
>>> Joe
>>>
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> gstreamer-devel at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>>
>>>
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140301/43c4543c/attachment.html>
More information about the gstreamer-devel
mailing list