Project

General

Profile

Need help with IPTV streams.

Added by nope nope over 2 years ago

Hello all, I have TVHeadend setup with my (paid) IPTV provider and I am having some very frustrating issues with it.

I’ll start off by saying if I open one of the channel streams in VLC it will play for hours and hours with little to no issue, and when there is an issue it recovers within about a second and just keeps playing.

Now with TVHeadend I get constant dropouts, buffering, pixelated picture, and it jumping back about 10sec. I primarilily use kodi as my front end and I have the stream profile set to restart on error, but I can’t tell if it helped or not. The weird part is when this happens TVHeadend doesn’t seem to register it as an error (at least not that I can see)

So after allot of googling I read about using an ffmpeg pipe to help smooth things out, so I created a cron job with a small script to grab my m3u file and add the correct data to it, and after painstakingly reorganizing all my channels all over again I decided to sit back and watch some tv. To my surprise other than it making switching channels take a bit longer it seemed to work great...until it hit it first hiccup, now when there’s a hiccup the stream recovers almost instantly but without any audio!

I’m pulling my hair out over here. It’s like I have to choose between constant issues, that normally recover fine, but happen so often that it’s sometimes unwatchable. OR I can choose to have significantly less issues but when it happens I loose audio and have to restart the channel...both options leave me with something I wouldn’t consider “watchable”

I know I can’t be the only one, I hope someone can shed some light on these issues.


Replies (4)

RE: Need help with IPTV streams. - Added by Riku B about 2 years ago

I was struggling with this problem today, as im new to tvheadend im setuping it now for a week, fine-tuning everything (replacing mythtv)
My problem was just the same, missing sound caching all time etc.. and WORSEST putting recording on and watch it same time it make tvheadend crash!!
I came across this software called streamlink, it suppose to make hls streams usable with any software and it supports pipe.
Also i was struggling how to get it working but finally after reading and researching i found an answer.

first install the software, if you have newest ubuntu 18 just use
sudo apt install streamlink

create a script (you need do this, it will not work direct):
nano /opt/streamlink.sh
#!/bin/bash
streamlink --stdout --hds-segment-threads 3 "$1" best

After edit use command chmod 755 nano /opt/streamlink.sh
Go to the mux and replace the pipe command with pipe:///opt/streamlink.sh http://your_url.m3u

Be aware, setup those settings well on your system. read documents of streamlink. you might take look of threads and "best" what they mean.. tuning streamlink will improve the quality of stream but it will need more bandwidth..
to check if it work open TOP and see if streamlink is there when you select the channel on live-tv. Recording works also. done test record over one hour without any problems...
Reason why im answering this post, is spend many hours looking for answer on this problem, hope this help others as well.
So if ppl have breaking up streams or buffering problems, you can try pipeing to other software what is meant to that specific stream. you can do this to other types of streams as well as long they work on linux, they can put work on tvheadend some way..

RE: Need help with IPTV streams. - Added by Robert Cameron about 2 years ago

Is your IPTV provider giving you MPEG Transport Stream (TS) streams, or are they HLS or DASH streams? Tvheadend only really supports the former, for everything else you would need to pipe the stream to something else.

From your second post, it sounds as if they're HLS, which means that your experience was related to the source stream, not Tvheadend, as the root of the problems.

RE: Need help with IPTV streams. - Added by Riku B about 2 years ago

on my case it is ts inside hls chunks. as you see on script im not transcoding to mpeg, there is possibility to bring any online iptv and transcode with ffmpeg on fly via that script if wanted to tvheadend :) this open door to automated scripts and bringing in unsupported streams. but be keep in mind this type of importing things to tvheadend is not supported by devs and if problems will occur you need solve them itself :P

ffmpeg not support well hls, the problem is solved by streamlink.

RE: Need help with IPTV streams. - Added by Robert Cameron about 2 years ago

Riku B wrote:

on my case it is ts inside hls chunks. as you see on script im not transcoding to mpeg, there is possibility to bring any online iptv and transcode with ffmpeg on fly via that script if wanted to tvheadend :) this open door to automated scripts and bringing in unsupported streams. but be keep in mind this type of importing things to tvheadend is not supported by devs and if problems will occur you need solve them itself :P

ffmpeg not support well hls, the problem is solved by streamlink.

"Segmented" streams such as those used by HLS and DASH are not Transport Streams. It is a playlist listing multiple segments of Transport Streams which represent a larger stream. Tvheadend does not support this. What Tvheadend supports is a single continuous transport stream, which in your situation appears to only be achievable by using a pipe:// mux pointing to an external tool.

    (1-4/4)