tgorgdotcom / locast2plex

A very simple script to connect locast to Plex's live tv/dvr feature.
MIT License
234 stars 43 forks source link

Error number -138 occurred #256

Closed johndc7 closed 3 years ago

johndc7 commented 3 years ago

I recently set this on on my media server for use with Emby. Everything seems to connect fine but whenever I try to stream a channel, I get the following errors (in locast2plex).

[tcp @ 000001f2945d4a80] Connection to tcp://hls.locastnet.org:443 failed: Error number -138 occurred
[hls @ 000001f2944a8dc0] Failed to open next segment 9 of playlist 0
[tls @ 000001f2945d2e80] Error in the pull function.
[tcp @ 000001f294ca23c0] Connection to tcp://hls.locastnet.org:443 failed: Error number -138 occurred
[hls @ 000001f2944a8dc0] Failed to reload playlist 0
[h264 @ 000001f2946ec0c0] error while decoding MB 65 44, bytestream -17
[tcp @ 000001f294ce9e40] Connection to tcp://hls.locastnet.org:443 failed: Error number -138 occurred
[hls @ 000001f2944a8dc0] Failed to reload playlist 0
[hls @ 000001f2944a8dc0] Could not find codec parameters for stream 1 (Audio: aac ([15][0][0][0] / 0x000F), 0 channels, fltp): unspecified sample rate

Any help would be appreciated 😃

ecowitness commented 3 years ago

locast2plex (L2P), after identifying what variant stream to acquire, uses ffmpeg internally to actually get the transport stream and pass it along

these messages are from that ffmpeg execution and not from the actual L2P code

I have not experienced this particular error code before but will be watching your post progress to find out more about it.

rocky4546 commented 3 years ago

Error code -138 occurs when a connection timeout occurs... This primarily occurs when the TCP packets does not route to the destination address. If it did, then you would either get a connection refused or a connection established. Things that might cause this is a proxy server is in the way so direct comm is not possible. Another is when you have multiple IP addresses and is somehow bound to the wrong IP address. There may be others, but that is where you should start. You can try a few simple things from where the app is running. telnet hls.locastnet.org 443 If you get a connection, then at least you personally have no routing issue. You can also run a wget command in unix with the url or try it from a browser is see if you can connect. If you can connect, then it is possible it is a configuration issue with locast2plex.

ecowitness commented 3 years ago

Can you see the last few L2P messages that were produced before the ffmpeg messages began?

It should look something like: Determining best video stream for maybe a line or two about found playlists, might mention variant streams followed by will use xxxxx resolution at xxxxxxbps followed by a log of the command - - [ ] "GET " 200

I am interested in what was

When you start L2P, can you go to a browser and enter :6077/help which is not a valid L2P command but is known to return a 501 not implemented. Please note that should be replaced by the ip address of where L2P is running, like 192.168.1.10 or some such.

your hls.locastnet.org interests me, as I cannot find that string in the L2P source code. I had a quick look at the URLs that are used to get playlists in my own dma and they do not have hls within them.

Can you share some of your configuration? Are you using Docker? Be sure to obscure your userid and password.

I don't run EMBY, so that is a black box to me.

L2P works well for me and I have had very few issues after running it six months or so. Let's see if we can get it working for you, too.

ecowitness commented 3 years ago

I did not know that these posts throw away anything inside lessthan and greaterthan, which will make my previous post a little hard to determine, since I used that a few times. It should be obvious where I meant to put ip address, like before the :6077, and if it is not, then post again and we'll try again.

johndc7 commented 3 years ago

Well... It works now lol

I didn't change anything. I got tired of messing with it and let it sit overnight and now everything is working.

While it still wasn't working, I tried to access https://hls.locastnet.org in my browser (no issue there). I noticed that it was detecting my channels in the wrong region and since the guide info comes from emby, maybe it was just requesting channels that I don't have. I used the override_zipcode option to correct that but the issue continued. The next day in the morning, everything was fine. Not sure why. I don't think it could have been a connectivity issue since I was able to access https://hls.locastnet.org in my browser and also because it shouldn't have been able to validate my locast credentials if it was. I was also able to stream locast in my browser while having the issue. Emby also was able to match channel names up with the info from locast2plex so it couldn't have been an issue with the connection there (they also both run on the same server).

Anyways, thanks for the help 😃