-
-
Notifications
You must be signed in to change notification settings - Fork 42
Home
This application is used to ingest live MPEG2 transport streams (containing H264/HEVC video and AAC audio) carried over UDP (Multicast or Unicast) for repackaging into HTTP Live Streaming (HLS) (both TS and MP4) and DASH output container formats. The application serves only as a repackaging solution and not as a full origin server. If you require an origin server for your deployment, examples of basic integration with the Nginx and Apache based web servers will be provided, but full configuration of those servers are outside the scope of these instructions.
The software install guide here is for Ubuntu 16.04 server only, however, you can run this on older/newer versions of Ubuntu as well as in Docker containers for AWS/Google cloud based deployments.
cannonbeach@insanitywave:$ sudo apt install git
cannonbeach@insanitywave:$ sudo apt install build-essential
cannonbeach@insanitywave:$ git clone https://github.com/cannonbeach/ott-packager.git
cannonbeach@insanitywave:$ cd ott-packager
cannonbeach@insanitywave:$ make
The above steps will compile the application (it is named "fillet"). Please ensure that you already have a basic development environment setup.
The fillet application must be run as a user with root privileges, otherwise it will not work.
usage: fillet [options]
--sources [NUMBER OF ABR SOURCES - MUST BE >= 1 && <= 10]
--ip [IP:PORT,IP:PORT,etc.] (Please make sure this matches the number of sources)
--interface [SOURCE INTERFACE - lo,eth0,eth1,eth2,eth3]
If multicast, make sure route is in place (see note below)
--window [WINDOW IN SEGMENTS FOR MANIFEST]
--segment [SEGMENT LENGTH IN SECONDS]
--manifest [MANIFEST DIRECTORY "/var/www/html/hls/"]
--identity [RUNTIME IDENTITY - any number, but must be unique across multiple instances of fillet]
--background [RUN IN BACKGROUND - NOT YET FULLY SUPPORTED]
Example:
cannonbeach@insanitywave:$ sudo ./fillet --sources 2 --ip 127.0.0.1:4000,127.0.0.1:4200 --interface lo --window 5 --segment 5 --manifest /var/www/html/hls --identity 1000
This command line tells the application that there are two unicast sources that contain audio and video on the loopback interface. The manifests and output files will be placed into the /var/www/html/hls directory. If you are using multicast, please make sure you have multicast routes in place on the interface you are using, otherwise you will not receive the traffic.
cannonbeach@insanitywave:$ sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
The following methods are useful to diagnose issues:
- Check for streaming network traffic
You can use tcpdump (or wireshark) to see if content is coming in on the network.
To see all of the UDP traffic on a specific network interface
cannonbeach@insanitywave:$ sudo tcpdump -n udp -i eth0
17:45:26.293482 IP 10.0.0.5.46439 > 239.192.1.1.4400: UDP, length 1316
17:45:26.293987 IP 10.0.0.5.44706 > 239.192.1.1.4200: UDP, length 1316
17:45:26.294350 IP 10.0.0.5.44577 > 239.192.1.1.4000: UDP, length 1316
17:45:26.294738 IP 10.0.0.5.46439 > 239.192.1.1.4400: UDP, length 1316
If you are receiving traffic, it will display information about the packets on the interface. You need to use Ctrl-C to break out and stop the capture.
2. Multicast reception issues
Check for the multicast route:
cannonbeach@insanitywave:$ sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
Check to make sure your multicast traffic is not being rejected by the kernel:
In /etc/sysctl.conf, there are two entries that control reverse-path filtering. In some instances depending on how your network is setup, you may have to disable reverse-path filtering. Older variations of Linux had this enabled by default, but it can cause issues with multicast coming from a different subnet.
net.ipv4.conf.default.rp_filter=0
net.ipv4.conf.all.rp_filter=0
You can then run:
cannonbeach@insanitywave:$ sudo sysctl -p
to reread the /etc/sysctl.conf file.
MP4 output mode (HLS and DASH) - still finishing DASH interop
HEVC repackaging
Background mode (run as Linux service)
REST API
Apache/Nginx integration guide (this is just mostly documentation)
Widevine integration
AC3 audio (combo AC3 and AAC)
WebVTT caption output
TTML caption output
Audio only mode
WebDAV publishing
Archiving mode
Docker container deployment instructions
Ad-insert
Blackout
Dynamic segment sizes
Since the packager is not providing any video decoding/encoding service, the hardware requirements are extremely minimal. If you run the your origin server on the same system as the packager, then you may need some additional network and/or disk capacity to guarantee a certain level of throughput.
The application is free to use for commercial and/or private deployments. I do offer fee based consulting so please send me an email if you are interested in retaining me for any support issues or feature development. I have several support models available and can provide more details upon request. You can reach me at: cannonbeachgoonie@gmail.com