Project

General

Profile

Dutch NPO streams as channels in Kodi?

Added by Meindert Oldenburger over 8 years ago

I like to have the free dutch NPO [123] streams be handled as "normal" channels (they should appear in the channel list of Kodi)

But how to get this with IPTV Network


Replies (7)

RE: Dutch NPO streams as channels in Kodi? - Added by Bengt Madeberg over 8 years ago

Use livestreamer and something like this this, npo1.sh

#!/bin/sh
/usr/local/bin/livestreamer --stream-types hls http://www.npo.nl/live/npo-1 best -O | /usr/bin/avconv -re -i pipe:0 -acodec copy -vcodec copy -r 25 -f mpegts pipe:1

Call the script from IPTV mux (URL)

pipe:///home/hts/npo1.sh

RE: Dutch NPO streams as channels in Kodi? - Added by Meindert Oldenburger over 8 years ago

@Bengt: is not working for me, because I get an error. Anny suggestions?

kodi@core2:~$ bin/npo1.sh
ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (Debian 5.4.0-6) 20160609
configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security ' --extra-ldflags='-Wl,-z,relro' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --enable-libvpx --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --enable-libfreetype --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libtesseract --libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --enable-libopus --enable-fontconfig --enable-libpulse --disable-mipsdsp --disable-mips32r2 --disable-mips32r6 --disable-mips64r6 --disable-msa --disable-mipsfpu --disable-mipsdspr2 --enable-libvidstab --enable-libzvbi --enable-avresample --enable-libfdk-aac --enable-libx265 --enable-libbs2b --enable-libilbc --enable-libopenh264 --enable-libkvazaar --enable-libsnappy --enable-libsoxr --disable-podpages --enable-libebur128 --enable-libiec61883 --enable-vaapi --enable-opencl --enable-libdc1394 --disable-altivec --shlibdir=/usr/lib/x86_64-linux-gnu
libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 48.101 / 57. 48.101
libavformat 57. 41.100 / 57. 41.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 47.100 / 6. 47.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
[cli][info] Found matching plugin npo for URL http://www.npo.nl/live/npo-1
Traceback (most recent call last):
File "/usr/bin/livestreamer", line 9, in <module>
load_entry_point('livestreamer==1.12.2', 'console_scripts', 'livestreamer')()
File "/usr/share/livestreamer/livestreamer_cli/main.py", line 886, in main
handle_url()
File "/usr/share/livestreamer/livestreamer_cli/main.py", line 471, in handle_url
streams = fetch_streams(plugin)
File "/usr/share/livestreamer/livestreamer_cli/main.py", line 388, in fetch_streams
sorting_excludes=args.stream_sorting_excludes)
File "/usr/lib/python2.7/dist-packages/livestreamer/plugin/plugin.py", line 313, in get_streams
return self.streams(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/livestreamer/plugin/plugin.py", line 227, in streams
ostreams = self._get_streams()
File "/usr/lib/python2.7/dist-packages/livestreamer/plugins/npo.py", line 60, in _get_streams
return self._get_live_streams()
File "/usr/lib/python2.7/dist-packages/livestreamer/plugins/npo.py", line 50, in _get_live_streams
deeplink = http.get(streamdata['stream'], headers=HTTP_HEADERS).content
KeyError: 'stream'
pipe:0: Invalid data found when processing input

RE: Dutch NPO streams as channels in Kodi? - Added by Bengt Madeberg over 8 years ago

Well, I don't know. I can't check NPO specifically since they are geo restricted. Other channels are fine with the same configuration. I'm not an Linux expert but you use ffmpeg ? I have only tested with avconv. Any permission issues ? It seems that you have problems with livstreamer. Can you check other channels ?

Try,

#!/bin/sh
/usr/local/bin/livestreamer http://www.filmon.com/tv/bbc-one best -O | /usr/bin/avconv
-i pipe:0 -acodec copy -vcodec copy -bsf h264_mp4toannexb -f mpegts pipe:1

RE: Dutch NPO streams as channels in Kodi? - Added by Jonathan Thomson over 8 years ago

Try the below - I use this exact code to stream live footage from my CCTV cameras and have them show up as "channels" in Kodi (it also works with Vevo's HD music channels too which work globally).

pipe:///usr/bin/ffmpeg -loglevel fatal -i http://www.npo.nl/live/npo-1 -vcodec copy -acodec copy -metadata service_provider=NPO1 -metadata service_name=NPO1 -f mpegts -tune zerolatency pipe:1

You need a network for this to work first, just set one up called IPTV (I assume you might already have this set up because you've already tried creating a mux above).

Paste the code above directly into the 'URL' field of a new multiplex and see if you get an 'OK' or 'Failed' response from TVHeadend. If your ffpmeg binary is not in /urs/bin/ffmpeg then replace that with the correct path (use 'which ffmpeg' to get/check the path).

RE: Dutch NPO streams as channels in Kodi? - Added by Meindert Oldenburger over 8 years ago

@Bengt Madeberg: Your example with http://www.filmon.com/tv/bbc-one works fine so I think it has to do with npo.py plugin of livestreamer

Jonathan Young Thomson: It is not working and if I execute your line, without pipe://, directly in xterm it shows/does nothing

RE: Dutch NPO streams as channels in Kodi? - Added by Bengt Madeberg over 8 years ago

Are you in the the Netherlands ? If not you have problems with geo resrictions. You can look at the issue tracker for NPO problems. And about http://www.npo.nl/live/npo-1 it, is not the URL to the live stream !!!! That's what livestreamer is for. It digs for the correct URL form the web page and sends it to tvh..And I can watch some NPO programs. They do no restrict eveything. So it works. Do you have the right version of python ?

RE: Dutch NPO streams as channels in Kodi? - Added by Meindert Oldenburger over 8 years ago

@Bengt Madeberg: I'm in the Netherlands and I was not complete with my answer. Your solution is working, but only once of 5/6 tries. There is also a Kodi NPO APP (Nederland24) that is working fine and is also python. Could be some kind of authentication thing.

    (1-7/7)