Broadcast video files using VLC multicast. With the theory.
At the request of 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 packets are forwarded to a specific subset of destinations. IP Multicast technology uses addresses from 224.0.0.0 to 239.255.255.255. Static and dynamic addressing are supported. An example of static addresses are 224.0.0.1 - the address of a group that includes all nodes of the local network, 224.0.0.2 - all routers of the local network. The address range 224.0.0.0 through 224.0.0.255 is reserved for routing protocols and other low-level multicast support protocols. The remaining addresses are dynamically used by applications. To determine the members of various groups in the local network, the router uses the IGMP protocol. One of the subnet routers periodically polls the subnet hosts to find out which groups are used by the host applications. For each group, only one response is generated in the subnet. In order to become a member of a new group, the recipient node initiates a request to the router of the local network. The network interface of the destination node is configured to receive packets with this multicast address. Each node independently monitors its active group addresses, and when there is no need to be in this group, it stops sending confirmations to IGMP requests. IGMP query results are used by group routing protocols to transmit group membership information to neighboring routers and further through the network. Each node independently monitors its active group addresses, and when there is no need to be in this group, it stops sending confirmations to IGMP requests. IGMP query results are used by group routing protocols to transmit group membership information to neighboring routers and further through the network. Each node independently monitors its active group addresses, and when there is no need to be in this group, it stops sending confirmations to IGMP requests. IGMP query results are used by group routing protocols to transmit group membership information to neighboring routers and further through the network.
VLC media player (originally from VideoLAN Client) is a free media player.
The program runs on most modern operating systems, in particular:
* GNU / Linux
* BSD (FreeBSD, NetBSD, OpenBSD, Apple Darwin, Mac OS X)
* Solaris
* and other UNIX variants ...
* BeOS family (BeOS, Zeta-OS, Haiku-OS)
* QNX
* MorphOS
* Microsoft Windows
* Microsoft Windows CE
The VLC player can be used as a server to broadcast an audio / video stream over a network (supports IPv4 and IPv6 protocols). To play multimedia files, you do not need to install additional codecs, they are already “built-in” into 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 plays bad files well.
The weak Pentium III 800MHz with 512 Mb RAM and with a disk subsystem in RAID1 was chosen for broadcasting. Gentoo Linux was assigned to all this hardware: VLC was built with the following flags: Accordingly, you can play the flags as you like, the stream flag is required . Description of flags can be spied by the command
equery u vlc from gentoolkit package . The only thing I want to pay attention to is the flag optimizememory . I collected 3 previous versions with it, the process consumed 100% of the processor resources in a couple of days and died.
To start, I wrote a daemon that deleted the old playlist, created a new one and launched vlc itself in screen:
Screen, and not the daemon, was selected to run several channels in parallel, for easier and more convenient monitoring of the process. I need PIDs so that STB and MidlleWare eat everything correctly. Files were converted to: Productivity: 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
Multicast (English multicast)- A special form of broadcasting in which copies of packets are forwarded to a specific subset of destinations. IP Multicast technology uses addresses from 224.0.0.0 to 239.255.255.255. Static and dynamic addressing are supported. An example of static addresses are 224.0.0.1 - the address of a group that includes all nodes of the local network, 224.0.0.2 - all routers of the local network. The address range 224.0.0.0 through 224.0.0.255 is reserved for routing protocols and other low-level multicast support protocols. The remaining addresses are dynamically used by applications. To determine the members of various groups in the local network, the router uses the IGMP protocol. One of the subnet routers periodically polls the subnet hosts to find out which groups are used by the host applications. For each group, only one response is generated in the subnet. In order to become a member of a new group, the recipient node initiates a request to the router of the local network. The network interface of the destination node is configured to receive packets with this multicast address. Each node independently monitors its active group addresses, and when there is no need to be in this group, it stops sending confirmations to IGMP requests. IGMP query results are used by group routing protocols to transmit group membership information to neighboring routers and further through the network. Each node independently monitors its active group addresses, and when there is no need to be in this group, it stops sending confirmations to IGMP requests. IGMP query results are used by group routing protocols to transmit group membership information to neighboring routers and further through the network. Each node independently monitors its active group addresses, and when there is no need to be in this group, it stops sending confirmations to IGMP requests. IGMP query results are used by group routing protocols to transmit group membership information to neighboring routers and further through the network.
VLC media player (originally from VideoLAN Client) is a free media player.
The program runs on most modern operating systems, in particular:
* GNU / Linux
* BSD (FreeBSD, NetBSD, OpenBSD, Apple Darwin, Mac OS X)
* Solaris
* and other UNIX variants ...
* BeOS family (BeOS, Zeta-OS, Haiku-OS)
* QNX
* MorphOS
* Microsoft Windows
* Microsoft Windows CE
The VLC player can be used as a server to broadcast an audio / video stream over a network (supports IPv4 and IPv6 protocols). To play multimedia files, you do not need to install additional codecs, they are already “built-in” into 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 plays bad files well.
The weak Pentium III 800MHz with 512 Mb RAM and with a disk subsystem in RAID1 was chosen for broadcasting. Gentoo Linux was assigned to all this hardware: VLC was built with the following flags: Accordingly, you can play the flags as you like, the stream flag is required . Description of flags can be spied by the command
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
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%)"
equery u vlc from gentoolkit package . The only thing I want to pay attention to is the flag optimizememory . I collected 3 previous versions with it, the process consumed 100% of the processor resources in a couple of days and died.
To start, I wrote a daemon that deleted the old playlist, created a new one and launched vlc itself in 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
Screen, and not the daemon, was selected to run several channels in parallel, for easier and more convenient monitoring of the process. I need PIDs so that STB and MidlleWare eat everything correctly. Files were converted to: Productivity: 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
Формат : 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 бит
30 second output rate 2000 bits / sec, 2 packets / sec