TVE Recording Fails Midway Through

Last week and this week my recording of Home Town on HGTV (via TVE with a Spectrum login) failed anywhere about 40 minutes in, then I tried to re-record it later and on got about 20 minutes in. Last week I rebooted the Channels DVR and then recorded another show on HGTV with no problem, but this week same problem again.

I uploaded my diagnostic logs to 99f5c26f-aad5-4693-a510-e7d9e2e9bfa5.

The log shows a file download error and then the stream does restart 10 seconds or so later, but by then NextPVR (which is what I'm using as my DVR with Channels as the source) has given up waiting for more data. I guess I could change the recording over to use Channels as the DVR, but then I lose all my Kodi integration (well, at least the automatic integration - I have a sort of manual integration for Channels).

Have you ensured that this is not an error on the NextPVR end of things? Essentially you are using Channels as a proxy, and that introduces a new point of failure; however, you haven't given any indication that you ruled out and error from the incoming source stream, nor from NextPVR.

What about logs from both Channels and NextPVR?

Here's a chunk of the Channels log.

2021/04/11 14:00:00.597653 [TNR] Opened connection to TVE-Spectrum for ch6104 HGTV
2021/04/11 14:00:00.684733 [HLS] Starting transcoder for channel 6104 from 172.16.1.5 (encoder=remux, resolution=, deinterlacer=, bitrate=5665)
2021/04/11 14:00:01.569612 [HLS] Probed live stream in 883.593323ms: h264 1920x1080 progressive 5428193bps
2021/04/11 14:00:01.649087 [HLS] Session ch6104-dANY-ip172.16.1.5 started in 2.400012431s
2021/04/11 14:25:50.182972 [HLS] ffmpeg: ch6104-dANY-ip172.16.1.5-remux:  [mpegts @ 0x249b8b0] DTS 135249112 < 140258723 out of order
2021/04/11 14:25:50.183075 [HLS] ffmpeg: ch6104-dANY-ip172.16.1.5-remux:  [hls @ 0x24a2f50] Non-monotonous DTS in output stream 0:0; previous: 140258723, current: 140257317; changing to 140258724. This may result in incorrect timestamps in the output file.
2021/04/11 14:27:09.920621 [ERR] Error during stream TVE-Spectrum ch6104 HGTV: Failed to download file: https://x-default-stgec.uplynk.com/auso/slices/a00/e6cf0c55dac249f0a0f72e7c72e6f6cb/a007a30f640a46f98b28903ff00d3b07/F0000010A.ts?pbs=d0df8d4331624fbe8ff9ee8947396480&_jt=l&chid=e047db886d7b42499309a9d3f9e12a7e&cloud=aws&si=1: Get "https://x-default-stgec.uplynk.com/auso/slices/a00/e6cf0c55dac249f0a0f72e7c72e6f6cb/a007a30f640a46f98b28903ff00d3b07/F0000010A.ts?pbs=d0df8d4331624fbe8ff9ee8947396480&_jt=l&chid=e047db886d7b42499309a9d3f9e12a7e&cloud=aws&si=1": context canceled
2021/04/11 14:27:09.959589 [TNR] Closed connection to TVE-Spectrum for ch6104 HGTV
2021/04/11 14:27:10.269334 [HLS] Couldn't generate stream playlist for ch6104-dANY-ip172.16.1.5: Stream stopped
2021/04/11 14:27:10.271707 [HLS] Stopping transcoder session ch6104-dANY-ip172.16.1.5
2021/04/11 14:27:14.060817 [TVE] stream timestamps: hgtv: start_at=2021-04-11T14:26:12-10:00 current_at=2021-04-11T14:26:41-10:00 end_at=2021-04-11T14:26:42-10:00
2021/04/11 14:27:14.061112 [TNR] Opened connection to TVE-Spectrum for ch6104 HGTV
2021/04/11 14:27:14.100322 [HLS] Starting transcoder for channel 6104 from 172.16.1.5 (encoder=remux, resolution=, deinterlacer=, bitrate=5658)
2021/04/11 14:27:15.024672 [HLS] Probed live stream in 923.650386ms: h264 1920x1080 progressive 1654154bps
2021/04/11 14:27:18.239828 [HLS] ffmpeg: ch6104-dANY-ip172.16.1.5-remux:  [mpegts @ 0x14108b0] DTS 130474 < 140666525 out of order
2021/04/11 14:27:18.255327 [HLS] Session ch6104-dANY-ip172.16.1.5 started in 7.131563907s
2021/04/11 14:27:18.296411 [HLS] Session ch6104-dANY-ip172.16.1.5 started in 7.172647645s
2021/04/11 14:42:20.281996 [HLS] Couldn't generate stream playlist for ch6104-dANY-ip172.16.1.5: Playlist has not been updated in 20.139016144s
2021/04/11 14:42:20.282121 [HLS] Stopping transcoder session ch6104-dANY-ip172.16.1.5 (out: 14m49.151722s, finished: false)
2021/04/11 14:42:20.307891 [TNR] Closed connection to TVE-Spectrum for ch6104 HGTV
2021/04/11 14:42:26.045999 [TVE] stream timestamps: hgtv: start_at=2021-04-11T14:41:21-10:00 current_at=2021-04-11T14:41:48-10:00 end_at=2021-04-11T14:41:52-10:00
2021/04/11 14:42:26.046249 [TNR] Opened connection to TVE-Spectrum for ch6104 HGTV
2021/04/11 14:42:26.080280 [HLS] Starting transcoder for channel 6104 from 172.16.1.5 (encoder=remux, resolution=, deinterlacer=, bitrate=5658)
2021/04/11 14:42:27.249531 [HLS] Probed live stream in 1.168755044s: h264 1920x1080 progressive 5504000bps
2021/04/11 14:42:27.308666 [HLS] Session ch6104-dANY-ip172.16.1.5 started in 6.466354075s
2021/04/11 15:03:34.152188 [HLS] Stopping inactive session ch6104-dANY-ip172.16.1.5

Can't see how this can be a NextPVR problem. Channels very clearly loses the connection then re-establishes it. And the time that takes is enough that NextPVR assumes the channel has died. One of the questions is whether if I was using Channels to save the recording if I would get a recording that has periodic 10 second gaps in it. But that doesn't get around the actual problem, it just gives me a recording broken in a different way.

Well, it looks like Channels couldn’t download a segment from the CDN serving the HGTV feed. The segments pointed to in the playlist from the server weren’t there for Channels to get, so it closed the session. Why keep a session open if there’s nothing to receive?

However, it looks like there were existing problems with the feed:

This is most likely a commercial/program boundary, and would have caused problems in the recording. Usually it shows up as the feed jumping around, or the inability to fast forward/skip that portion. Not a dealbreaker—that’s the error that follows it, described above—but still an error in the stream.

So, it’s a Discovery/HGTV problem, not a Channels problem.

If you are feeding another DVR/software using Channels as your source/proxy, it’s probably better to use the streams straight through, without doing any processing. Change the URLs you use to feed your chosen software to:

http://X.X.X.X:8089/devices/ANY/channels/####/stream.mpg

and let the software know it should be expecting MPEG-TS instead of HLS. I bet you’ll find that much more reliable.

The context cancelled error you're seeing is fixed in newer prereleases than the one you're using.

2 Likes