Converting your multicast IPTV Freeview to HTTP unicast using udpxy(udp multicast to http的LINUX TOOL)

Converting your multicast IPTV Freeview to HTTP unicast using udpxy(udp multicast to http的LINUX TOOL)

Converting your multicast IPTV Freeview to HTTP unicast using udpxy(udp multicast to http的LINUX TOOL)

 

資料來源: http://angrytechnician.wordpress.com/2012/07/31/converting-your-multicast-iptv-freeview-to-http-unicast-using-udpxy/

GOOGLE: udp multicast to http

VLC測試:http://192.168.0.100:9090/udp/224.8.8.135:13521

————————-

 

So, by now you’ve read my previous guides about streaming Freeview/DVB-T channels to your network using VLC  and dvblast :

  1. 1.                                The Angry Technician’s Guide to streaming Freeview via VLC, you Idiots
  2. 2.                                How to stream EVERY channel from Freeview onto your network
  3. 3.                                How to stream Freeview HD (DVB-T2) over multicast using dvblast, you Idiots

If you haven’t, you are slacking a bit, as they’ve been up for a while and are the top 3 posts ever on here by pageviews. According to the WordPress.com stats, #2 has been viewed more than 33,000 times, which is frankly a ridiculous number.

Anyway, after all that reading, you might be thinking yo yourself “well, multicast streaming is all nice and fancy, but what I want is some good old-fashioned unicast”. It’s a question that has come up a few times, especially as dvblast will only output multicast streams, so if you want multiple channels per tuner, you are stuck with multicast. There are a few reasons this might not suit your needs, however:

  • Not all of your network supports multicast (especially true if you have cheap and nasty edge switches).
  • You want to view the streams on clients that don’t have multicast software available (e.g. smartphones).
  • You want to access the streams from a different network (e.g. streaming from one location to another over the Internet or a WAN/VPN).

Well, you are in luck. There is another bit of totally free open-source software that will make that conversion for you.

udpxy

udpxy  is a piece of software that can site on your network (either on the same box as dvblast or any other Linux client tat can see the streams) that will convert the RTP multicast stream to HTTP unicast.

Like dvblast, it’s very small with low CPU and memory usage, and it doesn’t do any transcoding: all it does is strip the RTP headers and spit out the MPEG transport stream over HTTP. This means it won’t le you view the stream with something like Windows Media Player, but it does open up the options to some software that doesn’t support multicast.

Step 1: Download and compile

There are no packages for udpxy (yet), so download the source to your Linux box and extract it like so:

tar -xzvf udpxy.1.0.23-0-prod.tar.gz

Now change directory into the new udpxy-1.0.23-0 directory and compile & install the software like so:

sudo make install

This will install two new programs into /usr/local/bin  udpxy andudpxrec. I’m only dealing with udpxy here, but feel free to run udpxreclater with no parameters and have a play.

Step 2: Run udpxy

Unless you have an unusual setup with more than 1 network card, all you should need to do now is start udpxy running with a port of your choosing. I use port 4022 since it’s used in the examples when you run udpxy without any parameters, and ports above 1024 don’t require any special permissions:

udpxy -p 4022

There are more configuration options available: run udpxy with no parameters for a list.

Now, if all is well, you should be able to browse to the following address in your browser

http://192.168.1.1:4022/status

If it’s working, you should see something like this (click to enlarge):

 

Step 3: Tuning in

If you’ve paid attention to the above status screen, you should already be able to tell how to tune in. In my example setup, I can open the following in VLC:

http://192.168.1.1:4022/rtp/239.255.1.1:5044

This will start receiving an RTP multicast stream from 239.255.1.1 on port 5004 (which is BBC One in my setup) and will relay it over HTTP.

Step 4: Schedule udpxy to start automatically

As per my previous guides, here is an upstart script to start udpxy when the machine boots and the network card (eth0) comes up:

1

2

3

4

5

6

7

8

9

# dvb-udpxy

#

 

description     “DVB streaming, UDPXY Proxy”

 

start on net-device-up IFACE=eth0

stop on net-device-down IFACE=eth0

 

exec udpxy -T -p 4022 -c 50

I’ve added the -c 50 here to change the maximum number of supported clients to 50 (the default is 3). You will need a gigabit ethernet card if you hope to support even nearly this many clients, and I haven’t tested it under load yet, so don’t come crying to me if it all goes wrong.

Step 5: Do something interesting

For testing I was just opening the stream in VLC, but I can do that with the multicast stream. What about something that couldn’t pick up the multicast stream? Say, my Android smartphone?

 

Note to self: clean my screen more often

It’s worth noting that my HTC One X is fairly new and a higher spec than a lot of current phones, and while it runs SD streams with no problems, HD streams are too much for it, so your results may vary. I also needed some additional software as the included video player couldn’t decode MPEG/TS.I tested a few free ones but they all had audio sync problems, so I sprang for VPlayer in the end, which works perfectly. On iOS devices, the AnyPlayerAD app works quite well. Update: As of January 2014, I would recommend VLC on iOS , or GoodPlayer for Android (which has both an ad-supported  and a paid Pro version ). VLC on Android  also worked for me, but is an early beta so no UPnP support (see below).

If your outgoing bandwidth will handle it, you could also forward a port from your router to the internal Linux box and watch over the Internet. Note that there is no authentication involved, so I wouldn’t recommend leaving it configured this way for any long amount of time. A more sensible approach to remote viewing would be to use a VPN.

Step 6: Advertising the feeds

You won’t be able to use SAP announcements for the HTTP streams as SAP is specifically designed to advertise multicast streams. You could distribute the stream URLs via an internal webpage (though you may have to copy the links via a long-press and paste into the app), or you could install the MediaTomb  UPnP server on your Linux box to advertise the streams as External URLs.

I’m not going to go into this in detail, but it’s not as hard as the documentation makes it seem (especially if you install it on Ubuntu via Synaptic), and frankly, I’m not doing all your work for you. One hint I will give you is that for some devices (e.g. iOS running AnyPlayerAD), you’ll need to add a fake /stream.mpg suffix to the end of the stream URL to get your player software to recognise the stream correctly. udpxy will ignore the suffix, so it will still play just fine.

…and finally

I’ve recently been directed to the MuMuDVB  package which is based ondvblast and attempts to automate some/all of the setup of my DVB streaming guides (including this one). I haven’t tested it myself but it is reported to work well. You’ll still need to do some work if you want to be picky about your channels, so it’s still not completely a point-and-click setup.

 

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *