Forums » Tutorial and setups »
IPTV using Playon
Added by Doctor Eggs over 7 years ago
I have Playon Live TV streams working in TVHeadend, but was wondering if there was a way to get it to work more fluidly.
I'm using the following as the URL (which I got from here: https://tvheadend.org/boards/4/topics/23265?r=24392#message-24392):
pipe:///usr/bin/ffmpeg -loglevel fatal -i http://playonIPaddress/main.m3u8 -c copy -flags +global_header -strict -2 -metadata service_provider=Service_Name -metadata service_name=Service_Name_Live_Stream -f mpegts pipe:1
The problem that I have is that when I first try to tune to that stream it times out. If I try to go to the same channel the second time, it works just fine. I think the problem is that Playon doesn't create the file to stream until after that URL is hit the first time so when I try it the second time the file has been created and it's able to tune to it.
Is there a way that I can have TVHeadend hit that URL twice in my URL string? Or is there some other way of accomplishing this. My current solution is to open the channel, hit stop and then open it again.
Replies (8)
RE: IPTV using Playon - Added by Mark Clarkstone over 7 years ago
Doctor Eggs wrote:
I have Playon Live TV streams working in TVHeadend, but was wondering if there was a way to get it to work more fluidly.
I'm using the following as the URL (which I got from here: https://tvheadend.org/boards/4/topics/23265?r=24392#message-24392):
[...]The problem that I have is that when I first try to tune to that stream it times out. If I try to go to the same channel the second time, it works just fine. I think the problem is that Playon doesn't create the file to stream until after that URL is hit the first time so when I try it the second time the file has been created and it's able to tune to it.
Is there a way that I can have TVHeadend hit that URL twice in my URL string? Or is there some other way of accomplishing this. My current solution is to open the channel, hit stop and then open it again.
Replace the ffmpeg pipe with a bash script that wgets the url & then ffmpeg?
RE: IPTV using Playon - Added by Sean Micklem over 7 years ago
If it's really that ffmpeg is timing out too soon then maybe try
pipe:///usr/bin/ffmpeg -loglevel fatal -timeout 60 -i ...
or
pipe:///usr/bin/ffmpeg -loglevel fatal -stimeout 60000000 -i ...
or
pipe:///usr/bin/ffmpeg -loglevel fatal -listen_timeout 60000 -i ...
I am not sure those options will work in this situation but it is worth a try -timeout sets the maximum timeout (in seconds) to wait for incoming connections (-1 is infinite). -stimeout sets the timeout (in microseconds) of socket TCP I/O operations. -listen_timeout sets some kind of Connection awaiting timeout (in milliseconds). These options all have different meanings depending on how ffmpeg is being used and I am not well-versed enough to explain; the man page (I know, I hate them too) or typing ffmpeg plus the option in a search engine might give you more details on how each of these options is used. By the way, I just randomly picked a 60 second timeout for the values; you can probably get by with a whole lot less, particularly in the case of the second two options - the default values for those are probably in microseconds or milliseconds for a reason, and I would not start with such high values if you choose to try those.
RE: IPTV using Playon - Added by Doctor Eggs over 7 years ago
Thanks for the replies.
Just for reference, I'm running HTS Tvheadend 4.1.2415 ~ LibreELEC Tvh-addon v8.1.109
I tried the bash script but could not get the stream to start even without the wget.
I put the script here:
/storage/.kodi/userdata/addon_data/service.tvheadend42/scripts/ESPN.sh
I changed the permissions to 755.
ESPN.sh looks like this:
#/bin/bash /usr/bin/ffmpeg -loglevel fatal -i http://192.168.1.200:54479/directvnow-354a29a9b1f3da2dd0d49e93644ffdd5/main.m3u8 -c copy -flags +global_header -strict -2 -metadata service_provider=ESPN -metadata service_name=ESPN -f mpegts pipe:1
In Configuration >> DVB inputs >> Muxes I have the following for URL.
URL: pipe:///storage/.kodi/userdata/addon_data/service.tvheadend42/scripts/ESPN.sh
Is there anything additional I need to do?
I tried all three of the timeouts but none of them worked.
-timeout would only work if the stream already existed. I opened the channel once and it would fail but the second time it would succeed.
Here is the log when I try -stimeout
2017-04-13 18:38:08.597 mpegts: ESPN2 in IPTV Automatic Network - tuning on IPTV 2017-04-13 18:38:08.603 subscription: 000C: "192.168.1.200 [ | Kodi Media Center ]" subscribing on channel "HGTV_ServiceName", weight: 150, adapter: "IPTV", network: "IPTV Automatic Network", mux: "ESPN2", service: "ESPN2_ServiceName", profile="htsp", hostname="192.168.1.200", username="192.168.1.200", client="Kodi Media Center" 2017-04-13 18:38:08.603 spawn: Executing "/usr/bin/ffmpeg" 2017-04-13 18:38:08.711 spawn: Option stimeout not found. 2017-04-13 18:38:08.715 iptv: stdin pipe unexpectedly closed: No data 2017-04-13 18:38:18.597 subscription: 000C: service instance is bad, reason: No input detected
-listen_timeout would only work if the stream already existed. Same result as -timeout.
RE: IPTV using Playon - Added by Doctor Eggs over 7 years ago
Does anyone have a working bash script for HTS Tvheadend 4.1.2415 ~ LibreELEC Tvh-addon v8.1.109?
I have searched through this forum and can't seem to find one that successfully launches an IPTV stream in TVHeadend.
RE: IPTV using Playon - Added by Daz Egar over 7 years ago
why are you using pipe??
your input is a mpegts stream no? you seem to be using a htsp profile
so, set your ESPN muxer URL to:-
http://playonIPaddress/main.m3u8
and set the streaming profile to
pass
NOT htsp
why overcomplicate with ffmpeg when not required?
RE: IPTV using Playon - Added by Sean Micklem over 7 years ago
Daz Egar wrote:
why are you using pipe??
your input is a mpegts stream no? you seem to be using a htsp profile
so, set your ESPN muxer URL to:-
[...]
and set the streaming profile to
[...]NOT htsp
why overcomplicate with ffmpeg when not required?
TVHeadend deals primarily in .ts streams. Therefore the purpose of using ffmpeg is to repack the audio and video as a .ts stream rather than a .mp4 stream, or whatever the current format is. Whether that is always necessary is an open question, but it may make a real difference if you are going to try to record from a live stream, or if you are using an older version of TVHeadend.
RE: IPTV using Playon - Added by Ryan Gong over 7 years ago
Doctor Eggs wrote:
Does anyone have a working bash script for HTS Tvheadend 4.1.2415 ~ LibreELEC Tvh-addon v8.1.109?
I have searched through this forum and can't seem to find one that successfully launches an IPTV stream in TVHeadend.
I tried to create simple script similiar to yours. and it does not work for me either.
It seems that it does not execute the file at all...
2017-06-14 14:25:42.284 spawn: Executing "/volume1/appdata/t.sh" 2017-06-14 14:25:42.284 subscription: 0019: "HTTP" subscribing to mux "test", weight: 10, adapter: "IPTV", network: "test", service: "Raw PID Subscription", hostname="10.0.0.119", client="NSPlayer/7.10.0.3059" 2017-06-14 14:25:42.300 iptv: stdin pipe unexpectedly closed: No data 2017-06-14 14:25:58.273 subscription: 0019: service instance is bad, reason: No input detected
Did you find any solution now?
RE: IPTV using Playon - Added by Ryan Gong over 7 years ago
Doctor Eggs wrote:
Does anyone have a working bash script for HTS Tvheadend 4.1.2415 ~ LibreELEC Tvh-addon v8.1.109?
I have searched through this forum and can't seem to find one that successfully launches an IPTV stream in TVHeadend.
try to create a new script file using vi with exact same command. this worked for me.