Upon request, I rewrite the article with the addition of theoretical knowledge. So, a couple of definitions:
Multicast (English multicast) - a special form of broadcasting in which copies of the packets are sent to a specific subset of recipients. IP Multicast technology uses addresses from 224.0.0.0 to 239.255.255.255. It supports static and dynamic addressing. An example of static addresses are 224.0.0.1 - the address of a group that includes all the nodes of the local network, 224.0.0.2 - all routers of the local network. The address range from 224.0.0.0 to 224.0.0.255 is reserved for routing protocols and other low-level multicast support protocols. The remaining addresses are dynamically used by applications. The router uses the IGMP protocol to identify members of different groups on the local network. One of the subnet routers periodically polls the subnet nodes to find out which groups are used by the host applications. Only one response per subnet is generated per group. In order to become a member of a new group, the recipient node initiates a request to the router’s local network. The network interface of the receiving node is configured to receive packets with this multicast address. Each node independently monitors its active multicast addresses, and when there is no need to belong to this group, it stops sending acknowledgments to IGMP requests. The results of IGMP queries are used by multicast routing protocols to transfer information about group membership to neighboring routers and further over the network.
VLC media player (originally from VideoLAN Client) is a free media player.
The program works on most modern operating systems, in particular, on:
* GNU / Linux
* BSD (FreeBSD, NetBSD, OpenBSD, Apple Darwin, Mac OS X)
* Solaris
* and other varieties of UNIX ...
* BeOS Family (BeOS, Zeta-OS, Haiku-OS)
* QNX
* MorphOS
* Microsoft Windows
* Microsoft Windows CE
The VLC player can be used as a server for streaming audio / video over the network (supports IPv4 and IPv6). To play multimedia files, no additional codecs are required, they are already “embedded” in the program. VLC can play DVD and streaming unencrypted (free) video (IPTV) and Internet radio. The program can also record streaming audio / video to a computer. VLC well reproduces corrupted files.
')
For broadcasting, a weak Pentium III 800MHz with 512 Mb RAM and with a disk subsystem in RAID1 was chosen. Gentoo Linux resurfaced with all this hardware:
Portage 2.1.6.4 (default/linux/x86/2008.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-gentoo-r8 i686)
=================================================================
System uname: Linux-2.6.25-gentoo-r8-i686-Pentium_III_-Coppermine-with-glibc2.0
Timestamp of tree: Mon, 09 Feb 2009 22:15:02 +0000
app-shells/bash: 3.2_p39
dev-lang/python: 2.4.4-r13, 2.5.2-r7
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox: 1.2.18.1-r2
sys-devel/autoconf: 2.13, 2.63
sys-devel/automake: 1.7.9-r1, 1.9.6-r2, 1.10.2
sys-devel/binutils: 2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool: 1.5.26
virtual/os-headers: 2.6.27-r2
VLC was compiled with the following flags:
media-video/vlc-0.9.7 USE="a52 aac ffmpeg hal libgcrypt mp3 mpeg ncurses stream x264 -X -aalib -alsa (-altivec) -arts -atmo -avahi -bidi -cdda -cddax% -cddb -cdio -dbus -dc1394 -debug -dirac -directfb -dts -dvb -dvd -esd -fbcon -flac -fluidsynth -fontconfig -ggi -gnome -gnutls -httpd -id3tag -jack -kate -libass -libcaca -libnotify -libsysfs -libv4l2 -lirc -live -lua -matroska -mmx -modplug -musepack -nsplugin -ogg -opengl -optimisememory -oss -pda% -png -pulseaudio -pvr -qt4 -remoteosd -rtsp -run-as-root% -samba -schroedinger -sdl -sdl-image -seamonkey -shout -skins -speex -sse -svg -svga -taglib -theora -truetype -twolame -upnp -v4l -v4l2 -vcdinfo -vcdx -vlm -vorbis -win32codecs -xinerama -xml -xosd -xv -zvbi (-vcd%)"
Accordingly, you can play the flags to someone as you like, the
stream flag is obligatory. A description of the flags can be found using the
equery u vlc command from the
gentoolkit package. The only thing you want to pay attention to is the
optimisememory flag. I collected 3 previous versions with it, the process in a couple of days devoured 100% of processor resources and died.
To start, I wrote a demon that deleted the old playlist, created a new one and ran vlc itself on the screen:
vlc -v /home/ftp/pub/playlist.m3u --sout '#standard{access=udp{ttl=15},mux=ts{tsid=22,pid-video=23,pid-audio=24,pid-pmt=25,use-key-frames},dst=[multcast ip]}' --random --loop --volume 100
A screen, rather than a demon, was chosen to run several channels in parallel, for easier and more convenient monitoring of the process. I need PIDs so that STB and MidlleWare can eat everything correctly. Files converted to:
: MPEG Video
: Version 2
: Standard
:
: 7 762 /
: 1 920 .
: 1 080 .
: 16/9
: 30,000 /
: 4:2:0
:
: MPEG Audio
: Version 1
: Layer 2
:
: 64,0 /
() : 2 ()
: 44,1
: 16
Performance:up 70 days, 17:08, load average: 0.16, 0.17, 0.11
Network load:30 second input rate 8718000 bits / sec, 801 packets / sec
30 second output rate 2000 bits / sec, 2 packets / sec