I use this version on Ubuntu 16.04
https://github.com/sstativa/captureb...ive/master.zip
and it works pretty well.
The only problem you might get is rtmpdump.
By default Ubuntu 16.04 has already had pre-installed version of rtmpdump, but to use this script you will have to compile and install patched version: rtmpdump-ksv.
After you execute
you need to find librtmp.so.1 file in rtmpdump-ksv directory and manually copy it in /usr/lib/x86_64-linux-gnu/ directory (or /usr/lib/x86_32-linux-gnu/). Otherwise there will be a "collision" between the old and patched version of rtmpdump.